Quote a swap order
/dex/orders/swap/checkQuote a swap order against the current pool without placing it. The executor fee is paid on top of amountIn when selling ERG, and out of the ERG received when selling the token.
Request body
LDSwapOrderRequest · application/jsonamountInstringrequiredTotal handed to the pool, pool fees included. The executor fee is separate. Decimal string.
ergInbooleanrequiredTrue to sell ERG for the token, false to sell the token for ERG
executorFeestringnanoERG paid to whoever fills the order. A fill broadcast to the mempool pays its miner fee out of this. Miners skip orders paying less than they accept. Omit for the client's default. Decimal string.
maxMinerFeestringMost nanoERG a fill may pay as a miner fee, out of
executorFee. Must be belowexecutorFee. Omit for the client's default. Decimal string.
Responses
200Quote for the requested swap orderLDSwapOrderQuote▶
▶
swapLDSwapQuoterequiredQuote for a LithosDex swap
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.
executorFeestringrequiredThe executor fee applied, the request's or the client's default. Decimal string.
maxMinerFeestringrequiredThe miner fee cap applied. Decimal string.
netOutputstringrequiredWhat the owner receives if the order fills against the current pool:
swap.amountOut, lessexecutorFeewhen selling the token. Negative when the fee exceeds the output, and such an order cannot fill. Decimal string.totalErgRequiredstringrequirednanoERG locked in the order box:
ergReturned, plusamountInandexecutorFeewhen selling ERG. Decimal string.ergReturnedstringrequirednanoERG of
totalErgRequiredreturned to the owner with the fill. Decimal string.networkFeestringrequirednanoERG paid to place the order. Decimal string.
400Malformed body, a non-positive `amountIn`, or a `maxMinerFee` not below `executorFee`.ApiError▶
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