AMM Transaction Result Codes

XLS-30d adds new result codes for transactions. (AMM-related transactions also reuse some existing result codes where appropriate.)

ter Codes

CodeExplanation
terNO_AMMThe AMM-related transaction specifies an asset pair that does not currently have an AMM instance.

tec Codes

CodeValueExplanation
tecAMM_ACCOUNT168The transaction failed because the operation is not allowed on Automated Market Maker (AMM) accounts.
tecAMM_UNFUNDED162The AMMCreate transaction failed because the sender does not have enough of the specified assets to fund it.
tecAMM_BALANCE163The AMMDeposit or AMMWithdraw failed because either the AMM or the user does not hold enough of one of the specified assets. (For example, you tried to withdraw more than the AMM holds.)
tecAMM_EMPTY166The AMM-related transaction failed because the AMM has no assets in its pool. In this state, you can only delete the AMM or fund it with a new deposit.
tecAMM_FAILED164The AMM-related transaction failed. For an AMMDeposit or AMMWithdraw this could be because the sender does not have enough of the specified assets, or the transaction requested an effective price that isn't possible with the available amounts. For AMMBid this could be because the account does not have enough to win the bid or needs more than their specified maximum bid. For AMMVote, this could be because there are already too many votes from other accounts that hold more of this AMM's LP Tokens.
tecAMM_INVALID_TOKENS165The AMM-related transaction failed due to insufficient LP Tokens or problems with rounding; for example, depositing a very small amount of assets could fail if the amount of LP Tokens to be returned rounds down to zero.
tecAMM_NOT_EMPTY167The transaction was meant to operate on an AMM with empty asset pools, but the specified AMM currently holds assets.

tem Codes

CodeExplanation
temBAD_AMM_TOKENSThe transaction incorrectly specified one or more assets. For example, the asset's issuer does not match the corresponding asset in the AMM's pool, or the transaction specified the same asset twice.