Redeem liquidity
/dex/redeemapi_keyClose a provision directly and return its share of the reserves. Unclaimed fees are lost when the provision is spent — claim them first, or set acknowledgeUnclaimedFees to accept that. POST /dex/orders/redeem places a redemption as an order.
Request body
LDRedeemRequest · application/jsonprovisionBoxIdstringrequiredminAmountXstringLeast you will accept back on the ERG side. Decimal string.
minAmountYstringThe same on the token side. Decimal string.
expectedPoolBoxIdstringThe pool box this was quoted against
acknowledgeUnclaimedFeesbooleanMust be true to redeem a provision that still has unclaimed fees, which are lost when it is spent. Ignored when there are none.
Responses
200Result of the redemption transactionLDRedeemResult▶
outcomestringrequiredNode submission outcome; uncertain retains the known transaction ID and input ownership.
one ofacceptedrejecteduncertainsharesstringrequiredamountXstringrequiredamountYstringrequiredtxIdstringrequired
400Malformed body, or the provision has unclaimed fees and `acknowledgeUnclaimedFees` was not set. ApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description
404No live provision with that id.ApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description
409The pool or provision moved. Re-read and quote again.LDStateChangedResponse▶
errorintegerrequiredreasonstringrequireddetailstringrequiredWhat moved, and what it moved to
poolBoxIdstringCurrent pool box id
vaultBoxIdstringCurrent vault box id
provisionBoxIdstringCurrent provision box id
422Returns less than the given bounds, or the pool refuses the redemption.ApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description
503Node or wallet unavailable. Retry.ApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description
defaultErrorApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description