When Qoq fails a call, the engine’s error contains [slimedragon.near/amp] Dex panicked: followed by the message, and nothing in the call changes. Some messages come after a line like panicked at dexes/amp/src/lib.rs:63:13:, so match the message itself rather than Dex panicked: <message>. A swap after an oracle request fails in its own receipt, once the oracle responds: see If the operations don’t run. See the engine’s errors for everything around it, like balances, registrations, oracle requests and fee discounts.
| Message |
Cause |
This method can only be called directly, not in a transfer call |
The call doesn’t come directly from the caller: a DexCall in the operations of a deposit |
Invalid args, or Failed to deserialize input from Borsh for a dex_view |
args isn’t the Borsh of the method’s arguments. See Types |
Pool not found, Pool <id> not found |
No pool with this ID |
No assets should be attached, No assets other than NEAR should be attached, No assets other than the two pool assets should be attached |
attached_assets has assets the method doesn’t take |
Not enough near attached for storage. Required: <cost>, attached: <amount> |
Attach more NEAR. What’s left is sent back |
| Message |
Cause |
Invalid message |
message isn’t a list of routes, or has more after the routes than an old fee discount |
No routes, Route has no pools |
An empty list of routes or pools |
Route fractions must add up to 100% |
The fractions of the routes don’t add up to 1000000 |
Pool <id> doesn't have <asset> |
A pool of the route doesn’t have the asset that comes into it |
Route doesn't end in asset out |
The last pool of a route doesn’t output asset_out |
Pool is empty |
One of the pool’s balances is 0 |
Amount must be greater than 0 |
A swap of 0, or a split so small that a route got 0 |
Amount must be less than out balance |
An exact output that would take all of the pool’s balance |
Swaps on these pools must start with an oracle request of the prices of <assets> from <oracle key> |
A swap through a pool that an oracle prices, without an oracle request for these assets from this oracle first, or a simulation without them in oracle_response |
Pools of a swap must ask the same oracle |
The message goes through pools of different oracles. Swap through them in separate swaps, after separate requests |
The oracle responded, but Qoq can’t use its prices, so the swap fails. These mean a problem with the oracle, or with the oracle_response of a simulation.
| Message |
Cause |
Invalid oracle response |
The response isn’t the Borsh of a PricesResponse |
Oracle has prices of <count> exchanges, but at least 3 are needed |
Fewer than 3 exchanges |
Oracle has more than one price of <exchange> |
Two exchanges with the same name |
Oracle has <count> prices of <exchange>, but <requested> assets were requested |
An exchange without one price for each requested asset |
Oracle has a zero price of <exchange> |
A price of 0, or one so low that the price between the pool’s assets rounds to 0 |
Prices of exchanges are more than 0.5% apart: from <lowest> to <highest> |
The highest price of the pool’s assets is more than 0.5% above the lowest |
| Message |
Cause |
User has not registered using register_liquidity |
Register for the pool first |
Asset 1 not found, Asset 2 not found |
add_liquidity without both of the pool’s assets attached |
Amounts must be greater than 0 |
An attached amount of 0 |
Can't mint zero shares |
The attached amounts are too small for one share |
Slippage error |
The addition would mint fewer shares than min_shares_received |
Min shares received must not be specified for empty pools |
min_shares_received for a pool with no liquidity |
Can't remove zero shares |
shares_to_remove is Some(0) |
User has no shares |
Removing from a pool you have no shares of |
Not enough shares to remove |
shares_to_remove is more than your shares |
Liquidity fees are already taken this way |
set_liquidity_fee_payout with the payout you already have |
remove_liquidity with min_assets_received that it can’t meet fails with Slippage error too.
| Message |
Cause |
Only the owner of the dex can create pools, Only the owner of the dex can set the amplification, Only the owner of the dex can set the fee, Only the owner of the dex can set the oracle key, Only the owner of the dex can migrate |
The call isn’t from slimedragon.near |
Assets must be different |
Both assets of create_pool are the same |
Only NEAR, NEP-141, and NEP-245 assets are supported |
An NFT in create_pool |
Assets can have at most 38 decimals |
decimals above 38 |
Amplification must be from 1 to 1000000 |
amplification out of range |
The fixed price must be greater than 0 |
A Fixed price of 0 |
The fee must be less than 100% |
fee of 1000000 or more |
Initial liquidity amounts must be greater than 0 |
initial_liquidity with a 0 |
Near should be attached for storage, Not enough NEAR attached for initial liquidity and storage |
create_pool without enough NEAR |
Attached <asset> must be equal to its initial liquidity |
The attached amount of an asset isn’t its initial_liquidity |
No assets other than NEAR and initial liquidity should be attached |
Other assets attached to create_pool |
The pool has a fixed price, not an oracle |
set_oracle_key on a pool with a fixed price |
Migrate takes no args |
migrate with arguments |