Errors
When Plach fails a call, the engine’s error contains [slimedragon.near/xyk] Dex panicked: <message>, and nothing in the call changes. See the engine’s errors for everything around it, like balances and registrations.
Any call
Section titled “Any call”| Message | Cause |
|---|---|
Requires attached deposit of exactly 1 yoctoNEAR |
The call isn’t authorized: a DexCall in the operations of a deposit |
Invalid args |
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 route |
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 |
The pool has no liquidity |
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 |
NEAR liquidity can't go lower than the initial phantom liquidity, Quote asset liquidity can't go lower than the initial phantom liquidity |
A sale in a launch pool for more of the quote asset than buyers put in |
Fee discount expired |
The fee discount is past its block height. Get a new quote |
Fee discount is for another route, Fee discount is for other assets, Fee discount is for another amount, Fee discount is for another trader |
The swap isn’t the one the discount was signed for |
Fee discount signature verification failed |
The signature isn’t by the fee discount signer |
Fee discounts are disabled on this dex |
There’s no fee discount signer |
Liquidity
Section titled “Liquidity”| Message | Cause |
|---|---|
User has not registered using register_liquidity |
Register for the pool’s shares first |
Liquidity registration is only needed for public pools |
register_liquidity on a private or launch pool |
Asset 1 not found, Asset 2 not found |
add_liquidity without one of the pool’s assets attached |
Amounts must be greater than 0, Can't mint zero shares |
Too little attached for any shares |
Slippage error |
Fewer shares than min_shares_received, or less of an asset than min_assets_received |
User has no shares, Not enough shares to remove |
Removing more shares than you have |
Only pool owner can add liquidity, Only pool owner can remove liquidity |
The pool is private and you’re not its owner |
Min shares received must not be specified for private pools |
Private pools have no shares |
Pool is locked and liquidity cannot be removed |
The private pool is locked |
Launch pools don't support adding liquidity after creation, Launch pools don't support removing liquidity after creation |
Launch pools only have the liquidity they were created with |
| Message | Cause |
|---|---|
Assets must be different |
Both assets of create_pool are the same |
Only NEAR, NEP-141, and NEP-245 assets are supported |
An NFT as a pool asset |
Near should be attached for storage |
create_pool without NEAR attached |
Public pools must be created with initial liquidity |
initial_liquidity is None for a public pool |
Attached <asset> must be equal to its initial liquidity |
Attach exactly the initial liquidity of each asset |
Not enough NEAR attached for initial liquidity and storage |
The attached NEAR doesn’t cover both |
Launch pools take the launched asset from attached assets, not initial liquidity |
initial_liquidity for a launch pool. Attach the token instead |
Launched asset not found, Launched asset amount must be greater than 0 |
A launch pool without the launched token attached |
Phantom liquidity must be greater than 0 |
A launch pool needs phantom liquidity |
Only pool owner can edit fees, Only pool owner can lock the pool |
You’re not the pool’s owner |
Fees cannot be edited for public pools, Fees cannot be edited for launch pools |
Only private pools’ fees can change |
Pool is locked |
A locked pool’s fees can’t change |
Public pools cannot be locked, Launch pools are locked by default, Old private pool cannot be locked |
Only V2 private pools can be locked. Upgrade a V1 pool first |
This pool is of the latest version |
upgrade_pool on a V2 pool |
This private pool is too old and doesn't support advanced fee configuration |
A V2 fee configuration for a V1 private pool. Upgrade it first |
| Message | Cause |
|---|---|
Too many fee receivers |
More than 20 |
Fee must be less than 1000000, Fee must be less than 1000000 per receiver |
A fee of 100% or more |
Fees must add up to at most 900000 |
The fees add up to more than 90% |
Protocol fee receiver can't be set by users, Protocol fee receiver can't be changed |
plach.intear.near as a receiver |
Community fee receiver is only supported in Launch pools, Community fee receiver is only supported in Launch pools quoted in NEAR |
A Community receiver elsewhere |
Scheduled fee start time must be before end time, Start fee fraction must be greater than end fee |
A scheduled fee must go down over time |
Dynamic fee configuration is not implemented yet |
Dynamic fees aren’t supported |
At most 5 referrers are allowed, Each referrer can only be listed once, Referral fees must add up to at most 50000 |
Invalid referral fees in a swap’s message |
Asset <asset> already registered |
register_fee_assets with an asset you registered before |
Account does not have a registered community fee |
withdraw_community_fee for an account that isn’t a community receiver |