Skip to main content
Dune Market Data Feeds are real-time streams of onchain market data. There are three feeds: Trade history for spot and perpetuals is in two Dune tables, historical_spot_trades and historical_perp_trades. See History. To see the instruments the feeds carry, open the instrument explorer.

Chains

The Spot Trades and Spot Liquidity feeds cover the same 13 chains. chain.id is scoped by chain.type. Ethereum is {"id": 1, "type": "evm"} and Solana is {"id": 1, "type": "svm"}. Always key on both fields.

Connect

All live feeds are WebSocket endpoints on wss://api.dune.com. Authenticate with your Dune API key in the X-Dune-Api-Key header. The key must be enabled for feed access. See Get access.

Messages

  • One WebSocket message holds one block. Messages arrive in order.
  • Each message is a binary frame of UTF-8 JSON. In a browser, set binaryType = "arraybuffer" and decode with TextDecoder.
  • schema_version names the message format, for example dex-trades.json.v2.
  • sequence_number is the position of the message in the chain’s stream. It is a JSON string, so it stays exact in JavaScript.
  • block_timestamp and block_notification_time are RFC 3339 timestamps in UTC. block_notification_time is when Dune first observed the block.

Resume after a disconnect

  • Without a query parameter, a connection starts at the live tip.
  • To resume, reconnect with ?resume_after={sequence_number}, using the last sequence_number you processed. The stream continues from the next message, then stays live.
  • Do not use a block number as a cursor. A correction of an old block arrives at a later sequence number.
  • A resume_after value outside the retained range is rejected with HTTP 400. An unsupported chain is rejected with HTTP 404.
  • Close code 1001 means the server is shutting down. Close code 1008 means your client fell behind the live buffer. In both cases, reconnect with resume_after.

Corrections and provisional blocks

The feeds publish a block when it is first observed, before the chain finalizes it. If the block changes later, for example after a reorg, Dune sends it again.
  • op is INSERT for the first message of a block and UPDATE for a correction. The Spot Liquidity feed writes these values in lowercase.
  • incarnation_version starts at 0 and increases with each correction. Keep the message with the highest incarnation_version for each (chain, block_number).
  • Every message is the complete content of its block. An UPDATE replaces all that you hold for that block. A trade or event that is missing from the UPDATE is cancelled. There is no separate cancel message.
  • An UPDATE can be empty. This tells you to delete everything you hold for that block.
  • Trade and event identifiers (trade_id, event_id) are stable. The same trade seen again carries the same identifier.
  • On Solana, trades are published at the confirmed commitment level and each slot is checked again at finality.

Latency

Dune measured the public endpoints from outside Dune’s network on 10 November 2026. Each connection ran for 180 seconds. Latency is the time the message was received minus its block_timestamp, so it includes block propagation, Dune processing, WebSocket delivery and internet transit. Percentiles are per message, not per trade. These are short samples, not a service level agreement. The Spot Liquidity feed showed similar numbers on each chain, for example p95 of 1.315 s on Arbitrum, 1.506 s on Base and 1.880 s on Solana. Notes on the sample:
  • Ethereum produces a block every 12 seconds, so its 180-second sample has few messages and its p95 is not a stable estimate.
  • Polygon is not in the table. Its block timestamps are later than the receive times, so they cannot give a valid latency.
  • Lighter: a 60-second sample gave p50 1.504 s and p95 2.268 s. An earlier 180-second sample on the same day had a p95 of 121 s. The cause of that delay was not found.

History

Dune rebuilds trade history from raw chain data with the same decoders and pricing as the live feeds. One row is one trade.
  • A new day is written each night, after the day is complete on the chain.
  • On 19 November 2026, both tables had a partition for every calendar day from each chain’s first day to 2026-11-18. A present day does not prove that every trade of that day is present.
  • History is available through DuneSQL, through Datashare to your own warehouse, and as monthly CSV files during a trial. Access is granted per customer.
DuneSQL

Get access

Feed access is enabled per Dune team. To request access or a trial, use Request a demo on the Market Data Feeds page. A trial includes the live WebSocket feeds and monthly history files.

What the feeds do not include

  • Centralized exchange trades.
  • A consolidated or aggregated price. Each trade and each pool book is published on its own.
  • Constant-product pools in the Spot Liquidity feed. See Spot Liquidity.