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 onwss://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 withTextDecoder. schema_versionnames the message format, for exampledex-trades.json.v2.sequence_numberis the position of the message in the chain’s stream. It is a JSON string, so it stays exact in JavaScript.block_timestampandblock_notification_timeare RFC 3339 timestamps in UTC.block_notification_timeis 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 lastsequence_numberyou 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_aftervalue outside the retained range is rejected with HTTP400. An unsupported chain is rejected with HTTP404. - Close code
1001means the server is shutting down. Close code1008means your client fell behind the live buffer. In both cases, reconnect withresume_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.opisINSERTfor the first message of a block andUPDATEfor a correction. The Spot Liquidity feed writes these values in lowercase.incarnation_versionstarts at0and increases with each correction. Keep the message with the highestincarnation_versionfor each(chain, block_number).- Every message is the complete content of its block. An
UPDATEreplaces all that you hold for that block. A trade or event that is missing from theUPDATEis cancelled. There is no separate cancel message. - An
UPDATEcan 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 itsblock_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.