Place a swap order on any pool
/dex/pools/{poolNft}/orders/swapapi_keyLocks amountIn of tokenIn in an order any LithosDex miner fills for executorFee, at no less than minOutput. Refused on a pool whose genesis has problems, which can be drained. On a pool the verified list does not name, acknowledgeUnverified must be true; its genesis is checked first if the index has not checked it yet.
Path parameters
poolNftstringrequiredThe pool's NFT id, 64 hex characters
Request body
LDPoolSwapExecuteRequest · application/jsontokenInstringrequiredERG, or one of the pool's tokens
amountInstringrequiredBase units sold
minOutputstringrequiredLeast of the other side the order accepts, net of the fee when that is ERG
executorFeestringnanoERG the filler keeps. Omitted, from lithosdex.orders.
maxMinerFeestringMost of the executor fee a broadcast fill may pay as a network fee. Below executorFee.
acknowledgeUnverifiedbooleanMust be true to trade with a pool the verified list does not name
Responses
200The placementLDPoolOrderPlaced▶
outcomestringrequiredone ofacceptedrejecteduncertaintxIdstringrequiredpoolNFTstringrequiredkindstringrequiredone ofSWAPDEPOSITREDEEMorderBoxIdstringrequiredclaimedXstringA redeem placement: what it claimed from the vault
claimedYstringprovisionBoxIdstringA redeem placement that claimed: the provision's successor
400The request is malformed, names a token the pool does not hold, or trades with an unverified pool without acknowledgeUnverified.ApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description
403Missing or wrong api_keyApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description
404No LithosDex pool with that NFT, or no live provision with that id.ApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description
409A box the placement spends moved, or another LithosDex mutation is running. Re-quote and resend.LDStateChangedResponse▶
errorintegerrequiredreasonstringrequireddetailstringrequiredWhat moved, and what it moved to
poolBoxIdstringCurrent pool box id
vaultBoxIdstringCurrent vault box id
provisionBoxIdstringCurrent provision box id
422The pool can be drained, the pool cannot fill this, or the wallet cannot cover it.ApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description
503The pool index is still building, the pool's genesis could not be read, or the node or wallet did not answer. 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