Market data & charting

Digital Asset Market Data API for CEX, DEX and Charting

Normalize prices, trades, order books, candles, and venue metadata without hiding the source, timing, liquidity, or quality of the data.

Separate the market data products

A price endpoint, order-book stream, historical candle service, index, and account valuation feed solve different problems. Define whether the product needs last trade, best bid and ask, midpoint, mark price, index price, or a calculated composite. Use different fields and labels instead of a single ambiguous price value.

CEX data reflects a venue order book and executed trades. DEX data reflects pools, routes, onchain transactions, block timing, and finality. A broker or aggregator can add another layer of symbol and entitlement rules. Preserve source type and methodology so downstream charting, tax, and AI systems can choose data suitable for their use.

Define canonical markets and symbols

A market identity should include venue, instrument type, base asset, quote or settlement asset, contract size where relevant, and venue product ID. Display symbols such as BTC-USD are not globally unique. For pools, add network, pool address, token contracts, and fee tier.

Version tick size, quantity step, minimum size, status, and session rules. A client cannot validate an order or render a chart correctly when metadata silently changes. Keep a canonical asset service that resolves token contracts, exchange symbols, and display labels.

Combine REST snapshots with WebSocket streams

Use REST or another request-response interface for reference data, historical ranges, and recovery snapshots. Use streams for continuous trades, quotes, books, and account events. A stream consumer must buffer updates, apply them after the snapshot sequence, detect gaps, deduplicate, and rebuild when continuity cannot be proved.

Centralize upstream subscriptions. One market stream can serve many authorized clients through an internal event bus. This reduces rate pressure and keeps venue credentials out of browsers and mobile apps. Add backpressure rules that preserve irreplaceable trades and state transitions before replaceable interim quotes.

Construct candles and composites deterministically

Document interval boundaries, timezone, source events, late-arrival policy, and whether empty periods are emitted. Mark the current candle provisional and closed candles final under your methodology. If history is corrected, publish a version or correction event rather than silently rewriting evidence.

For a multi-venue composite, define stale-data exclusion, liquidity filters, outlier rules, currency conversion, fee treatment, and weights. Store the contributing venues and inputs. A composite can be useful for valuation or alerting, but it is not automatically executable at the displayed price.

Serve TradingView-style charts, mobile apps, and AI safely

A chart adapter can expose symbol search, resolution metadata, historical OHLCV bars, and real-time subscriptions over the canonical market service. It should translate time units and symbology without giving the browser direct access to venue credentials. Mobile gateways should paginate history, compress payloads, and resume from snapshots or cursors after backgrounding.

AI features can summarize a market move or explain a data-quality warning when they receive structured facts with source and observation times. They should not invent a missing price or infer liquidity from one trade. Keep deterministic valuation and risk calculations outside the model.

Monitor data quality as a first-class product

Track age, sequence continuity, crossed-book frequency, duplicate rate, invalid values, deviation from peer venues, candle completeness, and historical backfill gaps. Return a quality state to consumers. During an outage, show stale or unavailable status instead of drawing a flat chart from the last price.

The CEX, DEX and charting field note provides an order-book recovery sequence and testing checklist. The trading guide adds orders, positions, margin, funding, and perps.

Scope note: Venue names are included as ecosystem examples, not as endorsements or claims of partnership. Access, terms, instruments, and regional availability should be verified in official provider documentation.
Next step

Build the feed around continuity, not screenshots.

A production chart starts with ordered events, snapshots, gap recovery, identity mapping, and a declared price methodology.