Market Data API
Order books, trades, klines and 24-hour figures for every Hydranet market, at https://api.hydranet.app. Every endpoint is public and read-only: no key, no account, no cookies, and any origin may call it from a browser. (2026-11-25) A page in the browser can read an answer's Retry-After.
/api/v1 and the WebSocket streams follow Binance's spot market-data API, so a client written for Binance needs only a new base URL and Hydranet's symbols. /coingecko/v1 and /cmc/v1 serve the feeds CoinGecko and CoinMarketCap ask an exchange for. The OpenAPI document is at /openapi.json.
Conventions
| Topic | Rule |
|---|---|
| Symbols | CHAIN.TICKER_CHAIN.TICKER, base first: ARB.HDN_ARB.USDC is HDN on Arbitrum priced in USDC on Arbitrum. Matched without regard to case; stream names use lower case. /api/v1/exchangeInfo lists every market. |
| Numbers | Prices and amounts are decimal strings at the market's precision. Ids, counts and times are integers. |
| Times | In ms, except CoinGecko's trade times, in seconds. A trade's time is when its swap settled and it became public. |
| Trade ids | Unique within a market and growing in the order trades became public, as their times do; not consecutive. Page by id. (2026-11-25) A node's own fills carry the same id, as ClientMarketTrade.trade_id. |
| Late prints | A trade that settled more than one minute after its match counts in volumes and trade counts, and sets no price: no kline open, high, low or close, no last price, no 24-hour price figure and no weighted average, unless the market has no price yet. (2026-11-25) isLate marks one, on /api/v1/trades, /api/v1/historicalTrades and @trade. |
| Book quantities | (2026-11-17) A resting order counts in a level as far as a taker would match it now, its listed_amount; one listed at nothing is left out until it would match. (2026-11-25) The book order by order, level=3 and @level3, shows each order the same way. |
| Errors | {"code": -1121, "msg": "Invalid symbol."}, with Binance's codes, on every path: see Errors. |
| Encoding | JSON in UTF-8, gzip when the request accepts it. GET and HEAD only. |
| Caching | Cache-Control: public, max-age=1 on live data, max-age=60 on market lists, assets and history that can no longer change: a full page of trades, and klines before the last closed one. |
| Unknown parameters | Ignored. A known parameter with a bad value is refused. |
Limits
| Limit | Value | Past it |
|---|---|---|
| REST weight per IP | 600 a minute, as rateLimits in exchangeInfo says; each answer reports the weight used in X-Used-Weight-1M | 429, -1003, with Retry-After. Sending on after a 429 gets 418, a temporary ban. |
| WebSocket connections per IP | 20 open, 60 new in 5 minutes | Refused at the upgrade with 429 |
| Messages into a connection | 5 a second | The connection is closed |
| Streams per connection | 200 | The subscribe is refused |
| A slow reader | Too much waiting to be sent | The connection is closed |
| The whole service | Busy | 503, -1008, with Retry-After; on WebSocket, the upgrade or the subscribe is refused |
The server pings every 20 seconds and closes a connection that does not answer within 60. A connection lives at most 24 hours. Before a restart, every connection gets {"e":"serverShutdown","E":<ms>}: reconnect, and resynchronise any order book.
REST, /api/v1
| Path | Parameters | Answer | Weight |
|---|---|---|---|
/ping | {} | 1 | |
/time | {"serverTime": ms} | 1 | |
/system/status | {"status": 0, "msg": "normal"}; 1 and "system maintenance" while the venue is in maintenance | 1 | |
/exchangeInfo | symbol or symbols (a JSON array) | timezone, serverTime, rateLimits, exchangeFilters, symbols: see below | 10 |
/assets | [{"asset", "chain", "network", "assetId", "contractAddress", "ticker", "name", "decimals", "class", "state", "explorerUrl"}]; contractAddress only for tokens | 1 | |
/depth | symbol, limit 100 (1–5000), (2026-11-25) level 2 (default) or 3 | {"lastUpdateId", "E", "bids": [[price, qty]], "asks": [[price, qty]]}: bids high to low, asks low to high. (2026-11-25) With level=3, one entry per resting order, [price, qty, orderId], orders at one price in no particular order, and limit counts orders a side: see The book order by order | 1 up to 100 levels or orders a side, 5 up to 500, 10 above |
/trades | symbol, limit 500 (1–1000) | The latest trades, oldest first: [{"id", "price", "qty", "quoteQty", "time", "isBuyerMaker", "isBestMatch", "isLate"}]; (2026-11-25) isLate is true on a late print | 2 |
/historicalTrades | symbol, fromId, limit 500 (1–1000) | Trades from fromId on, in id order; without fromId, the latest | 5 |
/klines | symbol, interval, startTime, endTime, limit 500 (1–1000) | Binance's 12-field arrays, oldest first, the open kline last | 2 |
/ticker/24hr | symbol, symbols, or neither for every market | Rolling 24-hour figures: one object for symbol, an array otherwise | 1 for one market, 2 for more |
/ticker/price | as /ticker/24hr | {"symbol", "price"} | 1 |
/ticker/bookTicker | as /ticker/24hr | {"symbol", "bidPrice", "bidQty", "askPrice", "askQty"}; an empty side reads "0" | 1 |
/quote | from, to, amount, amountSide, walletSetup; with walletSetup=NEW also priceChangeTolerance, feePriority, withdrawReceivingFunds, walletNativeAsset | (2026-11-25) What a swap of amount gets now over its best route, every fee counted, and with walletSetup=NEW what a new wallet pays to make it: see Swap quote | 5 |
Klines take the intervals 1m 3m 5m 15m 30m 1h 2h 4h 6h 8h 12h 1d 3d 1w 1M, in UTC: weeks start on Monday, months on the 1st. They are continuous: an interval with no trade repeats the previous close with zero volume, and one holding only late prints repeats it with their volume. A trade counts in the kline of the time it settled, so a kline that closed does not change.
A /ticker/24hr entry carries priceChange, priceChangePercent (3 places), weightedAvgPrice (over the window's trades that set prices), prevClosePrice, lastPrice, lastQty, bidPrice, bidQty, askPrice, askQty, openPrice, highPrice, lowPrice, volume, quoteVolume, openTime, closeTime, firstId, lastId and count. A market without a trade in the window reads zeros, with firstId and lastId at -1.
Exchange info
One entry of symbols:
{
"symbol": "ARB.HDN_ARB.USDC", "status": "TRADING",
"baseAsset": "ARB.HDN", "quoteAsset": "ARB.USDC",
"baseAssetPrecision": 2, "quoteAssetPrecision": 6,
"filters": [
{ "filterType": "PRICE_FILTER", "minPrice": "0", "maxPrice": "0", "tickSize": "0.000001" },
{ "filterType": "LOT_SIZE", "minQty": "1.00", "stepSize": "0.01" },
{ "filterType": "NOTIONAL", "minNotional": "0.500059", "applyMinToMarket": true }
],
"fees": { "makerBase": "0", "makerQuote": "0", "takerBase": "0.0015", "takerQuote": "0.0015" },
"base": { "chain": "ARB", "network": { "protocol": "EVM", "id": "42161" },
"assetId": "erc20:0xb0f66bdb39acbb043308eb9dbe78f5bb47ea5430", "ticker": "HDN", "decimals": 18 },
"quote": { "chain": "ARB", "network": { "protocol": "EVM", "id": "42161" },
"assetId": "erc20:0xaf88d065e77c8cc2239327c5edb3a432268e5831", "ticker": "USDC", "decimals": 6 }
}
statusisTRADING,POST_ONLY,CANCEL_ONLY,HALT(a frozen market), orBREAKon every market while the venue is in maintenance.minNotionalis the smallest order in quote units. It follows the price of the quote asset, so read it again before you size an order. There is no maximum quantity or notional.feesare the venue's four rates: maker and taker, on the base or the quote side, each a fraction charged on the side the party receives, negative for a rebate.
Swap quote
(2026-11-25)
/api/v1/quote prices a swap as the venue's matching engine fills it now: over the two assets' direct market, or through one intermediate asset that trades against both, whichever gives the best rate with every cost in the two assets counted. A quote is not binding. The books, chain fees, lease prices and prices move until the swap starts, and the wallet estimates the swap again when it starts it.
| Parameter | |
|---|---|
from, to | Required. Two different assets, as /api/v1/assets names them: BTC.BTC, ARB.USDC. Matched without regard to case. |
amount | Required. Above zero, with no more decimal places than its market side allows: the first market's for FROM, the last market's for TO. |
amountSide | FROM (default): amount is what the swap sends. TO: what it receives, net of every fee. |
walletSetup | NONE (default): the trade alone, as for a wallet whose channels already carry the swap. NEW: also a new wallet's first swap, below. |
priceChangeTolerance | Required with NEW: how far the swap may move against its quote, as a fraction in [0, 1), as the wallet will start it. The app sends its Max price move. |
feePriority | With NEW: LOW, MEDIUM (default) or HIGH, the chain fee estimate the wallet's own transactions are priced at. |
withdrawReceivingFunds | With NEW: true when the wallet takes what it receives out of its channel on chain once the swap completes, as the app's Easy mode does. false by default. |
walletNativeAsset | With NEW: HELD (default) when the wallet holds the native asset of each network it sends a transaction on, for the fees; NONE when it holds nothing on the sending network but the asset it sends. |
priceChangeTolerance, feePriority, withdrawReceivingFunds and walletNativeAsset are refused without walletSetup=NEW.
{
"from": "ETH.ETH", "to": "ARB.USDC", "amount": "0.3", "amountSide": "FROM",
"walletSetup": "NONE", "priceChangeTolerance": null, "feePriority": null,
"withdrawReceivingFunds": null, "walletNativeAsset": null,
"quotes": [{
"sendingSettlement": "CHANNEL", "receivingSettlement": "CHANNEL", "fill": "FULL",
"fromAmount": "0.300000", "toAmount": "527.497553",
"price": "1758.325177", "topPrice": "1762.78",
"route": [{ "market": "ETH.ETH_ARB.USDC", "side": "SELL", "fromAmount": "0.300000", "toAmount": "527.497553", "feeRate": "0.002" }],
"fees": [{ "kind": "VENUE", "amount": "1.057109", "asset": "ARB.USDC" }],
"setupCosts": [], "setupUnavailable": null,
"estimatedCompletionMinSecs": null, "estimatedCompletionMaxSecs": null
}],
"noQuoteReason": null,
"quotedAt": 1795188931000
}
- Every field is always present,
nullwhere it does not apply. The request's parameters come back as the quote read them. quotesholds one quote per pair of settlements the venue offers for the two assets. Today that is one quote, both legs settling in channels (CHANNEL).- An empty
quotesis still a200:noQuoteReasonisNO_ROUTEwhen no market, or pair of markets through one asset, joins the two assets, andNO_LIQUIDITYwhen nothing is on offer along any route now. - While the venue is in maintenance (
/api/v1/system/statusanswers1), every market is on a break and the quote answers503with-1001and aRetry-After: the seconds left if this maintenance lasts as long as the last one, and at least one second. The!statusstream says when the maintenance ends. fromAmountis what the swap parts with, andtoAmountwhat it receives, net of every fee infees. WithwalletSetup=NEW, each also counts the setup costs paid in its asset and is given at that asset's own decimals:fromAmountrounded up andtoAmountrounded down, so the quote never promises more than it delivers.priceistoAmountper unit offromAmount.topPriceis the route's rate at the best order each market filled, before fees. Comparing the two shows what the size and the fees cost against the best order: 1 −price/topPrice.fillisPARTIALwhen the books carry less thanamount, and the quote is then of what they carry.routehas one entry per market crossed, in order.sideisSELLwhen the swap sends the market's base asset;toAmountis net of that market's fee, andfeeRateis its taker rate on the side the swap receives.feeshas oneVENUEentry per market, in the asset that market gives. A client's fee discount is not counted: a quote names no taker.- Every enum may gain values. Ignore a quote, a fee or a setup cost that carries one you do not know.
A new wallet's first swap
With walletSetup=NEW, each quote is also what a new wallet pays to make the swap. That wallet holds no channel with the hub and has approved none of its contracts. It holds on chain the asset it sends, enough for the swap and its setup, and with walletNativeAsset=HELD the native asset of each network it sends a transaction on. It runs the app's default settings, and its first swap sets up as its node plans it. setupCosts lists the steps it takes, in order, each as {"kind", "fee", "asset", "feeUsd"}:
kind | The step | fee is paid in |
|---|---|---|
SENDING_CHANNEL_DEPOSIT | Opening its sending channel to the hub with what it sends | The sending network's native asset |
SPONSORED_CHANNEL_DEPOSIT | With walletNativeAsset=NONE: the hub's liquidity service sends that opening for it, and pulls the token with a permit the wallet signs | The sending asset, out of what the wallet deposits |
RECEIVING_CHANNEL_LEASE | Leasing its receiving capacity from the hub's liquidity service | The sending asset, over its sending channel |
DUAL_FUND_DEPOSIT | Where both assets are on one network other than Bitcoin and it sends a token: one channel that it and the liquidity service fund together, for both legs | The sending asset |
TOKEN_APPROVAL | Approving the channel contract to pull the token it sends | The sending network's native asset |
RECEIVING_CHANNEL_EXIT | With withdrawReceivingFunds=true: taking what the swap receives out of its channel on chain once it completes | The receiving network's native asset when the wallet sends that transaction, or an asset of the swap when the liquidity service sends it |
- A cost paid in
fromis part offromAmount, and one paid intois out oftoAmount. A cost in a network's native asset is in neither: the wallet pays it from its holding of that asset. feeUsdisfeeat the venue's prices when it quoted,nullwhen it holds no price for the asset.estimatedCompletionMinSecsandestimatedCompletionMaxSecsare a fast case and a slow case for how long the swap takes from its start until it completes, setup included. They are not a deadline, and they arenullwhile the venue cannot time a wait the swap makes on a chain.setupUnavailablesays why a quote carries no setup, its other figures then being the trade alone:LEASE_TOO_BIG(the swap needs more receiving capacity than the liquidity service leases now; a smaller amount may fit),FEES_HIGHER_THAN_AMOUNT(the setup would cost the whole amount),SOURCE_UNAVAILABLE(a figure of the setup cannot be read now; ask again) orNATIVE_ASSET_REQUIRED(withwalletNativeAsset=NONE, the deposit needs the sending network's native asset).
What the quote cannot know about the wallet that makes the swap:
- Its channels and balances. A wallet that already has channels with the hub pays less setup, or none, and its own estimate may choose a cheaper plan or another route.
- How it funds a Bitcoin deposit. The quote counts a deposit funded from one output; a wallet spending more outputs pays a higher fee.
- Its settings. The quote assumes the app's defaults.
- Its own requests. The completion window leaves out the time the wallet's own calls take.
WebSocket
wss://api.hydranet.app/ws/<stream> for one stream, /stream?streams=<a>/<b> for several, each message then wrapped as {"stream", "data"}, and /ws for a connection that subscribes by message only.
| Stream | Message | When |
|---|---|---|
<symbol>@trade | {"e":"trade", "E", "s", "t", "p", "q", "T", "m", "M", "isLate"}; (2026-11-25) isLate is true on a late print | Each trade |
<symbol>@depth | {"e":"depthUpdate", "E", "s", "U", "u", "pu", "b", "a"}: the levels that changed, quantity "0" for a level removed | At most once a second |
<symbol>@level3 | (2026-11-25) {"e":"level3Update", "E", "s", "U", "u", "pu", "b", "a"}: the orders that changed, each [price, qty, orderId], quantity "0" for an order that left its side, at its last price. See The book order by order | At most once a second |
<symbol>@depth5, @depth10, @depth20 | {"lastUpdateId", "bids", "asks"}, the top levels in full | On subscribe, then when they change |
<symbol>@kline_<interval> | {"e":"kline", "E", "s", "k": {"t", "T", "s", "i", "f", "L", "o", "c", "h", "l", "v", "n", "x", "q", "V", "Q", "B"}} | On subscribe, at most once a second after trades, and with x true once the kline closes. |
<symbol>@ticker | {"e":"24hrTicker", "E", "s", "p", "P", "w", "x", "c", "Q", "b", "B", "a", "A", "o", "h", "l", "v", "q", "O", "C", "F", "L", "n"} | On subscribe, then once a second while it changes |
!ticker@arr | An array of the tickers that changed | Once a second while any changes |
<symbol>@bookTicker | {"u", "s", "b", "B", "a", "A"} | On subscribe, then when the best bid or ask changes |
!status | {"e":"status", "E", "status", "msg"} | On subscribe, then when the venue enters or leaves maintenance |
Subscribing and listing, as on Binance:
→ {"method":"SUBSCRIBE","params":["arb.hdn_arb.usdc@trade","arb.hdn_arb.usdc@depth"],"id":1}
← {"result":null,"id":1}
→ {"method":"LIST_SUBSCRIPTIONS","id":2}
← {"result":["arb.hdn_arb.usdc@depth","arb.hdn_arb.usdc@trade"],"id":2}
→ {"method":"SUBSCRIBE","params":["nope@trade"],"id":3}
← {"code":2,"msg":"Invalid request: unknown stream nope@trade","id":3}
UNSUBSCRIBE takes the same params. A message that is not JSON is answered {"code":3, ...}.
Keeping a local order book
- Open
<symbol>@depthand buffer its updates. - Read
/api/v1/depthwithlimit=5000. If itslastUpdateIdis below the first bufferedU, read it again. - Drop the buffered updates whose
uis at or belowlastUpdateId, then apply the rest in order: set each level to its quantity, and remove it at"0". - Each update's
puis theubefore it. If one is not, resynchronise from step 1.
Update ids keep growing across restarts of the service.
The book order by order
(2026-11-25) /api/v1/depth?level=3 and <symbol>@level3 show the book order by order, each resting order as [price, qty, orderId], orderId being the venue's id of the order. Keep it with the same procedure, on its own update ids:
- Open
<symbol>@level3and buffer its updates. - Read
/api/v1/depthwithlevel=3&limit=5000. If itslastUpdateIdis below the first bufferedU, read it again. - Drop the buffered updates whose
uis at or belowlastUpdateId, then apply the rest in order: set each order, by itsorderId, to its price and quantity, and remove it at"0". An order that moves to another price is sent once, at its new price. - Each update's
puis theubefore it. If one is not, resynchronise from step 1.
The order-level ids count apart from the level ids: read level=3 against @level3, and the levels against @depth. A change can move orders and leave every level as it was, so @level3 can send an update when @depth sends none.
CoinGecko, /coingecko/v1
| Path | Parameters | Answer |
|---|---|---|
/tickers | [{"ticker_id", "base_currency", "target_currency", "pool_id", "last_price", "base_volume", "target_volume", "bid", "ask", "high", "low", "base_currency_contract", "target_currency_contract"}]; bid, ask, high and low absent when there are none, the contracts only for tokens | |
/orderbook | ticker_id, depth 100 (0 for the whole book; depth levels in all, half a side) | {"ticker_id", "timestamp", "bids", "asks"} |
/historical_trades | ticker_id, type buy or sell (both when absent), limit 500 (0 for all, at most 10,000), start_time, end_time in seconds | {"buy": [...], "sell": [...]}, newest first, each {"trade_id", "price", "base_volume", "target_volume", "trade_timestamp", "type"} |
CoinMarketCap, /cmc/v1
| Path | Parameters | Answer |
|---|---|---|
/summary | [{"trading_pairs", "base_currency", "quote_currency", "type", "last_price", "lowest_ask", "highest_bid", "base_volume", "quote_volume", "price_change_percent_24h", "highest_price_24h", "lowest_price_24h"}]; an empty side reads "0" | |
/assets | {"ARB.HDN": {"name", "unified_cryptoasset_id", "contractAddress", "contractAddressUrl"}} | |
/ticker | {"ARB.HDN_ARB.USDC": {"base_id", "quote_id", "last_price", "base_volume", "quote_volume", "isFrozen"}} | |
/orderbook/{market_pair} | depth (0, the default, for the whole book; depth levels in all, half a side), level 1, 2 (default) or 3 | {"timestamp", "bids", "asks"}: level 1 is the best bid and ask, level 3 one entry per order |
/trades/{market_pair} | The last 24 hours' trades, newest first, at most 10,000: [{"trade_id", "price", "base_volume", "quote_volume", "timestamp", "type"}] |
Both paths with {market_pair} also take it as ?market_pair=.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | -1100 | A parameter has characters it cannot hold |
| 400 | -1102 | A required parameter is missing or empty |
| 400 | -1121 | No such market, including an unknown ticker_id or market_pair |
| 400 | -1120 | No such kline interval |
| 400 | -1130 | A value out of range: limit, depth, level, type or a time; on /quote also an asset /api/v1/assets does not list, an amount with too many decimal places, or a priceChangeTolerance outside [0, 1) |
| 400 | -1013 | On /quote, the order every route would place for amount is below a market's minimum. minAmount and minAsset give the least amount that clears it, setup costs counted |
| 400 | -1128 | symbol and symbols together, a start after its end, or on /quote from equal to to or a parameter that needs walletSetup=NEW without it |
| 404 | -1000 | No such path |
| 418 | -1003 | Banned for sending on after a 429; Retry-After says when the ban ends |
| 429 | -1003 | The weight limit is used up; Retry-After says when to send again |
| 503 | -1001 | The market's data is not available yet, for example while the service starts; on /quote, also while the venue is in maintenance or cannot be reached, with Retry-After |
| 503 | -1008 | The service is busy; try again after Retry-After |