Get the open interest, the traded volume or the funding of a market over time
/v1/chains/{chain}/perpl/markets/{market}/historyCall this to draw one of three series of a market, chosen by metric:
oi: the open interest in US dollars at the mark (the long side, which equals the short side) and the number of positions. Sona stores one point per market every five minutes from its own snapshots, so the series starts when Sona began recording andcoveragesaysperpl_oi_from_snapshots. The points are thinned to one perstep_sseconds (300 for 24 hours, 1800 for 168 hours, 7200 for 720 hours), the last stored point of each window. A window without a stored point is missing.volume: the hourly candles of Perpl's public market data, one item per UTC hour, oldest first, the last one still open.volume_usdis the traded notional of the hour andtradesthe number of trades. An hour without trades can be missing.step_sis 3600.funding: the funding rates Perpl applied in the window, one item per application, oldest first.rateis the rate of one funding interval as a fraction of notional, with the sign of the exchange (positive means longs pay shorts), so0.00004is 0.004%.step_sis the usual distance between two events (the median), 0 with fewer than two.
hours is 24, 168 or 720, 168 by default. The volume and funding series come from Perpl's public site, which Sona reads at most once a second and keeps for five minutes, so a repeated call is free and the first call after that can take a second or two.
Sona keeps an answer for 1 minute.
Path parameters
| Name | Type | Description |
|---|---|---|
chainRequired | string | The chain, as a CAIP-2 chain ID. Only Monad, |
marketRequired | string | A market, as its symbol in any case ( |
Query parameters
| Name | Type | Description |
|---|---|---|
metricRequired | string | The series: |
hours | integerDefault 168 | How many hours back the series reaches: 24, 168 or 720. Anything else answers 400 |
Response
The answer, wrapped in the {data, meta, links} envelope.
| Field | Type | Description |
|---|---|---|
| chain | string | The CAIP-2 id of the chain. |
| coverage | array of strings | The codes of the limits that apply to this answer, in a fixed order. It is empty when none applies. The status route explains each code. |
| items | array of objects | The points in ascending order of time. Their shape follows |
| kind | string | perpl_market_history |
| market | string | The symbol of the market. |
| metric | string | oivolumefunding |
| step_s | integer | The distance in seconds between two items: the window of an |
Cost
1 credit. The time limit is 5 seconds.
Errors
| Status | Code |
|---|---|
| 400 | invalid_queryinvalid_id |
| 404 | not_foundunsupported_chain |
| 429 | rate_limitedcredits_exhausted |
| 500 | internal |
| 503 | upstream_unavailable |
| 504 | deadline_exceeded |
400 invalid_query for a missing or unknown metric, an hours outside the three values or another query key, 400 invalid_id, 404 not_found for an unknown market or one without a mark price, 404 unsupported_chain, 429 rate_limited or credits_exhausted, 503 upstream_unavailable before the first snapshot or when Perpl's site does not answer, and 504 deadline_exceeded.