Perpetuals and DEX market data
What is perpetuals and DEX market data?
Perpetuals and DEX market data is the record of trades, prices, funding rates and candles from onchain perpetual futures exchanges and decentralized exchanges (DEXs), taken from the contracts where the trades settle.
Data vendors, index providers and prime brokers use it to give trading and research teams prices and volumes they can check against the chain.
Goldsky decodes each trade and funding event and publishes it to a queue you run as it settles; turning trades into candles and totals, and serving them to clients, stays with your team.
Who uses perpetuals and DEX market data?
Crypto market data vendors, index and benchmark providers, and prime brokers that give clients onchain prices next to exchange data.
How perpetuals and DEX market data gets from the chain to clients
The diagram follows one trade from the moment it settles onchain to the moment a client’s trading or research system queries it from your API. Your setup may differ.
Settle the trade onchain
On onchain exchanges, every trade and every funding payment is recorded by the exchange’s contracts.
A swap on a decentralized exchange (DEX) or a fill on a perpetual futures exchange emits an event with the market, price, size and side. Perpetuals also settle funding, the regular payment between long and short traders that keeps the contract price near the spot price.
Decode trades and funding events
Handled by Goldsky TurboRaw events are encoded, so they have to be turned into prices, sizes and sides before anyone can use them.
Each exchange’s events are decoded with its interface (ABI) into one consistent row, and every exchange you cover has to map to the same columns. An event left undecoded is a trade missing from your volume, and exchanges that differ by version need separate decoding.
With Goldsky, a Turbo Pipelines SQL transform decodes raw logs with
Stream DEX trades (opens in a new tab)_gs_log_decodeand the exchange’s ABI, so one pipeline can pick outSwapevents from every pool on a chain.Publish each trade to your queue
Handled by Goldsky TurboA queue lets several systems read the same trades as they settle, each at its own pace.
Each trade is published once to a topic, keyed so that trades for one market arrive in order. Delivery is at least once, so consumers drop repeats by the trade’s ID.
The Kafka sink publishes rows in Avro or JSON, uses your
Publish to Kafka (opens in a new tab)primary_keyas the message key and keeps per-key order. Each message’sdbz.opheader says whether the row is an insert, update or delete.Build candles and totals
Most clients want trades rolled into candles (open, high, low and close per interval), volumes and funding history.
Your consumers group trades by market and interval and keep running totals. When the chain replaces recent blocks in a reorg, delete records arrive on the topic and the consumers have to take those trades back out of the candles they’ve already built.
Serve the data to clients
Trading and research systems read the data through an API or a file they can query.
Your API serves candles, trades and funding from your own store, with each figure traceable to the transactions behind it. Mark recent intervals as provisional until their blocks are final, so clients know they can still change.
What you control
- Your team
- Build candles and totals
- Serve the data to clients
Security and deployment
- SOC 2 Type IIIndependently audited security controls.
- Dedicated infrastructureSingle-tenant options for production workloads.
- Data residencyCloud, on-premises or co-located.
More use cases that distribute market data
- Prediction market dataPackage onchain trades, prices and flows into data products for exchanges, vendors and funds.
- Prediction market dataPackage prediction-market trades and positions into datasets for exchanges and funds.
- 24/7 tokenized stock prices and flowsStream round-the-clock prices, transfers and flows for tokenized stocks.
- Trading rewards and builder fee attributionCredit fills, fees and incentive rewards to the app, builder or trader that drove them.
Use cases built the same way
- Stablecoin mint and redemption monitoringRecord every mint and redemption of a stablecoin as it happens, on every chain.
- Supply data for stablecoin issuance platformsGive an issuance platform one view of supply across every coin and chain it runs.
- DeFi data for apps and dashboards: positions, TVL and yieldsShow users their positions, the protocol’s TVL and yields, pool and market data and activity history in a DeFi app’s front end and dashboards.
- Track stablecoin issuers and competitors onchainFollow competitors’ and issuers’ supply, mints, burns and holders.
Build a perpetuals and DEX market data feed with Goldsky
We’ll map it to your systems and show you what Goldsky runs, so your team builds the product, not the pipelines underneath it.