Skip to main content
The Spot Liquidity feed streams pre-trade liquidity for onchain pools. For each block, it sends every liquidity event (add, remove, limit order) and a bounded order book for each pool that the block changed. The feed is real time only. It has no history table. For connection, resume and latency, see the Market Data Feeds overview.

Venues

The feed covers concentrated-liquidity and bin pools. This is the complete list of venue labels: Constant-product pools, such as Uniswap V2, are not in this feed.

How the book is built

An AMM pool has no resting orders, but its liquidity sits at known prices. Dune reads each pool’s state at the end of the block and writes it as a price ladder.
  • Levels are 10 basis points (bps) wide and go out to ±2% of the mid price. There are at most 20 levels on each side, nearest the mid first. Empty levels are not sent.
  • Bucket edges are fixed post-fee prices: level k (1 to 20) has price = mid_price × (1 − 0.001 × k) on the bid side and mid_price × (1 + 0.001 × k) on the ask side.
  • The fee decides which pool liquidity fills each bucket. Selling base into the pool at pool price p fills at p × (1 − fee), and buying base fills at p ÷ (1 − fee). A level’s size_base is the base amount that fills at post-fee prices inside its bucket.
  • best_bid and best_ask are the post-fee price of the first unit on each side, with the size of the first level.
  • Each pool has its own book. Books are not combined across pools or venues. One instrument code can cover several pools (fee tiers); use pool or pool_id to tell them apart.
  • EVM state is read at the block hash. Solana state is read at the slot. A correction rebuilds the same book.
  • A book is sent only when a block changes the pool. No new book does not mean the pool is empty. Keep the last book of each pool.

Message envelope

Optional fields are omitted when absent, never null. Raw token amounts are decimal strings in the token’s smallest unit. Prices, sizes, fees and USD values are JSON numbers. Prices are quote per base, decimal-adjusted.

Liquidity event

Book

fee_approximate marks pools whose fee can change with each swap. The book uses the fee stored at the block. This applies to Uniswap V4 and PancakeSwap Infinity dynamic fees, Algebra adaptive and plugin fees, LFJ Liquidity Book variable fees, Meteora DLMM, and Orca, Raydium and Byreal dynamic-fee pools.

Corrections

  • Events are keyed by event_id. Books are keyed by (pool or pool_id, block_number).
  • Every block sends one message, even when both lists are empty.
  • An update replaces all events and books you hold for that (chain, block_number). Delete the held items that are not in the message.
  • A pool’s current book is the held book with the highest block_number. Keep older books for the reorg window, so that a correction can fall back to an earlier book.
  • Solana retraction: when a slot’s block is gone, the message is an empty update with no block_hash.

Example

EVM, a Uniswap V4 add with the pool’s book:
Hashes and addresses with repeated characters in this example are placeholders.

Limits

  • The book shows depth within ±2% of the mid only. It is not a quote for a larger trade.
  • A book does not include gas, MEV or routing costs.