Swap
swap_simple swaps between two assets on one DEX, with a minimum output or a maximum input.
Intear DEX is a NEAR smart contract, the engine, that runs many DEXs inside one contract. It’s deployed at:
dex.intear.nearEach DEX is a small WebAssembly program stored in the engine. The engine runs it when you swap or call it, holds the tokens of every user and DEX, and moves them between balances once the DEX has done its math. Swaps don’t need cross-contract calls, so a swap through several DEXs happens in one receipt, and a failed swap leaves no tokens in flight.
Plach, the AMM, is one of the DEXs that run on the engine, and has docs of its own. This section covers the engine itself.
near, nep141:<contract>, nep171:<contract>:<token id> and nep245:<contract>:<token id>. See Types.<deployer account>/<name>, for example slimedragon.near/xyk for Plach. See DEXs on the engine.Swap
swap_simple swaps between two assets on one DEX, with a minimum output or a maximum input.
Chain swaps
execute_operations runs several swaps and withdrawals in one call, each step using the output of the last one.
Swap on deposit
Put operations in the msg of ft_transfer_call: deposit, swap and withdraw in one transaction.
Call a DEX
dex_call and dex_view reach any other method of a DEX, such as adding liquidity or reading pools.