Market data
Discover markets, handle exact prices and quantities, and subscribe to books, trades and candles.
Discover instruments and trading rules
GET /v1/markets returns marketId, underlyingSymbol, marketType, current status, priceScale, quantityScale, price and quantity bounds, initial margin, maintenance-margin tiers, maximum leverage, maker/taker fees and settlementAsset. Use these values for validation and formatting. Do not infer collateral eligibility from a settlementAsset field or assume all markets have the same scale.
Edel Markets perpetuals trade 24/7, subject to market status and venue controls. An underlying stock or other reference asset does not turn the perpetual into spot ownership. Status values include draft, backfilling, open, paused, halted, cancel_only and reduce_only. An advertised symbol alone does not mean risk-increasing orders are currently allowed.
Client market-data flow
Client market-data flow
- Step
- Alternate path
6 parts and 6 connections.
Read as text
- Market WebSocket → Bounded processing queue
- Bounded processing queue → Validate
- Validate → Shared market state
- Shared market state → Charts, books and trading decisions
- Bounded processing queue → Stale state (capacity exceeded) [alternate path]
- Validate → Stale state (continuity lost) [alternate path]
A market-data client needs a clear path from incoming frames to the state used for trading decisions. Validate message shape, market identity and sequence before applying an update. Preserve exact amounts throughout processing.
Bound processing work. Use a bounded queue and keep expensive parsing or aggregation away from the rendering path. If the client cannot keep up, mark the affected data stale and recover according to the channel contract.
Publish coherent state. Share validated market state across charts, books and order-entry views. Coalesce visual updates without discarding the events needed to maintain correct state.
Preserve channel boundaries. Candle replay has its own cursor and series. It does not establish an atomic snapshot across prices, the order book and account data.
Read an initial snapshot
Use snapshots when connecting, opening a historical view or performing documented recovery. WebSockets supply subsequent live updates. This Node.js example selects an open market from the catalogue and reads its book without credentials or order submission. Set EDEL_API_URL using Networks.
const api = process.env.EDEL_API_URL;
if (!api) throw new Error('Set EDEL_API_URL to a REST base URL from docs.edel.finance/introduction/networks');
async function read(path) {
const response = await fetch(api + path);
if (!response.ok) throw new Error(`Read failed: ${response.status}`);
return response.json();
}
const catalogue = await read('/v1/markets');
const market = catalogue.markets.find((item) => item.status === 'open');
if (!market) throw new Error('This venue has no open market');
const book = await read(`/v1/markets/${encodeURIComponent(market.marketId)}/book`);
console.log({ marketId: market.marketId, ...book });| REST route | Contents |
|---|---|
| GET /v1/markets/{marketId} | Market snapshot: mark/index, status and funding |
| GET /v1/markets/{marketId}/stats | 24-hour activity, prices, open interest and funding timing |
| GET /v1/markets/{marketId}/book | Aggregated bids/asks with snapshot and resync metadata |
| GET /v1/markets/{marketId}/candles | Historical index or trade candles; trade volume in quote-asset atoms; index volume in provider source units or zero |
| GET /v2/markets/{symbol}/candles | fetchOHLCV candles; volume in base units |
| GET /v2/markets/{symbol}/trades | fetchTrades public trades; page with cursor |
Choose market channels
Market channels are public and market-scoped. The source status identifies how each feed is produced. Check subscription acceptance and source availability in your environment. Trade and price channels have no direct REST snapshot replacement in the channel catalogue; use their supported stream replay behavior for recovery.
| Channel | Purpose | Published source status |
|---|---|---|
| market.book | Complete aggregated book snapshots | projection |
| market.orderbook | Top-50 snapshot then price-level deltas; validate continuity and checksum | derived |
| market.trades | Executed public trades | live |
| market.ticker | Latest trade price and size | derived |
| market.price | Mark/index and price-source observations | live |
| market.funding | Funding rate and timing | live |
| market.status | Current market status | projection |
| market.candles | Candle updates for a required series | live; mark series unavailable |
Preserve exact amounts and snapshot meaning
Atom fields are integer strings. Use BigInt or decimal arithmetic with the market's scale; JavaScript Number can lose precision. Formatted decimal fields are useful for display; use exact arithmetic when calculating balances. Placement price and quantity are decimal strings; order-preview fields use atoms, so do not reuse one body unmodified for the other.
A REST book includes snapshotSequence, readModelDigest, checksum and resync. The market.book realtime payload contains marketId, snapshotSequence, bids and asks; each level carries exact priceAtoms and sizeAtoms plus formatted values. Apply the complete level arrays as a new snapshot. The market.book channel carries complete snapshots. For incremental updates, use market.orderbook: it starts with a top-50 snapshot and then sends changed levels; a zero amount removes a level. It is live on Development for spot and perpetual markets. See maintain an incremental order book for sequence, atom-based CRC32 and fresh-subscription recovery rules.
A projection digest identifies change for that producer. It may not be reproducible from the payload. Use only a verification algorithm documented for that specific field.
Request candles with the correct series and window
v1 REST candles default to series=index and tf=1m. v1 uses tf, from and to. v2 fetchOHLCV uses timeframe and since. Spot v2 candles use the trade series. Perpetual v2 candles default to series=index. Supported declared timeframes are 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 8h, 12h, 1d, 3d, 1w and 1M. v1 from and to use epoch milliseconds and define a half-open [from, to) window; align boundaries to the requested timeframe.
The trade and index series are served. The mark series is declared but returns 400 operation_not_available on REST and is refused on the socket. A candle subscription requires series; it does not accept a tf field in the public subscribe envelope. Read each candle payload's timeframe instead of assuming a REST query parameter is also a socket option.
Candle volume units. One rule applies to spot and perpetual markets:
- v2 REST
fetchOHLCV(GET /v2/markets/{symbol}/candles, and the same route under /v2/spot and /v2/perps): volume is traded base quantity in base units, as a JSON number, for every price series. Index prices carry the traded base volume of the same buckets. A bucket with no trade has volume 0. market.candles, trade series:volumeis base-asset atoms at the market's quantityScale, as an integer string. Divide by 10 raised to quantityScale for base units. With quantityScale 8, "75000000" is 0.75.- v1 REST GET /v1/markets/{marketId}/candles: trade-series volume stays in quote-asset atoms. Historical index candles carry provider reference volume in its source units when available; live index observations carry 0. Do not apply quote decimals to provider source volume. Do not mix v1 and v2 volume in one series.
Choose the price series. For perpetual v2 candles, series=trade selects trade prices. It is not required to obtain traded base volume. Live market.candles index frames carry volume 0; use v2 REST for traded base volume with index prices.
Page public trades with cursor
GET /v2/markets/{symbol}/trades (fetchTrades) returns at most 100 public trades per page; the default is 50.
since is not supported. A request with since answers HTTP 501 operation_not_available (NotSupported). Do not retry it. Page with cursor instead: send the info.cursor of the oldest trade you already read as the cursor query parameter (with the client library, params.cursor). The next page holds only older trades.
Use each instrument’s decimal scales
Read priceScale, quantityScale and settlementAssetDecimals independently. A market symbol’s spelling does not tell you the collateral or its decimal scale. Keep exact wire amounts as strings or exact integers until the appropriate conversion boundary; avoid binary floating-point multiplication when constructing commands.
The v2 surface uses JSON numbers for compatibility and therefore cannot preserve arbitrary exact atom precision. Use v1 atom strings for exact accounting and reconciliation. Last trade, mark, index and candle-series values also have different meanings; do not silently replace one with another.