Create a LithosDex pool
/dex/pools/createapi_keySends four transactions in turn: the pool NFT mint, the vault NFT mint, the mint of the NFT that owns the provision, and the genesis, which creates the pool, its vault and this wallet's provision. Every box one transaction passes to the next is held at the wallet before the first send, so nothing else spends it. The chain stops at the first transaction the node does not accept, and reports those after it as unsent. Besides the locked share, a token/token pool's boxes hold 6.3 ERG and 2.3 ERG for storage rent and its vault one unit of each token, and an ERG/token vault holds 0.1 ERG, none of it recoverable. Needs acknowledgeLocked. The pool is listed once its genesis is in a block.
Request body
LDPoolCreateExecuteRequest · application/jsontokenXstringrequiredERG for an ERG/token pool, or a token/token pool's first token id
tokenYstringrequiredThe pool's other token id
amountXstringrequiredThe pool's reserve of X at genesis; nanoERG for ERG, at least 0.01 ERG
amountYstringrequired▶
feeParamsLDFeeParamsFee numerators over
feeDenom.dexFeeNumstays in the pool;ergFeeNum/tokenFeeNumare set aside for liquidity providers.dexFeeNuminteger · int64requiredergFeeNuminteger · int64requiredtokenFeeNuminteger · int64requiredfeeDenominteger · int64requiredDenominator of every numerator above
acknowledgeLockedbooleanrequiredMust be true: the pool's own boxes and its locked share can never be taken back
Responses
200The four sends, as far as they wentLDPoolCreated▶
outcomestringrequiredaccepted when all four were, else the first step's that was not
one ofacceptedrejecteduncertainunsentkindstringrequiredone ofn2tt2tpoolNFTstringrequiredvaultNFTstringrequiredprovTokenstringrequiredownerNFTstringrequiredThe NFT in this wallet that owns the creator's provision
provisionBoxIdstringrequiredThe creator's provision, which genesis creates
▶
stepsLDPoolCreateStep[]requiredstepstringrequiredone ofPOOL_NFTVAULT_NFTOWNER_NFTGENESIStxIdstringrequiredoutcomestringrequiredunsent: an earlier transaction was not accepted
one ofacceptedrejecteduncertainunsentreasonstringThe node's refusal, or why the transaction was not sent
400The request is malformed, names ERG as tokenY or one token twice, offers an ERG reserve under 0.01 ERG, gives fees out of bounds, or lacks acknowledgeLocked.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
409The wallet's boxes moved while the chain was built. Resend.LDStateChangedResponse▶
errorintegerrequiredreasonstringrequireddetailstringrequiredWhat moved, and what it moved to
poolBoxIdstringCurrent pool box id
vaultBoxIdstringCurrent vault box id
provisionBoxIdstringCurrent provision box id
422The wallet cannot cover the reserves, boxes and fees.ApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description
503The node or wallet did not answer. Nothing was sent. 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