Vault Liquidity
Redeem from Vault
Redemption calldata for shares of a vault connected to this market, and its confirmation
POST
Builds the
redeem transaction that turns a holder’s shares in one of this market’s connected vaults back into the vault’s asset, the market’s settlement token (stablecoin). The holder’s wallet signs it. No approval is needed, since the vault burns the holder’s own shares.
Any vault connected to this market can be redeemed through it, whether or not its operator has published it. Nothing on the vault can pause a redemption. Send the same call again with the transaction’s hash to confirm it.
For a fill estimate, use Redeem on the vault surface for a vault visible to your instance. It returns willFillFully and expectedPayout before the signature. That call also checks the holder against the vault’s register, which a vault on an earlier implementation still applies to redemptions. This call does not, so a redemption from such a vault by an unverified holder reverts on-chain.
Path Parameters
string
required
Market ID.
string
required
A vault connected to this market, from List Connected Vaults.
0x followed by 40 hex characters. A mixed-case address must pass its EIP-55 checksum.Body Parameters
Shares to redeem as a decimal string. Digits with an optional fraction, greater than zero, parsed at the vault’s asset decimals, which are also its share decimals. A finer fraction answers
VALIDATION_ERROR. Required when building calldata, ignored when confirming.string
The wallet that will sign.
redeem burns the caller’s own shares, so shares is checked against this wallet’s balance before any calldata is built. Required when building calldata, and omitting it answers VALIDATION_ERROR. Ignored when confirming.string
Hash of the mined redemption. Send it on its own to confirm and record the redemption. Omit it to receive the calldata.
Confirm the redemption
Send the redemption’s hash back to this same endpoint as{ "txHash": "0x..." }, as confirmWith names. The API verifies the receipt against the vault and reads what was paid from the vault’s Redeemed event.
amount on the confirm response is the assets actually paid, not the value of the shares requested. A partial fill shows as an amount below the value of the shares you redeemed. When the vault has a Trusset record, the redemption is written to the vault’s transaction history, and recorded says so.
Response Fields
object
Error Codes
Confirming with
txHash can also return any transaction verification error.