Selling
A sell turns BLUEDW back into USDCx: your send, the vault's in-kind redemption, the relay's DEX sales, and your accept. A seller receives USDCx, not the underlying coins.
1. The send (signature one)
The app checks the minimum ($0.02 of NAV) and that the wallet keeps enough USDCx for the two transactions' fees. It builds a private P2ID note carrying your BLUEDW to the operator account, saves it locally, and hands it to the relay through /api/relay-redeem, resending until the relay confirms. Sells have no maximum and are never paused, even when buys are. Under heavy load the relay can ask the app to retry; the app keeps the note and resends.
2. The in-kind redemption
The relay sends your shares to the vault in a redeem note. The network executes it against the vault, which:
- checks the note carries this vault's own BLUEDW;
- reads the supply
Sand each holdingH_i, before anything moves; - releases
a_i = s·H_i/Sof each coin to the recipients named in the note (here, the operator); - burns the shares.
No price is read. Your share of the vault is your share of every coin in it.
The redeem script does not restrict who sends it. Anyone holding BLUEDW can redeem directly against the vault this way and receive the coins themselves. The app always goes through the relay, because you asked for USDCx.
3. The relay's sales
The relay consumes the released coins and places one PSWAP sell order per coin, with a floor from live prices. An order that does not fill is re-priced and placed again until everything is sold. There is no fallback that hands you coins, and no operator buyout of a remainder: the process is the same whatever the size.
When the sales are done, the relay keeps 30 bps of the USDCx and sends the rest to you in one private P2ID note.
4. The accept (signature two)
The app fetches the return note with your view proof and checks it before prompting: a standard P2ID to exactly your account, carrying only USDCx or the basket's coins. Then your wallet consumes it.
Timing
Measured over the first 46 sells on mainnet: median 125 seconds, 90% within about 4 minutes (241 s), measured from the relay receiving the note to the return note being confirmed. A sell can take longer than a buy because each coin must be sold separately and sells pay a little more spread.
Finishing a sell later
If the second signature is never given (tab closed, wallet locked), the USDCx note waits. Claim pending trades in the portfolio finishes it on the same device.
Failure modes
| What happens | Result |
|---|---|
| You close the tab after signing | The app resends the note to the relay the next time you open it |
| The relay restarts mid-trade | Its write-ahead ledger replays every open trade from where it stopped |
| A sell order does not fill | It is re-priced until it does; there is no in-kind fallback |
| The network gives up on the redeem note | The sender can consume its own redeem note and get the shares back (v2 reclaim branch) |
| The relay's note fails the app's check | No wallet prompt appears; nothing is signed |
| You never give the second signature | The USDCx note waits. Claim pending trades finishes it, on the same device |