Type/to search
Built-in Functions
Structures
Built-in Variables and Constants
Conventions
Exchanges
Capability Matrix
Centralized Exchanges
Decentralized Exchanges (DEX)
Prediction Markets
Securities and Futures
On-chain & Custom

The Uniswap / PancakeSwap, Aerodrome / Velodrome, KyberSwap and 1inch exchange objects share one implementation (swaps, concentrated liquidity and bridging on EVM chains); this directory holds the sub-pages of their common exchange.IO() commands. Each exchange page lists all its commands in its IO table and links here, and the differences between the exchanges are in the remarks of each sub-page.

CommandsExchanges
Swap quotes and simulation: route, simulate; token table: tokenAll (on KyberSwap and 1inch the aggregator supplies the route)
Wallet: transfer, receipt, wrap, unwrapAll
Settings: approve, slippage, deadline, cancelWait, gasMultiplierAll
Concentrated liquidity: lp.*Uniswap, PancakeSwap, Aerodrome, Velodrome; gauge staking with lp.stake, lp.unstake and lp.claim on Aerodrome and Velodrome only
Bridge: bridge.*All

The usual LP flow: pick a pool with lp.pools or lp.select → plan with lp.plan → simulate with lp.simulate → add with lp.add → monitor with lp.positions → collect fees with lp.collect, reduce with lp.decrease or withdraw with lp.remove; the lp.add page has a complete strategy example, and DEX Strategy Examples has runnable strategies such as range re-centering, gauge compounding, DEX-CEX arbitrage and dollar-cost averaging.

In this sectionRead the whole section

NameDescription
exchange.IO("route", ...)Requests quotes for a swap: lists the quote on each candidate route and the best route, without placing an order.
exchange.IO("simulate", ...)Builds a swap transaction with the order logic (route selection, quoting, price protection) and only simulates it on chain (eth_call): nothing is signed, broadc…
exchange.IO("token", ...)Registers a token, or lists the token table; a registered token can be used by name in trading pairs.
exchange.IO("transfer", ...)Transfers the chain's native coin (such as ETH or BNB) or an ERC20 token out of the configured wallet.
exchange.IO("receipt", ...)Queries the receipt of any transaction on the exchange object's chain (not only orders and transfers sent by it), optionally waiting for it to be mined.
exchange.IO("wrap", ...)Wraps the native coin (such as ETH or BNB) into its wrapped token (such as WETH or WBNB), 1:1 without slippage, costing only gas.
exchange.IO("unwrap", ...)Unwraps the wrapped token (such as WETH or WBNB) into the native coin (such as ETH or BNB), 1:1 without slippage, costing only gas.
exchange.IO("approve", ...)Sets the token approval mode: approve only what each swap needs, or grant an unlimited allowance.
exchange.IO("slippage", ...)Sets the slippage protection of market orders.
exchange.IO("deadline", ...)Sets the deadline of swap transactions, or queries it.
exchange.IO("cancelWait", ...)Sets how long a cancel waits for its result.
exchange.IO("gasMultiplier", ...)Sets the gas limit multiplier: a transaction's gasLimit is the node's gas estimate times this value.
exchange.IO("lp.pools", ...)Lists all LP pools of a token (V3 and V4/Infinity CL pools for Uniswap and PancakeSwap, Slipstream and basic pools for Aerodrome and Velodrome), including fee r…
exchange.IO("lp.select", ...)Automatically selects an LP pool by rule: chooses the pool with the highest 24h trading volume among pools with sufficient liquidity, or the pool with a specifi…
exchange.IO("lp.pool", ...)Queries the real-time state of a single pool, including its two tokens, fee tier, tick spacing, current tick, price and liquidity.
exchange.IO("lp.ticks", ...)Queries a pool's liquidity distribution over a tick range, giving the liquidity and both token amounts per segment.
exchange.IO("lp.plan", ...)Builds a position plan (read-only, costs nothing): from a budget, a price range and a shape, it computes each position's range, liquidity and token amounts, whe…
exchange.IO("lp.simulate", ...)Runs a plan's add-liquidity transaction with eth_call (nothing is signed, broadcast or paid) to confirm it executes and see the amounts it uses.
exchange.IO("lp.add", ...)Adds liquidity by a plan: swaps first when needed, approves, creates every position of the plan in one transaction and returns the position IDs once it is mined…
exchange.IO("lp.increase", ...)Adds to an existing position: the budget is split into the two tokens by the position's range and the current price, the short token is bought first, and both g…
exchange.IO("lp.decrease", ...)Withdraws a ratio of a position's liquidity and collects all its fees; the position stays (a ratio of 1 empties it without burning the NFT).
exchange.IO("lp.collect", ...)Collects the fees accrued to positions without touching the principal; several positions go into one transaction.
exchange.IO("lp.remove", ...)Withdraws positions' liquidity and collects their fees, burning the position NFT on a full withdrawal; several positions go into one transaction.
exchange.IO("lp.positions", ...)Lists a wallet's LP positions with range, in-range flag, liquidity, current amounts and value, and uncollected fees.
exchange.IO("lp.history", ...)Queries a position's cash flow and PnL: deposited and withdrawn principal and collected fees, valued at the current pool price.
exchange.IO("lp.track", ...)Registers position IDs so that lp.positions finds them even when the node does not serve the full log history (recovering older positions after a restart).
exchange.IO("bridge.*", ...)Cross-chain bridge (Across, Stargate, CCTP and others aggregated by LI.FI): lists the supported chains and tokens, quotes and simulates, moves tokens from this…