Quote a swap by desired output
/dex/swap/checkOutputThe reverse quote — what must go in for amountOut to come out. Returns 422 when the pool cannot produce that much.
Request body
LDSwapOutputRequest · application/jsonamountOutstringrequiredAmount that should come back out. Decimal string.
ergInbooleanrequired
Responses
200Quote for the requested outputLDSwapQuote▶
ergInbooleanrequiredamountInstringrequiredTotal handed to the pool, fees included. Decimal string.
protocolFeestringrequiredTaken out of the input and set aside for liquidity providers. Decimal string.
ammFeestringrequiredThe curve's own fee on the remainder; stays in the pool. Decimal string.
tradedInstringrequiredWhat actually reaches the curve — amountIn less protocolFee. Decimal string.
amountOutstringrequiredWhat comes back. Decimal string.
totalFeestringrequiredEvery fee the swap pays, on the input side. Decimal string.
spotBeforenumber · doublerequiredPre-trade price, ignoring fees and depth
spotAfternumber · doublerequiredPrice once the swap lands, ignoring fees
executionPricenumber · doublerequiredOutput per unit of input, fees and depth included
priceImpactnumber · doublerequiredHow far execution fell short of the pre-trade price, as a fraction
isExecutablebooleanrequiredFalse when the pool would reject the swap — nothing reaches the curve, or the output would meet or exceed the reserve it is drawn from.
400Malformed body, or a non-positive amount.ApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description
422Pool cannot produce the requested outputApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description
503Node 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