sauce pools lists every pool of a token pair at the venues whose swaps stop at a price limit, deepest first, with each pool’s fee, price and depth.
Synopsis
Description
On an EVM chain, the command reads every pool of the pair at the venues the registry records on the chain:- Uniswap V3 and PancakeSwap V3, at each fee tier their factory enables;
- Aerodrome Slipstream, at each tick spacing of each of its CLFactories;
- hookless Uniswap V4 pools at the keys
100:1,500:10,3000:60and10000:200, plus each--v4-key.
sauce globals --tokens), or an address; then its decimals and symbol are read from the token, or given as 0x…:8.
Pools with liquidity at their price come first, deepest first by that liquidity, which is in the same units at every venue for one pair. For each pool the command prints:
- the venue, and the contract a program finds the pool through (
UniswapV3.Factory), the pool’s address, or a V4 pool’s id and key; - its fee, read from the pool; a V4 pool’s LP fee and protocol fee come from StateView;
- tick spacing, liquidity, tick and
sqrtPriceX96; - for each direction: what one token costs in the other before the fee and with it; that price as the distributed swap’s
priceLimit(pay base units per buy base unit, times 1e18); and how much of the paid token, fee included, moves the price 1% against the taker, walked through the pool’s ticks.
eth_call covering every read in it, all at one block. The command names that block: --block, or the latest when it starts. Pass the same block to sauce simulate --block to run a program on the prices the priceLimit was taken from.
On Solana, it finds every pool of the pair, with getProgramAccounts on each venue’s program, at the venues whose swap stops at a price limit: Raydium CLMM, PancakeSwap CLMM, Byreal, Stabble CLMM, Orca Whirlpools, Cropper, DefiTuna, Crema and Phoenix’s markets. For each pool:
- its fee, liquidity and price both ways, with the fee and as a swap’s
priceLimit; - how a program finds it by key, such as
Orca.Whirlpool.pool(USDC, WSOL, 4), where its venue finds pools by key; - its slot for each token paid: the nine accounts a swap at the pool takes (program, pool, config, the two vaults, one more account the swap takes, and three tick arrays), with the System program for each unused one.
SOL for WSOL) or a mint.
--pay <token> chooses the pools a distributed swap paying that token takes: within --price-limit, one per venue with --per-venue, up to --slots of them. It prints them in slot order for main’s --args, with the System program for an empty slot, and their slots as accounts for --accounts.
The command sends nothing, and works on preview chains too.
Options
EVM chains only
Solana only
Output
Text on stdout; the endpoint note and any note about a pool that answered wrongly on stderr. With--json on an EVM chain:
On Solana,
pools carries byKey and slots, skipped the pools passed over, and with --pay, chosen, poolArgs and accounts.
Exit codes: 0 on success; 1 on Solana when a venue could not be read, with the listing partial and a note naming the venue; 2 for a usage error.
Examples
List WETH/USDC pools on Base
priceLimit given. To simulate on these prices, pass the block the first line names to sauce simulate --block.
The same as JSON
List USDC/WSOL pools on Solana
Choose the pools for a distributed swap on Solana
poolArgs goes to the program’s --args, and accounts to --accounts.
Next steps
sauce price: convert a price into the same limits.- Distributed swap and Solana distributed swap: programs that take these pools and limits.
sauce simulate: run a program at the block the pools were read.
