Trade history for spot and perpetuals is in two Dune tables,
spot.trades and perpetuals.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.
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
Market Data Feeds are an Enterprise feature. Access to the live feeds and to the history tables is enabled per Dune team. To request access or a trial, contact Dune Enterprise or 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.