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

List a token's concentrated-liquidity pools on Meteora DLMM, Raydium CLMM and Orca Whirlpools, largest USD TVL first.

exchange.IO(k, token)
exchange.IO(k, token, quote)

Examples

  • List the 5 SOL/USDC pools with the largest USD TVL.

    javascript
    function main() { var pools = exchange.IO("lp.pools", "SOL", "USDC") if (!pools) { Log("Query failed:", GetLastError()) return } Log(pools.length, "pools") for (var i = 0; i < pools.length && i < 5; i++) { var p = pools[i] var grid = p.protocol == "meteora" ? "binStep " + p.binStep : "tickSpacing " + p.tickSpacing Log(p.dex, p.id, "fee", p.fee / 1e4 + "%", grid, "price", p.price, "TVL", Math.round(p.tvlUsd), "24h volume", Math.round(p.volume24hUsd)) } }
  • List the farm rewards of the 10 SOL pools with the largest TVL and whether they are being emitted (Meteora rows have no active).

    javascript
    function main() { var pools = exchange.IO("lp.pools", "SOL") if (!pools) { Log("Query failed:", GetLastError()) return } pools.slice(0, 10).forEach(function(p) { var names = (p.rewards || []).map(function(r) { var state = r.active === undefined ? "" : (r.active ? " (emitting)" : " (ended)") return r.symbol + state }) Log(p.dex, p.symbol, p.id, "rewards:", names.length ? names.join(", ") : "none") }) }

Returns

TypeDescription

array / null value

An array of pools sorted by tvlUsd, largest first (rows without TVL data come last). Every row has the common fields {id, protocol, dex, symbol, base, quote, fee, feeRate, price, reserveBase, reserveQuote, tvlQuote, tvlUsd, volume24hUsd, fees24hUsd, rewards, empty} plus fields of its protocol, see the remarks. A null value is returned when the token cannot be recognized or a request fails, with the reason in GetLastError().

Arguments

NameTypeRequiredDescription

k

string

Yes

Set to lp.pools to list pools.

token

string

Yes

The token to look up: a name in the token table, a verified Jupiter token name or a mint address, for example SOL or JUP. Every row uses it as the base token.

quote

string

No

List only pools against this quote token. Without it, pools against SOL, USDC and USDT are listed (excluding the token itself).

See Also

Remarks

Common fields
  • id is the pool address, which can be passed to lp.pool, lp.ticks and the pool parameter of lp.plan; protocol is meteora, raydium or orca, and dex the display name (Meteora DLMM, Raydium CLMM, Orca Whirlpools).
  • symbol is written token_quote; base and quote are the mint addresses of the two tokens; price is the quote value of one token; reserveBase and reserveQuote are the pool's balances of the two tokens, and tvlQuote is their total value in the quote token at the current price.
  • fee is the base fee in millionths (400 is 0.04%, the unit of the Uniswap exchange object's fee), and feeRate is the same fee as a ratio (0.0004).
  • tvlUsd, volume24hUsd and fees24hUsd are the USD TVL, 24h volume and 24h fees from each protocol's data API; when a protocol's API is unavailable its pools are found on chain by mint with the node's getProgramAccounts, and those rows have the three fields null.
  • empty true marks an empty pool (no price yet), whose price and tvlQuote are null; lp.plan cannot add liquidity to an empty pool.

Fields by protocol
protocolPrice gridExtra fieldsEach item of rewards
meteorabins: binStep (basis points) and the active bin activeIdfeeRateNow (current fee including the volatility surcharge), enabled{mint, symbol}
raydiumticks: tickSpacing and the current tickliquidity (liquidity at the price), sqrtPriceX64, enabled{mint, symbol, active, endTime}
orcaticks: tickSpacing and the current tickliquidity, sqrtPriceX64, adaptiveFee, fullRangeOnly{mint, symbol, active}

rewards are the pool's farm reward tokens, active true meaning the reward is being emitted. On Orca, adaptiveFee true means the fee follows volatility (fee is the base fee), and fullRangeOnly true marks a Splash pool, which takes full-range positions only.

Data sources: prices and balances are read on chain (Raydium's fee from the pool's AmmConfig account); the USD statistics come from Meteora's data API (dlmm.datapi.meteora.ag), the Raydium API v3 (api-v3.raydium.io) and Orca's public API (api.orca.so).

Popular tokens often have over a hundred pools (most with little TVL); to pick one by rule, use exchange.IO("lp.select").