Add Nado documentation and examples, including new API endpoints, FAQs, and guides for using the TypeScript SDK. Update .env.example with additional configuration options.

This commit is contained in:
discountry
2025-12-19 01:38:09 +08:00
parent 624fecfa70
commit c69ea72860
148 changed files with 17031 additions and 27 deletions
@@ -0,0 +1,97 @@
# Candlesticks
## Rate limits
* Dynamic based on <mark style="color:red;">`limit`</mark> param provided (**weight = 1 + limit / 20**)
* E.g: With <mark style="color:red;">`limit=100`</mark>, you can make up to 400 requests per min or 66 requests / 10 secs.
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Available Granularities
The following granularities / periods are supported (in seconds):
| Granularity name | Granularity value (in seconds) |
| :--------------: | :----------------------------: |
| 1 minute | 60 |
| 5 minutes | 300 |
| 15 minutes | 900 |
| 1 hour | 3600 |
| 2 hours | 7200 |
| 4 hours | 14400 |
| 1 day | 86400 |
| 1 week | 604800 |
| 4 weeks | 2419200 |
## Request
{% tabs %}
{% tab title="Product candlesticks" %}
Query product candlesticks ordered by <mark style="color:red;">`timestamp`</mark> desc.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"candlesticks": {
"product_id": 1,
"granularity": 60,
"limit": 2
}
}
```
{% endtab %}
{% endtabs %}
## Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="113" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">product_id</td><td align="center">number</td><td align="center">Yes</td><td>Id of product to fetch candlesticks for.</td></tr><tr><td align="center">granularity</td><td align="center">number</td><td align="center">Yes</td><td>Granularity value in seconds.</td></tr><tr><td align="center">max_time</td><td align="center">number / string</td><td align="center">No</td><td>When providing <mark style="color:red;"><code>max_time</code></mark> (unix epoch in seconds), only return candlesticks with timestamp &#x3C;= <mark style="color:red;"><code>max_time</code></mark></td></tr><tr><td align="center">limit</td><td align="center">number</td><td align="center">No</td><td>Max number of candlesticks to return. defaults to <mark style="color:red;"><code>100</code></mark>. max possible of <mark style="color:red;"><code>500</code></mark>.</td></tr></tbody></table>
## Response
```json
{
"candlesticks": [
{
"product_id": 1,
"granularity": 60,
"submission_idx": "627709",
"timestamp": "1680118140",
"open_x18": "27235000000000000000000",
"high_x18": "27298000000000000000000",
"low_x18": "27235000000000000000000",
"close_x18": "27298000000000000000000",
"volume": "1999999999999999998"
},
{
"product_id": 1,
"granularity": 60,
"submission_idx": "627699",
"timestamp": "1680118080",
"open_x18": "27218000000000000000000",
"high_x18": "27245000000000000000000",
"low_x18": "27218000000000000000000",
"close_x18": "27245000000000000000000",
"volume": "11852999999999999995"
}
]
}
```
## Response Fields
| Field name | Description |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| submission\_idx | Id of the latest recorded transaction that contributes to the candle. |
| product\_id | Id of product candle is associated to. |
| granularity | Candle time interval, expressed in seconds, representing the aggregation period for trading volume and price data |
| open\_x18 | The first fill price of the candle, multiplied by 10^18 |
| high\_x18 | The highest recorded fill price during the defined interval of the candle, multiplied by 10^18 |
| low\_x18 | The lowest recorded fill price during the defined interval of the candle, multiplied by 10^18 |
| close\_x18 | The last price of the candle, multiplied by 10^18 |
| volume | Asset volume, which represents the absolute cumulative fill amounts during the time interval of the candle, multiplied by 10^18 |
@@ -0,0 +1,54 @@
# Direct Deposit Address
## Rate limits
* 240 requests/min or 40 requests/10secs per IP address. (**weight = 10**)
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="Direct Deposit Address" %}
Query the unique direct deposit address for a subaccount.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"direct_deposit_address": {
"subaccount": "0x79cc76364b5fb263a25bd52930e3d9788fcfeea864656661756c740000000000"
}
}
```
{% endtab %}
{% endtabs %}
## Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="150" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">subaccount</td><td align="center">string</td><td align="center">Yes</td><td>Hex string of the subaccount to fetch the direct deposit address for.</td></tr></tbody></table>
## Response
```json
{
"subaccount": "0x79cc76364b5fb263a25bd52930e3d9788fcfeea864656661756c740000000000",
"deposit_address": "0x1234567890123456789012345678901234567890",
"created_at": "1683315718"
}
```
## Response Fields
### Direct Deposit Address
<table><thead><tr><th width="263">Field name</th><th>Description</th></tr></thead><tbody><tr><td>subaccount</td><td>Hex string of the subaccount</td></tr><tr><td>deposit_address</td><td>Unique deposit address for this subaccount</td></tr><tr><td>created_at</td><td>Unix epoch time in seconds when the deposit address was created</td></tr></tbody></table>
{% hint style="info" %}
Direct deposit addresses allow users to deposit funds directly to their subaccount without needing to interact with the smart contract. Funds sent to this address will automatically be credited to the associated subaccount.
{% endhint %}
@@ -0,0 +1,97 @@
# Edge Candlesticks
## Rate limits
* Dynamic based on <mark style="color:red;">`limit`</mark> param provided (**weight = 1 + limit / 20**)
* E.g: With <mark style="color:red;">`limit=100`</mark>, you can make up to 400 requests per min or 66 requests / 10 secs.
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Available Granularities
The following granularities / periods are supported (in seconds):
| Granularity name | Granularity value (in seconds) |
| :--------------: | :----------------------------: |
| 1 minute | 60 |
| 5 minutes | 300 |
| 15 minutes | 900 |
| 1 hour | 3600 |
| 2 hours | 7200 |
| 4 hours | 14400 |
| 1 day | 86400 |
| 1 week | 604800 |
| 4 weeks | 2419200 |
## Request
{% tabs %}
{% tab title="Ede candlesticks" %}
Query edge candlesticks ordered by <mark style="color:red;">`timestamp`</mark> desc.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"edge_candlesticks": {
"product_id": 1,
"granularity": 60,
"limit": 2
}
}
```
{% endtab %}
{% endtabs %}
## Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="113" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">product_id</td><td align="center">number</td><td align="center">Yes</td><td>Id of product to fetch candlesticks for.</td></tr><tr><td align="center">granularity</td><td align="center">number</td><td align="center">Yes</td><td>Granularity value in seconds.</td></tr><tr><td align="center">max_time</td><td align="center">number / string</td><td align="center">No</td><td>When providing <mark style="color:red;"><code>max_time</code></mark> (unix epoch in seconds), only return candlesticks with timestamp &#x3C;= <mark style="color:red;"><code>max_time</code></mark></td></tr><tr><td align="center">limit</td><td align="center">number</td><td align="center">No</td><td>Max number of candlesticks to return. defaults to <mark style="color:red;"><code>100</code></mark>. max possible of <mark style="color:red;"><code>500</code></mark>.</td></tr></tbody></table>
## Response
```json
{
"candlesticks": [
{
"product_id": 1,
"granularity": 60,
"submission_idx": "627709",
"timestamp": "1680118140",
"open_x18": "27235000000000000000000",
"high_x18": "27298000000000000000000",
"low_x18": "27235000000000000000000",
"close_x18": "27298000000000000000000",
"volume": "1999999999999999998"
},
{
"product_id": 1,
"granularity": 60,
"submission_idx": "627699",
"timestamp": "1680118080",
"open_x18": "27218000000000000000000",
"high_x18": "27245000000000000000000",
"low_x18": "27218000000000000000000",
"close_x18": "27245000000000000000000",
"volume": "11852999999999999995"
}
]
}
```
## Response Fields
| Field name | Description |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| submission\_idx | Id of the latest recorded transaction that contributes to the candle. |
| product\_id | Id of product candle is associated to. |
| granularity | Candle time interval, expressed in seconds, representing the aggregation period for trading volume and price data |
| open\_x18 | The first fill price of the candle, multiplied by 10^18 |
| high\_x18 | The highest recorded fill price during the defined interval of the candle, multiplied by 10^18 |
| low\_x18 | The lowest recorded fill price during the defined interval of the candle, multiplied by 10^18 |
| close\_x18 | The last price of the candle, multiplied by 10^18 |
| volume | Asset volume, which represents the absolute cumulative fill amounts during the time interval of the candle, multiplied by 10^18 |
@@ -0,0 +1,193 @@
# Edge Market Snapshots
## Rate limits
**Dynamic based on interval.count.**
* IP weight = <mark style="color:red;">`(interval.count.min(500) / 20) + (interval.count.clamp(2, 20) * 2)`</mark>
* Scales mainly with interval count.
* Example: <mark style="color:red;">`interval.count=500 → weight=65`</mark>, <mark style="color:red;">`interval.count=100 → weight=45`</mark>.
* Minimum weight per request is <mark style="color:red;">`4`</mark>.
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
### Request
{% tabs %}
{% tab title="Market snapshots" %}
Query market snapshots ordered by <mark style="color:red;">`timestamp`</mark> desc.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"edge_market_snapshots": {
"interval": {
"count": 2,
"granularity": 3600,
"max_time": 1691083697,
},
"product_ids": [1, 2]
}
}
```
{% endtab %}
{% endtabs %}
### Request Parameters
<table><thead><tr><th width="192" align="center">Parameter</th><th width="103" align="center">Type</th><th width="101" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">interval</td><td align="center">object</td><td align="center">Yes</td><td>Object to specify desired time period for data</td></tr><tr><td align="center">interval.count</td><td align="center">number</td><td align="center">Yes</td><td>Number of snapshots to return, limit 100. Also limited to <code>interval.count * # product_ids &#x3C; 2000</code></td></tr><tr><td align="center">interval.granularity</td><td align="center">number</td><td align="center">Yes</td><td>Granularity value in seconds</td></tr><tr><td align="center">interval.max_time</td><td align="center">number / string</td><td align="center">No</td><td>When providing <mark style="color:red;"><code>max_time</code></mark> (unix epoch in seconds), only return snapshots with timestamp &#x3C;= <mark style="color:red;"><code>max_time</code></mark>. If no value is entered, <code>max_time</code> defaults to the current time.</td></tr><tr><td align="center">product_ids</td><td align="center">number[]</td><td align="center">No</td><td>list of product ids to fetch snapshots for, defaults to all products</td></tr></tbody></table>
### Response
{% hint style="info" %}
**Note**:
* Returns a mapping of <mark style="color:orange;">`chain_id -> snapshots`</mark>
{% endhint %}
```json
{
"snapshots": {
"42161": [
{
"timestamp": 1689965194,
"cumulative_users": 2774,
"daily_active_users": 251,
"cumulative_trades": {
"1": 54287,
"2": 172435
},
"cumulative_volumes": {
"1": "259549132367035103631071564",
"2": "1134008547778337985156988339"
},
"cumulative_trade_sizes": {
"1": "9209508999999999995173",
"2": "40246259000000000000000"
},
"cumulative_taker_fees": {
"1": "88916428908427788322799",
"2": "259205794197801680292645"
},
"cumulative_sequencer_fees": {
"1": "11038200000000000000000",
"2": "32353000000000000000000"
},
"cumulative_maker_fees": {
"1": "-12421730086012739050725",
"2": "-36124007075181485948604"
},
"cumulative_liquidation_amounts": {
"1": "848311398835000694508",
"2": "1013231566414935056343898"
},
"open_interests": {
"2": "2907581091676822842104781"
},
"total_deposits": {
"1": "37722308770940799414"
},
"total_borrows": {
"1": "1441397740941092000"
},
"funding_rates": {
"2": "3611102723387"
},
"deposit_rates": {
"1": "1001376785714"
},
"borrow_rates": {
"1": "32059880416879"
},
"cumulative_inflows": {
"1": "238791614019999999853",
"2": "0"
},
"cumulative_outflows": {
"1": "-202514202990000000306",
"2": "0"
},
"tvl": "7560079507311601381352742"
}
],
"5000": [
{
"timestamp": 1689965194,
"cumulative_users": 2774,
"daily_active_users": 251,
"cumulative_trades": {
"1": 54287,
"2": 172435
},
"cumulative_volumes": {
"1": "259549132367035103631071564",
"2": "1134008547778337985156988339"
},
"cumulative_trade_sizes": {
"1": "9209508999999999995173",
"2": "40246259000000000000000"
},
"cumulative_taker_fees": {
"1": "88916428908427788322799",
"2": "259205794197801680292645"
},
"cumulative_sequencer_fees": {
"1": "11038200000000000000000",
"2": "32353000000000000000000"
},
"cumulative_maker_fees": {
"1": "-12421730086012739050725",
"2": "-36124007075181485948604"
},
"cumulative_liquidation_amounts": {
"1": "848311398835000694508",
"2": "1013231566414935056343898"
},
"open_interests": {
"2": "2907581091676822842104781"
},
"total_deposits": {
"1": "37722308770940799414"
},
"total_borrows": {
"1": "1441397740941092000"
},
"funding_rates": {
"2": "3611102723387"
},
"deposit_rates": {
"1": "1001376785714"
},
"borrow_rates": {
"1": "32059880416879"
},
"cumulative_inflows": {
"1": "238791614019999999853",
"2": "0"
},
"cumulative_outflows": {
"1": "-202514202990000000306",
"2": "0"
},
"tvl": "7560079507311601381352742"
}
]
}
}
```
### Response Fields
#### Snapshots
{% hint style="info" %}
**Note**: For product specific fields (i.e. cumulative\_volume, open\_interests), the value is an object which maps product\_ids to their corresponding values.
{% endhint %}
<table><thead><tr><th width="260">Field name</th><th>Description</th></tr></thead><tbody><tr><td>timestamp</td><td>Timestamp of the snapshot. This may not be perfectly rounded to the granularity since it uses the nearest transaction timestamp less than or equal to <mark style="color:red;"><code>max_time</code></mark></td></tr><tr><td>cumulative_users</td><td>The cumulative number of subaccounts on Nado. It is updated daily at 9AM ET for historical counts. For current day counts, it is updated every hour.</td></tr><tr><td>daily_active_users</td><td>Daily active users count, updated daily at 9AM ET for historical counts. For current day counts, it is updated every hour.</td></tr><tr><td>cumulative_trades</td><td>A map of product_id -> the cumulative number of trades for the given product_id.</td></tr><tr><td>cumulative_volumes</td><td>A map of product_id -> cumulative volumes in USDT0 units.</td></tr><tr><td>cumulative_trade_sizes</td><td>A map of product_id -> cumulative trade sizes in base token</td></tr><tr><td>cumulative_taker_fees</td><td>A map of product_id -> cumulative taker fees. Taker fees include sequencer fees.</td></tr><tr><td>cumulative_sequencer_fees</td><td>A map of product_id -> cumulative sequencer fees.</td></tr><tr><td>cumulative_maker_fees</td><td>A map of product_id -> cumulative maker rebates.</td></tr><tr><td>cumulative_liquidation_amounts</td><td>A map of product_id -> cumulative liquidation amounts in USDT0 units.</td></tr><tr><td>open_interests</td><td>A map of product_id -> open interests in USDT0 units.</td></tr><tr><td>total_deposits</td><td>A map of product_id -> total deposits held by Nado for a given product at the given time in the base token units.</td></tr><tr><td>total_borrows</td><td>A map of product_id -> total borrows lent by Nado for a given product at the given time in the base token units.</td></tr><tr><td>funding_rates</td><td>A map of product_id -> <strong>hourly</strong> historical funding rates, value returned as <strong>decimal rates</strong> (% = rate * 100), derived from funding payment amounts. Requires a minimum granularity of 3600 to see non-zero funding rates. Use a granularity where granularity % 3600 = 0 for best results.</td></tr><tr><td>deposit_rates</td><td>A map of product_id -> <strong>daily</strong> deposit rates, values returned as <strong>decimal rates</strong> (% = rate * 100).</td></tr><tr><td>borrow_rates</td><td>A map of product_id -> <strong>daily</strong> borrow rates, values returned as <strong>decimal rates</strong> (% = rate * 100).</td></tr><tr><td>cumulative_inflows</td><td>A map of product_id -> cumulative inflows a.k.a deposits in base token units.</td></tr><tr><td>cumulative_outflows</td><td>A map of product_id -> cumulative outflows a.k.a withdraws in base token units.</td></tr><tr><td>tvl</td><td>The total value locked in USD.</td></tr></tbody></table>
@@ -0,0 +1,268 @@
# Events
## Rate limits
* IP weight = <mark style="color:red;">`2 + (limit * subaccounts.length / 10)`</mark> where <mark style="color:red;">`limit`</mark> defaults to 100 (max 500) and <mark style="color:red;">`subaccounts.length`</mark> defaults to 1
* E.g: With <mark style="color:red;">`limit=100`</mark> and 1 subaccount, weight = 12, allowing up to 200 requests per min or 33 requests / 10 secs.
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Available Events
Each event corresponds to a transaction type in Nado. See below available events and their <mark style="color:red;">`event_type`</mark> mapping:
| Event Name | Event Type Value |
| :---------------------------------------------------: | :-------------------: |
| <mark style="color:red;">`LiquidateSubaccount`</mark> | liquidate\_subaccount |
| <mark style="color:red;">`DepositCollateral`</mark> | deposit\_collateral |
| <mark style="color:red;">`WithdrawCollateral`</mark> | withdraw\_collateral |
| <mark style="color:red;">`SettlePnl`</mark> | settle\_pnl |
| <mark style="color:red;">`MatchOrders`</mark> | match\_orders |
| <mark style="color:red;">`MintLp`</mark> | mint\_lp |
| <mark style="color:red;">`BurnLp`</mark> | burn\_lp |
## Event Limits
You can specify 2 types of <mark style="color:red;">`limit`</mark> on the query:
* <mark style="color:red;">`raw`</mark>: the max number of events to return.
* <mark style="color:red;">`txs`</mark>: the max number of transactions to return. **note**: one transaction can emit multiple events, by specifying this limit, you will get all the events associated to the transactions in the response.
## Request
{% tabs %}
{% tab title="Events by subaccount" %}
Query events corresponding to specific subaccounts, ordered by <mark style="color:red;">`submission index`</mark> desc. E.g: all <mark style="color:red;">`MatchOrder`</mark> events for subaccounts <mark style="color:red;">`xxx`</mark> specific to spot wBTC.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"events": {
"product_ids": [
1
],
"subaccounts": [
"0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c740000000000"
],
"event_types": ["match_orders"],
"max_time": 1679728762,
"limit": {
"raw": 1
},
"isolated": false
}
}
```
{% endtab %}
{% tab title="Events by product" %}
Query events corresponding to specific products, ordered by <mark style="color:red;">`submission index`</mark> desc. Uses <mark style="color:red;">`txs`</mark> limit, will only return a single <mark style="color:red;">`tx`</mark> and one or more events associated with the <mark style="color:red;">`tx`</mark>.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"events": {
"product_ids": [
1,
2
],
"max_time": "1679728762",
"limit": {
"txs": 1
}
}
}
```
{% endtab %}
{% tab title="Events by type" %}
Query events corresponding to specific types, ordered by <mark style="color:red;">`submission index`</mark> desc.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"events": {
"event_types": ["deposit_collateral", "withdraw_collateral"],
"max_time": "1679728762",
"limit": {
"raw": 1
}
}
}
```
{% endtab %}
{% tab title="All events" %}
Query all events ordered by <mark style="color:red;">`submission index`</mark> desc.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"events": {
"max_time": "1679728762",
"limit": {
"raw": 1
}
}
}
```
{% endtab %}
{% endtabs %}
## Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="162" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">subaccounts</td><td align="center">string[]</td><td align="center">No</td><td>Array of <mark style="color:red;"><code>bytes32</code></mark> sent as hex strings; each includes the address and the subaccount identifier. When provided, only return events for the specified subaccounts.</td></tr><tr><td align="center">product_ids</td><td align="center">number[]</td><td align="center">No</td><td>when provided, only return events for the specified product ids; return events for all products otherwise.</td></tr><tr><td align="center">event_types</td><td align="center">string[]</td><td align="center">No</td><td>when provided, only return events for the specified event types; return all events otherwise.</td></tr><tr><td align="center">idx</td><td align="center">number / string</td><td align="center">No</td><td>when provided, only return events with <mark style="color:red;"><code>submission_idx</code></mark> &#x3C;= <mark style="color:red;"><code>idx</code></mark></td></tr><tr><td align="center">max_time</td><td align="center">number / string</td><td align="center">No</td><td>when <mark style="color:red;"><code>idx</code></mark> is not provided, <mark style="color:red;"><code>max_time</code></mark> (unix epoch in seconds) can be used to only return events created &#x3C;= <mark style="color:red;"><code>max_time</code></mark></td></tr><tr><td align="center">limit</td><td align="center"><p>object<br>{"raw": number } or</p><p>{"txs": number }</p></td><td align="center">No</td><td><ul><li>specifying <mark style="color:red;"><code>raw</code></mark> limit: max number of events to return. defaults to <mark style="color:red;"><code>100</code></mark>. max possible of <mark style="color:red;"><code>500</code></mark>.</li><li>specifying <mark style="color:red;"><code>txs</code></mark> limit: max number of txs to return.</li></ul></td></tr><tr><td align="center">isolated</td><td align="center">bool</td><td align="center">No</td><td>When provided --<br>- <mark style="color:red;"><code>true</code></mark>: only returns evens associated to isolated positions.<br>- <mark style="color:red;"><code>false</code></mark>: only return events associated to the cross-subaccount.<br>defaults to <mark style="color:red;"><code>null</code></mark>. In which case it returns everything.<br><br>See <a href="https://github.com/nadohq/nado-docs/blob/main/docs/basics/isolated-margin.md">Isolated Margin</a> to learn more.</td></tr></tbody></table>
## Response
{% hint style="info" %}
**Note:**
* the response includes a <mark style="color:red;">`txs`</mark> field which contains the relevant transactions to the events. There are <mark style="color:red;">`>=1 events`</mark> per transaction.
* both <mark style="color:red;">`events`</mark> and <mark style="color:red;">`txs`</mark> are in descending order by <mark style="color:red;">`submission_idx`</mark>`.`
* use the <mark style="color:red;">`submission_idx`</mark> to associate an <mark style="color:red;">`event`</mark> to it's corresponding transaction.
{% endhint %}
```json
{
"events": [
{
"subaccount": "0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c740000000000",
"product_id": 1,
"submission_idx": "563011",
"event_type": "match_orders",
"isolated": false,
"isolated_product_id": null,
"pre_balance": {
"spot": {
"product_id": 1,
"balance": {
"amount": "26766781157882079846319"
}
}
},
"post_balance": {
"spot": {
"product_id": 1,
"balance": {
"amount": "26767505157882079846318",
"last_cumulative_multiplier_x18": "1001292804799204317"
}
}
},
"product": {
"product_id": 1,
"oracle_price_x18": "115575316424148798147115",
"risk": {
"long_weight_initial_x18": "900000000000000000",
"short_weight_initial_x18": "1100000000000000000",
"long_weight_maintenance_x18": "950000000000000000",
"short_weight_maintenance_x18": "1050000000000000000",
"price_x18": "115575316424148798147115"
},
"config": {
"token": "0xc57c1c64561a37ac9e8f9039cb6deab7539d99fc",
"interest_inflection_util_x18": "800000000000000000",
"interest_floor_x18": "10000000000000000",
"interest_small_cap_x18": "40000000000000000",
"interest_large_cap_x18": "1000000000000000000",
"withdraw_fee_x18": "40000000000000",
"min_deposit_rate_x18": "0"
},
"state": {
"cumulative_deposits_multiplier_x18": "1000000000000318713",
"cumulative_borrows_multiplier_x18": "1000347390679880473",
"total_deposits_normalized": "9000399823280682696107190850",
"total_borrows_normalized": "9580268570661550719"
},
"book_info": {
"size_increment": "1000000000000000",
"price_increment_x18": "1000000000000000000",
"min_size": "4000000000000000",
"collected_fees": "0"
}
},
"net_interest_unrealized": "49040544804593257",
"net_interest_cumulative": "51596254598679857",
"net_funding_unrealized": "0",
"net_funding_cumulative": "0",
"net_entry_unrealized": "748947727410369682388339518",
"net_entry_cumulative": "749148081870171307027129958",
"quote_volume_cumulative": "1234567890123456789"
}
],
"txs": [
{
"tx": {
"match_orders": {
"product_id": 1,
"amm": true,
"taker": {
"order": {
"sender": "0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c740000000000",
"price_x18": "27540000000000000000000",
"amount": "2000000000000000000",
"appendix": "1537",
"expiration": 4611686020107120000,
"nonce": 1761322602510418000
},
"signature": "0x826c68f1a3f76d9ffbe8041f8d45e969d31f1ab6f2ae2f6379d1493e479e56436091d6cf4c72e212dd2f1d2fa17c627c4c21bd6d281c77172b8af030488478b71c"
},
"maker": {
"order": {
"sender": "0xf8d240d9514c9a4715d66268d7af3b53d619642564656661756c740000000000",
"price_x18": "27540000000000000000000",
"amount": "-724000000000000000",
"appendix": "1537",
"expiration": 1679731656,
"nonce": 1761322565506171000
},
"signature": "0xd8b6505b8d9b8c3cbfe793080976388035682c02a27893fb26b48a5b2bfe943f4162dea3a42e24e0dff5e2f74fbf77e33d83619140a2a581117c55e6cc236bdb1c"
}
}
},
"submission_idx": "563011",
"timestamp": "1679728127"
}
]
}
```
## Response Fields
### Events
{% hint style="info" %}
* **Net cumulative**: the net difference in that quantity since the beginning of time. For example, if I want to compute total amount paid out in funding between two events, you can subtract the `net_funding_cumulative` of the larger event by the `net_funding_cumulative` of the smaller event.
* **Net unrealized**: similar to `net_cumulative`, but for `net_unrealized`, we have the caveat that when the magnitude of your position decreases, the magnitude of net\_unrealized `decreases` by the same amount.
{% endhint %}
<table><thead><tr><th width="307">Field name</th><th>Description</th></tr></thead><tbody><tr><td>submission_idx</td><td>Used to uniquely identify the blockchain transaction that generated the event; you can use it to grab the relevant transaction in the <code>txs</code> section.</td></tr><tr><td>product_id</td><td>The id of of the product the event is associated with.</td></tr><tr><td>event_type</td><td>Name of the transaction type this event corresponds to.</td></tr><tr><td>subaccount</td><td>The subaccount associated to the event.</td></tr><tr><td>pre_balance</td><td>The state of your balance before the event happened.</td></tr><tr><td>post_balance</td><td>The state of your balance after the event happened.</td></tr><tr><td>product</td><td>The state of the product throughout the event.</td></tr></tbody></table>
### Txs
| Field name | Description |
| --------------- | --------------------------------------------------------------------------------------- |
| submission\_idx | Unique identifier of the transaction. |
| product\_id | Product associated to the transaction. |
| tx | Raw data of the corresponding transaction e.g: `match_orders` with all associated data. |
| timestamp | The unix epoch in seconds of when the transaction took place. |
@@ -0,0 +1,53 @@
# Fast Withdrawal Signature
## Rate limits
* 240 requests/min or 40 requests/10secs per IP address. (**weight = 10**)
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="Fast Withdrawal Signature" %}
Query the signature required for a fast withdrawal at a specific submission index.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"fast_withdrawal_signature": {
"idx": "12345"
}
}
```
{% endtab %}
{% endtabs %}
## Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="150" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">idx</td><td align="center">number / string</td><td align="center">Yes</td><td>Submission index to fetch the fast withdrawal signature for.</td></tr></tbody></table>
## Response
```json
{
"signature": "0x1234567890abcdef...",
"submission_idx": "12345",
"subaccount": "0x79cc76364b5fb263a25bd52930e3d9788fcfeea864656661756c740000000000",
"product_id": 0,
"amount": "1000000000000000000",
"nonce": "1"
}
```
## Response Fields
### Fast Withdrawal Signature
<table><thead><tr><th width="263">Field name</th><th>Description</th></tr></thead><tbody><tr><td>signature</td><td>Hex string of the signature for fast withdrawal</td></tr><tr><td>submission_idx</td><td>Transaction submission index</td></tr><tr><td>subaccount</td><td>Hex string of the subaccount</td></tr><tr><td>product_id</td><td>Product ID (0 for quote asset)</td></tr><tr><td>amount</td><td>Withdrawal amount (x18 format)</td></tr><tr><td>nonce</td><td>Nonce for the withdrawal transaction</td></tr></tbody></table>
@@ -0,0 +1,94 @@
# Funding Rate
## Rate limits
* 1200 requests/min or 20 requests/sec per IP address. (**weight = 2**)
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Single Product
### Request
{% tabs %}
{% tab title="Funding Rate" %}
Query perp product 24hr funding rate.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"funding_rate": {
"product_id": 2
}
}
```
{% endtab %}
{% endtabs %}
### Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="113" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">product_id</td><td align="center">number</td><td align="center">Yes</td><td>Id of perp product to fetch funding rate for.</td></tr></tbody></table>
### Response
```json
{
"product_id": 2,
"funding_rate_x18": "2447900598160952",
"update_time": "1680116326"
}
```
## Multiple Products
### Request
{% tabs %}
{% tab title="Perp Prices" %} <mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"funding_rates": {
"product_ids": [2]
}
}
```
{% endtab %}
{% endtabs %}
### Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="113" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">product_ids</td><td align="center">number[]</td><td align="center">Yes</td><td>Ids of perp products to fetch funding rate for.</td></tr></tbody></table>
### Response
{% hint style="info" %}
**Note**: the response is a map of <mark style="color:red;">`product_id -> funding_rate`</mark> for each requested product.
{% endhint %}
```json
{
"2": {
"product_id": 2,
"funding_rate_x18": "-697407056090986",
"update_time": "1692825387"
}
}
```
## Response Fields
| Field name | Description |
| ------------------ | ----------------------------------------------------------------------- |
| product\_id | Id of the perp product this funding rate corresponds to. |
| funding\_rate\_x18 | Latest 24hr funding rate for the specified product, multiplied by 10^18 |
| update\_time | Epoch time in seconds this funding rate was last updated at |
@@ -0,0 +1,51 @@
# Ink Airdrop
Query the Ink token airdrop allocation for a specific wallet address.
## Rate limits
* 1200 requests/min or 200 requests/10secs per IP address. (**weight = 2**)
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="Ink Airdrop" %} <mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"ink_airdrop": {
"address": "0x1234567890123456789012345678901234567890"
}
}
```
{% endtab %}
{% endtabs %}
## Request Parameters
<table><thead><tr><th width="178" align="center">Parameter</th><th width="229" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">address</td><td align="center">string</td><td align="center">Yes</td><td>Wallet address (20-byte address) sent as a hex string.</td></tr></tbody></table>
## Response
{% hint style="info" %}
**Note**: The amount is returned as a string to preserve precision.
{% endhint %}
```json
{
"amount": "1000000000000000000"
}
```
## Response Fields
| Field name | Description |
| ---------- | ------------------------------------------------------ |
| amount | The Ink token airdrop amount allocated to the address. |
@@ -0,0 +1,89 @@
# Interest & funding payments
## Rate limits
* 480 requests/min or 80 requests/10secs per IP address. (**weight = 5**)
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="Interest and funding" %}
Query subaccount historical interest and funding payments.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"interest_and_funding": {
"subaccount": "0xD028878bF5c96218E53DA859e587cb8398B17b3f64656661756c740000000000",
"product_ids": [1, 2],
"limit": 10,
"max_idx": 1315836
}
}
```
{% endtab %}
{% endtabs %}
## Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="140" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">subaccount</td><td align="center">string</td><td align="center">Yes</td><td>A bytes32 sent as a hex string; includes the address and the subaccount identifier.</td></tr><tr><td align="center">product_ids</td><td align="center">number[]</td><td align="center">Yes</td><td>Ids of products to historical interest/funding payments for.</td></tr><tr><td align="center">max_idx</td><td align="center">string/number</td><td align="center">No</td><td>When provided, only return records with <mark style="color:red;"><code>idx</code></mark> &#x3C;= <mark style="color:red;"><code>max_idx</code></mark>.</td></tr><tr><td align="center">limit</td><td align="center">number</td><td align="center">Yes</td><td>Max number of records to return. Max possible of <mark style="color:red;"><code>100</code></mark>.</td></tr></tbody></table>
## Response
```json
{
"interest_payments": [
{
"product_id": 4,
"idx": "5968022",
"timestamp": "1701698400",
"amount": "-12273223338657163",
"balance_amount": "1000000000000000000",
"rate_x18": "47928279191008320",
"oracle_price_x18": "2243215034242228224820"
},
...
],
"funding_payments": [
{
"product_id": 2,
"idx": "5968022",
"timestamp": "1701698400",
"amount": "-12273223338657163",
"balance_amount": "1000000000000000000",
"rate_x18": "47928279191008320",
"oracle_price_x18": "2243215034242228224820"
},
...
],
"next_idx": "1314805"
}
```
## Response Fields
| Field name | Description |
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| interest\_payments.product\_id | Id of spot product the interest payment is associated to. |
| interest\_payments.idx | Id of transaction that triggered the interest payment. |
| interest\_payments.timestamp | Timestamp of the transaction that triggered the interest payment. |
| interest\_payments.amount | Amount of interest paid multiplied by 10\*\*18. |
| interest\_payments.balance\_amount | Previous spot balance at the moment of payment (exclusive of payment amount) |
| interest\_payments.rate\_x18 | Spot interest rate at the moment of payment, multiplied by 10\*\*18. |
| interest\_payments.oracle\_price\_x18 | Oracle price for the spot product at the moment of payment, multiplied by 10\*\*18. |
| funding\_payments.product\_id | Id of perp product the funding payment is associated to. |
| funding\_payments.idx | Id of transaction that triggered the funding payment. |
| funding\_payments.timestamp | Timestamp of the transaction that triggered the funding payment. |
| funding\_payments.amount | Amount of funding paid multiplied by 10\*\*18. |
| funding\_payments.balance\_amount | Previous perp balance at the moment of payment +amount of perps locked in LPs (exclusive of payment amount). |
| funding\_payments.rate\_x18 | Perp funding rate at the moment of payment, multiplied by 10\*\*18. |
| funding\_payments.oracle\_price\_x18 | Oracle price for the perp product at the moment of payment, multiplied by 10\*\*18. |
| next\_idx | Id of the next payment snapshot. Use this as <mark style="color:red;">`max_idx`</mark> on a subsequent call to get the next page. This will be <mark style="color:red;">`null`</mark> when there are no more records. |
@@ -0,0 +1,74 @@
# Isolated Subaccounts
## Rate limits
* 1200 requests/min or 200 requests/10secs per IP address. (**weight = 2**)
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="List all isolated subaccounts" %}
Query all isolated subaccounts.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"isolated_subaccounts": {
"start_idx": 0,
"limit": 100
}
}
```
{% endtab %}
{% tab title="List isolated subaccounts for a subaccount" %}
Query isolated subaccounts associated with a specific subaccount.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"isolated_subaccounts": {
"subaccount": "0x79cc76364b5fb263a25bd52930e3d9788fcfeea864656661756c740000000000",
"limit": 100
}
}
```
{% endtab %}
{% endtabs %}
## Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="150" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">subaccount</td><td align="center">string</td><td align="center">No</td><td>Hex string of the parent subaccount to filter by.</td></tr><tr><td align="center">start_idx</td><td align="center">number / string</td><td align="center">No</td><td>Starting index for pagination. Defaults to 0.</td></tr><tr><td align="center">limit</td><td align="center">number</td><td align="center">No</td><td>Max number of isolated subaccounts to return. Defaults to <mark style="color:red;"><code>100</code></mark>. Max of <mark style="color:red;"><code>500</code></mark>.</td></tr></tbody></table>
## Response
```json
{
"isolated_subaccounts": [
{
"subaccount": "0x79cc76364b5fb263a25bd52930e3d9788fcfeea864656661756c740000000000",
"isolated_subaccount": "0x79cc76364b5fb263a25bd52930e3d9788fcfeea800000000000000010069736f",
"product_id": 1,
"created_at": "1683315718"
}
]
}
```
## Response Fields
### Isolated Subaccounts
<table><thead><tr><th width="263">Field name</th><th>Description</th></tr></thead><tbody><tr><td>subaccount</td><td>Hex string of the parent subaccount</td></tr><tr><td>isolated_subaccount</td><td>Hex string of the isolated margin subaccount</td></tr><tr><td>product_id</td><td>Product ID for which this isolated subaccount was created</td></tr><tr><td>created_at</td><td>Unix epoch time in seconds when the isolated subaccount was created</td></tr></tbody></table>
@@ -0,0 +1,52 @@
# Linked Signer Rate Limit
A subaccount can perform a max of 50 [LinkSigner](https://docs.nado.xyz/developer-resources/api/gateway/executes/link-signer) requests in 7 days. Use this query to check current usage and wait time.
## Rate limits
* 1200 requests/min or 200 requests/10secs per IP address. (**weight = 2**)
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="Link Signer Rate Limit" %}
Queries a subaccount's linked signer rate limits.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"linked_signer_rate_limit": {
"subaccount": "0x9b9989a4E0b260B84a5f367d636298a8bfFb7a9b42544353504f540000000000"
}
}
```
{% endtab %}
{% endtabs %}
## Response
```json
{
"remaining_tx": "50",
"wait_time": 0,
"signer": "0x0000000000000000000000000000000000000000",
"total_tx_limit": "50"
}
```
{% hint style="info" %}
**Notes**:
* <mark style="color:red;">`remaining_tx`</mark>: keeps track of the remaining <mark style="color:red;">`LinkSigner`</mark> executes that can be performed.
* <mark style="color:red;">`total_tx_limit`</mark>: that max weekly tx limit.
* <mark style="color:red;">`wait_time`</mark>: the total seconds you need to wait before performing another <mark style="color:red;">`LinkSigner`</mark> execute. Can only perform another request when <mark style="color:red;">`wait_time`</mark> is `0`.
* <mark style="color:red;">`signer`</mark>: the current linked signer address (20 bytes) associated to the provided `subaccount`. It returns the zero address when no signer is linked.
{% endhint %}
@@ -0,0 +1,55 @@
# Linked Signers
## Rate limits
* 1200 requests/min or 200 requests/10secs per IP address. (**weight = 2**)
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="List linked signers" %}
Query linked signers ordered by creation time.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"linked_signers": {
"start_idx": 0,
"limit": 100
}
}
```
{% endtab %}
{% endtabs %}
## Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="150" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">start_idx</td><td align="center">number / string</td><td align="center">No</td><td>Starting index for pagination. Defaults to 0.</td></tr><tr><td align="center">limit</td><td align="center">number</td><td align="center">No</td><td>Max number of linked signers to return. Defaults to <mark style="color:red;"><code>100</code></mark>. Max of <mark style="color:red;"><code>500</code></mark>.</td></tr></tbody></table>
## Response
```json
{
"linked_signers": [
{
"subaccount": "0x79cc76364b5fb263a25bd52930e3d9788fcfeea864656661756c740000000000",
"signer": "0x1234567890123456789012345678901234567890",
"created_at": "1683315718"
}
]
}
```
## Response Fields
### Linked Signers
<table><thead><tr><th width="263">Field name</th><th>Description</th></tr></thead><tbody><tr><td>subaccount</td><td>Hex string of the subaccount</td></tr><tr><td>signer</td><td>Hex string of the linked signer address</td></tr><tr><td>created_at</td><td>Unix epoch time in seconds when the signer was linked</td></tr></tbody></table>
@@ -0,0 +1,58 @@
# Liquidation Feed
## Rate limits
* 1200 requests/min or 200 requests/10secs per IP address. (**weight = 2**)
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="Liquidation feed" %}
Queries liquidatable accounts.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"liquidation_feed": {}
}
```
{% endtab %}
{% endtabs %}
## Response
```json
[
{
"subaccount": "0xf2b7cec33cac30582b94979bf03a3cbc73954b2c64656661756c740000000000",
"update_time": 1680118943
},
{
"subaccount": "0xcb6f1e2ece124a150dcc681c180df2a890432d6a64656661756c740000000000",
"update_time": 1680118943
},
{
"subaccount": "0x9e6e13be7ea2866c2c7c6e4a118a6c05eee6b44e64656661756c740000000000",
"update_time": 1680118943
},
{
"subaccount": "0x75008754ffae2889c055961c1b0c5c3ab743c59664656661756c740000000000",
"update_time": 1680118943
}
]
```
## Response Fields
| Field name | Description |
| ------------ | ------------------------------------ |
| subaccount | Subaccount eligible for liquidation. |
| update\_time | Last time feed was updated. |
@@ -0,0 +1,124 @@
# Market Snapshots
## Rate limits
* IP weight = <mark style="color:red;">`max((snapshot_count * product_ids.length / 100), 2)`</mark> where <mark style="color:red;">`snapshot_count = interval.count.min(500)`</mark>. If no <mark style="color:red;">`product_ids`</mark> are specified, <mark style="color:red;">`product_ids.length = 100`</mark>.
* E.g: With <mark style="color:red;">`product_ids=[1, 2, 3, 4]`</mark> and <mark style="color:red;">`interval.count=60`</mark>, weight = max((60 \* 4 / 100), 2) = 2, allowing up to 1200 requests per min or 200 requests/10 secs.
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
### Request
{% tabs %}
{% tab title="Market snapshots" %}
Query market snapshots ordered by <mark style="color:red;">`timestamp`</mark> desc.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"market_snapshots": {
"interval": {
"count": 2,
"granularity": 3600,
"max_time": 1691083697,
},
"product_ids": [1, 2]
}
}
```
{% endtab %}
{% endtabs %}
### Request Parameters
<table><thead><tr><th width="192" align="center">Parameter</th><th width="103" align="center">Type</th><th width="101" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">interval</td><td align="center">object</td><td align="center">Yes</td><td>Object to specify desired time period for data</td></tr><tr><td align="center">interval.count</td><td align="center">number</td><td align="center">Yes</td><td>Number of snapshots to return, limit 100. Also limited to <code>interval.count * # product_ids &#x3C; 2000</code></td></tr><tr><td align="center">interval.granularity</td><td align="center">number</td><td align="center">Yes</td><td>Granularity value in seconds</td></tr><tr><td align="center">interval.max_time</td><td align="center">number / string</td><td align="center">No</td><td>When providing <mark style="color:red;"><code>max_time</code></mark> (unix epoch in seconds), only return snapshots with timestamp &#x3C;= <mark style="color:red;"><code>max_time</code></mark>. If no value is entered, <code>max_time</code> defaults to the current time.</td></tr><tr><td align="center">product_ids</td><td align="center">number[]</td><td align="center">No</td><td>list of product ids to fetch snapshots for, defaults to all products</td></tr></tbody></table>
### Response
{% hint style="info" %}
**Note**: Please note that this endpoint is currently in beta stage. This feature might be subject to changes without prior notice.
{% endhint %}
```json
{
"snapshots": [
{
"timestamp": 1689965194,
"cumulative_users": 2774,
"daily_active_users": 251,
"cumulative_trades": {
"1": 54287,
"2": 172435
},
"cumulative_volumes": {
"1": "259549132367035103631071564",
"2": "1134008547778337985156988339"
},
"cumulative_trade_sizes": {
"1": "9209508999999999995173",
"2": "40246259000000000000000"
},
"cumulative_taker_fees": {
"1": "88916428908427788322799",
"2": "259205794197801680292645"
},
"cumulative_sequencer_fees": {
"1": "11038200000000000000000",
"2": "32353000000000000000000"
},
"cumulative_maker_fees": {
"1": "-12421730086012739050725",
"2": "-36124007075181485948604"
},
"cumulative_liquidation_amounts": {
"1": "848311398835000694508",
"2": "1013231566414935056343898"
},
"open_interests": {
"2": "2907581091676822842104781"
},
"total_deposits": {
"1": "37722308770940799414"
},
"total_borrows": {
"1": "1441397740941092000"
},
"funding_rates": {
"2": "3611102723387"
},
"deposit_rates": {
"1": "1001376785714"
},
"borrow_rates": {
"1": "32059880416879"
},
"cumulative_inflows": {
"1": "238791614019999999853",
"2": "0"
},
"cumulative_outflows": {
"1": "-202514202990000000306",
"2": "0"
},
"tvl": "7560079507311601381352742"
},
...
]
}
```
### Response Fields
#### Snapshots
{% hint style="info" %}
**Note**: For product specific fields (i.e. cumulative\_volume, open\_interests), the value is an object which maps product\_ids to their corresponding values.
{% endhint %}
<table><thead><tr><th width="260">Field name</th><th>Description</th></tr></thead><tbody><tr><td>timestamp</td><td>Timestamp of the snapshot. This may not be perfectly rounded to the granularity since it uses the nearest transaction timestamp less than or equal to <mark style="color:red;"><code>max_time</code></mark></td></tr><tr><td>cumulative_users</td><td>The cumulative number of subaccounts on Nado. It is updated daily at 9AM ET for historical counts. For current day counts, it is updated every hour.</td></tr><tr><td>daily_active_users</td><td>Daily active users count, updated daily at 9AM ET for historical counts. For current day counts, it is updated every hour.</td></tr><tr><td>cumulative_trades</td><td>A map of product_id -> the cumulative number of trades for the given product_id.</td></tr><tr><td>cumulative_volumes</td><td>A map of product_id -> cumulative volumes in USDT0 units.</td></tr><tr><td>cumulative_trade_sizes</td><td>A map of product_id -> cumulative trade sizes in base token</td></tr><tr><td>cumulative_taker_fees</td><td>A map of product_id -> cumulative taker fees. Taker fees include sequencer fees.</td></tr><tr><td>cumulative_sequencer_fees</td><td>A map of product_id -> cumulative sequencer fees.</td></tr><tr><td>cumulative_maker_fees</td><td>A map of product_id -> cumulative maker rebates.</td></tr><tr><td>cumulative_liquidation_amounts</td><td>A map of product_id -> cumulative liquidation amounts in USDT0 units.</td></tr><tr><td>open_interests</td><td>A map of product_id -> open interests in USDT0 units.</td></tr><tr><td>total_deposits</td><td>A map of product_id -> total deposits held by Nado for a given product at the given time in the base token units.</td></tr><tr><td>total_borrows</td><td>A map of product_id -> total borrows lent by Nado for a given product at the given time in the base token units.</td></tr><tr><td>funding_rates</td><td>A map of product_id -> <strong>hourly</strong> historical funding rates, value returned as <strong>decimal rates</strong> (% = rate * 100), derived from funding payment amounts. Requires a minimum granularity of 3600 to see non-zero funding rates. Use a granularity where granularity % 3600 = 0 for best results.</td></tr><tr><td>deposit_rates</td><td>A map of product_id -> <strong>daily</strong> deposit rates, values returned as <strong>decimal rates</strong> (% = rate * 100).</td></tr><tr><td>borrow_rates</td><td>A map of product_id -> <strong>daily</strong> borrow rates, values returned as <strong>decimal rates</strong> (% = rate * 100).</td></tr><tr><td>cumulative_inflows</td><td>A map of product_id -> cumulative inflows a.k.a deposits in base token units.</td></tr><tr><td>cumulative_outflows</td><td>A map of product_id -> cumulative outflows a.k.a withdraws in base token units.</td></tr><tr><td>tvl</td><td>The total value locked in USD.</td></tr></tbody></table>
@@ -0,0 +1,279 @@
# Matches
## Rate limits
* IP weight = <mark style="color:red;">`2 + (limit * subaccounts.length / 10)`</mark> where <mark style="color:red;">`limit`</mark> defaults to 100 (max 500) and <mark style="color:red;">`subaccounts.length`</mark> defaults to 1
* E.g: With <mark style="color:red;">`limit=100`</mark> and 1 subaccount, weight = 12, allowing up to 200 requests per min or 33 requests / 10 secs.
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="Matches by subaccount" %}
Query subaccounts matches ordered by <mark style="color:red;">`submission index`</mark> desc. Response includes order fill and fee information.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"matches": {
"product_ids": [
1,
2
],
"subaccounts": [
"0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c740000000000"
],
"max_time": 1679728762,
"limit": 5,
"isolated": false
}
}
```
{% endtab %}
{% tab title="Matches by product" %}
Query matches for provided products ordered by <mark style="color:red;">`submission index`</mark> desc. Response includes order fill and fee information.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"matches": {
"product_ids": [
1,
2
],
"max_time": "1679728762",
"limit": 5
}
}
```
{% endtab %}
{% endtabs %}
## Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="113" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">subaccounts</td><td align="center">string[]</td><td align="center">No</td><td>Array of <mark style="color:red;"><code>bytes32</code></mark> sent as hex strings; each includes the address and the subaccount identifier. When provided, only return matches for the specified subaccounts.</td></tr><tr><td align="center">product_ids</td><td align="center">number[]</td><td align="center">No</td><td>When provided, only return matches for the specified product ids; return matches for all products otherwise.</td></tr><tr><td align="center">idx</td><td align="center">number / string</td><td align="center">No</td><td>When provided, only return matches with <mark style="color:red;"><code>submission_idx</code></mark> &#x3C;= <mark style="color:red;"><code>idx</code></mark></td></tr><tr><td align="center">max_time</td><td align="center">number / string</td><td align="center">No</td><td>When <mark style="color:red;"><code>idx</code></mark> is not provided, <mark style="color:red;"><code>max_time</code></mark> (unix epoch in seconds) can be used to only return matches created &#x3C;= <mark style="color:red;"><code>max_time</code></mark></td></tr><tr><td align="center">limit</td><td align="center">number</td><td align="center">No</td><td>Max number of matches to return. defaults to <mark style="color:red;"><code>100</code></mark>. max possible of <mark style="color:red;"><code>500</code></mark>.</td></tr><tr><td align="center">isolated</td><td align="center">boolean</td><td align="center">No</td><td>When provided --<br>- <mark style="color:red;"><code>true</code></mark>: only returns matches associated to isolated positions.<br>- <mark style="color:red;"><code>false</code></mark>: only return matches associated to the cross-subaccount.<br>defaults to <mark style="color:red;"><code>null</code></mark>. In which case it returns everything.<br><br>See <a href="https://github.com/nadohq/nado-docs/blob/main/docs/basics/isolated-margin.md">Isolated Margin</a> to learn more.</td></tr></tbody></table>
## Response
{% hint style="info" %}
**Note:**
* the response includes a <mark style="color:red;">`txs`</mark> field which contains the relevant transactions for the returned matches. There are <mark style="color:red;">`>=1 match events`</mark> per transaction.
* both <mark style="color:red;">`matches`</mark> and <mark style="color:red;">`txs`</mark> are in descending order by <mark style="color:red;">`submission_idx`</mark>`.`
* use the <mark style="color:red;">`submission_idx`</mark> to associate a match to it's corresponding transaction.
* the <mark style="color:red;">`fee`</mark> provided in the response includes taker / maker fees + sequencer fees. See [fees](https://github.com/nadohq/nado-docs/blob/main/docs/basics/fees.md) for more details.
{% endhint %}
```json
{
"matches": [
{
"digest": "0x80ce789702b670b7d33f2aa67e12c85f124395c3f9acdb422dde3b4973ccd50c",
"order": {
"sender": "0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c740000000000",
"priceX18": "27544000000000000000000",
"amount": "2000000000000000000",
"expiration": "4611686020107119633",
"nonce": "1761322608857448448"
},
"base_filled": "736000000000000000",
"quote_filled": "-20276464287857571514302",
"fee": "4055287857571514302",
"sequencer_fee": "0",
"cumulative_fee": "4055287857571514302",
"cumulative_base_filled": "736000000000000000",
"cumulative_quote_filled": "-20276464287857571514302",
"submission_idx": "563012",
"isolated": false,
"is_taker": true,
"pre_balance": {
"base": {
"perp": {
"product_id": 2,
"balance": {
"amount": "2686684000000000000000",
"v_quote_balance": "-76348662407149297671587247",
"last_cumulative_funding_x18": "134999841911604906604576"
}
}
},
"quote": null
},
"post_balance": {
"base": {
"perp": {
"product_id": 2,
"balance": {
"amount": "2686013000000000000000",
"v_quote_balance": "-76328351274188497671587247",
"last_cumulative_funding_x18": "134999841911604906604576"
}
}
},
"quote": null
}
},
{
"digest": "0x0f6e5a0434e36d8e6d4fed950d3624b0d8c91a8a84efd156bb25c1382561c0c2",
"order": {
"sender": "0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c740000000000",
"priceX18": "27540000000000000000000",
"amount": "2000000000000000000",
"appendix": "1537",
"expiration": "4611686020107119623",
"nonce": "1761322602510417920"
},
"base_filled": "723999999999999999",
"quote_filled": "-19944943483044913474043",
"fee": "5983483044913474042",
"sequencer_fee": "0",
"cumulative_fee": "11958484645393618085",
"cumulative_base_filled": "1446999999999999998",
"cumulative_quote_filled": "-39861640484645393618087",
"submission_idx": "563011",
"isolated": false,
"is_taker": true,
"pre_balance": {
"base": {
"perp": {
"product_id": 2,
"balance": {
"amount": "2686684000000000000000",
"v_quote_balance": "-76348662407149297671587247",
"last_cumulative_funding_x18": "134999841911604906604576"
}
}
},
"quote": null
},
"post_balance": {
"base": {
"perp": {
"product_id": 2,
"balance": {
"amount": "2686013000000000000000",
"v_quote_balance": "-76328351274188497671587247",
"last_cumulative_funding_x18": "134999841911604906604576"
}
}
},
"quote": null
}
}
],
"txs": [
{
"tx": {
"match_orders": {
"product_id": 2,
"amm": true,
"taker": {
"order": {
"sender": "0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c740000000000",
"price_x18": "27544000000000000000000",
"amount": "2000000000000000000",
"expiration": 4611686020107120000,
"appendix": "1537",
"nonce": 1761322608857448400
},
"signature": "0xe8fa7151bde348afa3b46dc52798046b7c8318f1b0a7f689710debbc094658cc1bf5a7e478ccc8278b625da0b9402c86b580d2e31e13831337dfd6153f4b37811b"
},
"maker": {
"order": {
"sender": "0xebdbbcdbd2646c5f23a1e0806027eee5f71b074664656661756c740000000000",
"price_x18": "27544000000000000000000",
"amount": "-736000000000000000",
"expiration": 1679731669,
"appendix": "1537",
"nonce": 1761322585591644200
},
"signature": "0x47f9d47f0777f3ca0b13f07b7682dbeea098c0e377b87dcb025754fe34c900e336b8c7744e021fb9c46a4f8c6a1478bafa28bf0d023ae496aa3efa4d8e81df181c"
}
}
},
"submission_idx": "563012",
"timestamp": "1679728133"
},
{
"tx": {
"match_orders": {
"product_id": 1,
"amm": true,
"taker": {
"order": {
"sender": "0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c740000000000",
"price_x18": "27540000000000000000000",
"amount": "2000000000000000000",
"appendix": "1537",
"expiration": 4611686020107120000,
"nonce": 1761322602510418000
},
"signature": "0x826c68f1a3f76d9ffbe8041f8d45e969d31f1ab6f2ae2f6379d1493e479e56436091d6cf4c72e212dd2f1d2fa17c627c4c21bd6d281c77172b8af030488478b71c"
},
"maker": {
"order": {
"sender": "0xf8d240d9514c9a4715d66268d7af3b53d619642564656661756c740000000000",
"price_x18": "27540000000000000000000",
"amount": "-724000000000000000",
"appendix": "1537",
"expiration": 1679731656,
"nonce": 1761322565506171000
},
"signature": "0xd8b6505b8d9b8c3cbfe793080976388035682c02a27893fb26b48a5b2bfe943f4162dea3a42e24e0dff5e2f74fbf77e33d83619140a2a581117c55e6cc236bdb1c"
}
}
},
"submission_idx": "563011",
"timestamp": "1679728127"
}
]
}
```
## Response Fields
### Matches
| Field name | Description |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| submission\_idx | Wsed to uniquely identify the blockchain transaction that generated the match; you can use it to grab the relevant transaction in the `txs` section. |
| isolated | Whether the match is associated with an isolated position. `true` for isolated positions, `false` for cross-subaccount positions. |
| is\_taker | Whether the order in this match was the taker. `true` if the order was the taker, `false` if the order was the maker. |
| digest | The unique hash of the order. |
| order.sender | The sender that placed the order. |
| order.priceX18 | The original order price. |
| order.amount | The original order amount. |
| order.expiration | The original order expiration. |
| order.nonce | The original order nonce. |
| order.appendix | The original order appendix. |
| pre\_balance | The state of your balance before the match happened. |
| post\_balance | The state of your balance after the match happened. |
| base\_filled | The amount of base (e.g: BTC) filled on this match. |
| quote\_filled | The amount of quote (e.g: USDT0) filled on this match. |
| fee | The amount of trading fees + sequencer fees paid on this match. |
| sequencer\_fee | The amount of sequencer fees paid on this match. |
| cumulative\_base\_filled | The total amount of base (e.g: BTC) filled on this order up this match. |
| cumulative\_quote\_filled | The total amount of quote (e.g: USDT0) filled up to this match. |
| cumulative\_fee | The total amount of fee paid up to this match. |
### Txs
| Field name | Description |
| --------------- | ------------------------------------------------------------- |
| submission\_idx | Unique identifier of the transaction. |
| product\_id | Product associated to the transaction. |
| taker | The taker order. |
| maker | The maker order. |
| timestamp | The unix epoch in seconds of when the transaction took place. |
@@ -0,0 +1,60 @@
# NLP Funding Payments
## Rate limits
* 480 requests/min or 80 requests/10secs per IP address. (**weight = 5**)
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="NLP Funding Payments" %}
Query historical NLP funding payments.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"nlp_funding_payments": {
"max_idx": "1315836",
"max_time": "1683315718",
"limit": 100
}
}
```
{% endtab %}
{% endtabs %}
## Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="150" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">max_idx</td><td align="center">number / string</td><td align="center">No</td><td>When provided, only return payments with <mark style="color:red;"><code>idx</code></mark> &#x3C;= <mark style="color:red;"><code>max_idx</code></mark>.</td></tr><tr><td align="center">max_time</td><td align="center">number / string</td><td align="center">No</td><td>When provided, only return payments with <mark style="color:red;"><code>timestamp</code></mark> &#x3C;= <mark style="color:red;"><code>max_time</code></mark> (unix epoch in seconds).</td></tr><tr><td align="center">limit</td><td align="center">number</td><td align="center">No</td><td>Max number of payments to return. Defaults to <mark style="color:red;"><code>100</code></mark>. Max of <mark style="color:red;"><code>500</code></mark>.</td></tr></tbody></table>
## Response
```json
{
"funding_payments": [
{
"product_id": 2,
"idx": "5968022",
"timestamp": "1701698400",
"total_payment": "12273223338657163",
"rate_x18": "47928279191008320",
"oracle_price_x18": "2243215034242228224820"
}
],
"next_idx": "5968021"
}
```
## Response Fields
### Funding Payments
<table><thead><tr><th width="263">Field name</th><th>Description</th></tr></thead><tbody><tr><td>product_id</td><td>Id of the perp product</td></tr><tr><td>idx</td><td>Submission index of the transaction that triggered the payment</td></tr><tr><td>timestamp</td><td>Unix epoch time in seconds when the payment occurred</td></tr><tr><td>total_payment</td><td>Total funding payment amount (x18 format)</td></tr><tr><td>rate_x18</td><td>Funding rate used for calculation (x18 format)</td></tr><tr><td>oracle_price_x18</td><td>Oracle price at the time of payment (x18 format)</td></tr></tbody></table>
@@ -0,0 +1,59 @@
# NLP Interest Payments
## Rate limits
* 480 requests/min or 80 requests/10secs per IP address. (**weight = 5**)
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="NLP Interest Payments" %}
Query historical NLP interest payments.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"nlp_interest_payments": {
"max_idx": "1315836",
"max_time": "1683315718",
"limit": 100
}
}
```
{% endtab %}
{% endtabs %}
## Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="150" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">max_idx</td><td align="center">number / string</td><td align="center">No</td><td>When provided, only return payments with <mark style="color:red;"><code>idx</code></mark> &#x3C;= <mark style="color:red;"><code>max_idx</code></mark>.</td></tr><tr><td align="center">max_time</td><td align="center">number / string</td><td align="center">No</td><td>When provided, only return payments with <mark style="color:red;"><code>timestamp</code></mark> &#x3C;= <mark style="color:red;"><code>max_time</code></mark> (unix epoch in seconds).</td></tr><tr><td align="center">limit</td><td align="center">number</td><td align="center">No</td><td>Max number of payments to return. Defaults to <mark style="color:red;"><code>100</code></mark>. Max of <mark style="color:red;"><code>500</code></mark>.</td></tr></tbody></table>
## Response
```json
{
"interest_payments": [
{
"product_id": 0,
"idx": "5968022",
"timestamp": "1701698400",
"amount": "12273223338657163",
"balance_amount": "45382847293847329847"
}
],
"next_idx": "5968021"
}
```
## Response Fields
### Interest Payments
<table><thead><tr><th width="263">Field name</th><th>Description</th></tr></thead><tbody><tr><td>product_id</td><td>Id of the spot product (typically quote/collateral products)</td></tr><tr><td>idx</td><td>Submission index of the transaction that triggered the payment</td></tr><tr><td>timestamp</td><td>Unix epoch time in seconds when the payment occurred</td></tr><tr><td>amount</td><td>Interest payment amount (x18 format)</td></tr><tr><td>balance_amount</td><td>Balance amount at the time of payment (x18 format)</td></tr></tbody></table>
@@ -0,0 +1,82 @@
# NLP Snapshots
## Rate limits
* Dynamic based on snapshot count (**weight = (limit.min(500) / 100)**)
* E.g: With <mark style="color:red;">`limit=100`</mark>, weight = 1
* E.g: With <mark style="color:red;">`limit=500`</mark>, weight = 5
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="By interval" %}
Query NLP snapshots at specific time intervals.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"nlp_snapshots": {
"interval": {
"count": 10,
"max_time": "1683315718",
"granularity": 3600
}
}
}
```
{% endtab %}
{% tab title="By pagination" %}
Query NLP snapshots with pagination.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"nlp_snapshots": {
"idx": "12345",
"max_time": "1683315718",
"limit": 100
}
}
```
{% endtab %}
{% endtabs %}
## Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="150" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">interval</td><td align="center">object</td><td align="center">No</td><td>Object specifying time interval parameters: <mark style="color:red;"><code>count</code></mark>, <mark style="color:red;"><code>max_time</code></mark>, <mark style="color:red;"><code>granularity</code></mark></td></tr><tr><td align="center">idx</td><td align="center">number / string</td><td align="center">No</td><td>Submission index for pagination.</td></tr><tr><td align="center">max_time</td><td align="center">number / string</td><td align="center">No</td><td>Unix epoch time in seconds. Only return snapshots with timestamp &#x3C;= <mark style="color:red;"><code>max_time</code></mark></td></tr><tr><td align="center">limit</td><td align="center">number</td><td align="center">No</td><td>Max number of snapshots to return. Defaults to <mark style="color:red;"><code>100</code></mark>. Max of <mark style="color:red;"><code>500</code></mark>.</td></tr></tbody></table>
## Response
```json
{
"snapshots": [
{
"submission_idx": "12345",
"timestamp": "1683315718",
"total_deposits": "1000000000000000000000",
"total_borrows": "500000000000000000000",
"base_interest_rate": "50000000000000000",
"quote_interest_rate": "30000000000000000"
}
]
}
```
## Response Fields
### NLP Snapshots
<table><thead><tr><th width="263">Field name</th><th>Description</th></tr></thead><tbody><tr><td>submission_idx</td><td>Transaction submission index</td></tr><tr><td>timestamp</td><td>Unix epoch time in seconds when snapshot was taken</td></tr><tr><td>total_deposits</td><td>Total deposits in the NLP pool (x18 format)</td></tr><tr><td>total_borrows</td><td>Total borrows from the NLP pool (x18 format)</td></tr><tr><td>base_interest_rate</td><td>Interest rate for base assets (x18 format)</td></tr><tr><td>quote_interest_rate</td><td>Interest rate for quote assets (x18 format)</td></tr></tbody></table>
@@ -0,0 +1,70 @@
# Oracle Price
## Rate limits
* 1200 requests/min or 200 requests/10secs per IP address. (**weight = 2**)
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="Oracle Price" %} <mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"oracle_price": {
"product_ids": [1, 2, 3, 4]
}
}
```
{% endtab %}
{% endtabs %}
## Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="113" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">product_ids</td><td align="center">number[]</td><td align="center">Yes</td><td>Ids of products to fetch oracles price for.</td></tr></tbody></table>
## Response
```json
{
"prices": [
{
"product_id": 1,
"oracle_price_x18": "29464023750000000000000",
"update_time": "1683315718"
},
{
"product_id": 2,
"oracle_price_x18": "29430225194712740000000",
"update_time": "1683315721"
},
{
"product_id": 3,
"oracle_price_x18": "1983367400000000000000",
"update_time": "1683315720"
},
{
"product_id": 4,
"oracle_price_x18": "1981528989642697000000",
"update_time": "1683315721"
}
]
}
```
## Response Fields
### Prices
| Field name | Description |
| ------------------ | ------------------------------------------------------ |
| product\_id | Id of product oracle price corresponds to. |
| oracle\_price\_x18 | Latest oracle price multiplied by 10^18. |
| update\_time | Epoch in seconds the oracle price was last updated at. |
@@ -0,0 +1,67 @@
# Oracle Snapshots
## Rate limits
* IP weight = <mark style="color:red;">`max((snapshot_count * product_ids.length / 100), 2)`</mark> where <mark style="color:red;">`snapshot_count = interval.count.min(500)`</mark>. If no <mark style="color:red;">`product_ids`</mark> are specified, <mark style="color:red;">`product_ids.length = 100`</mark>.
* E.g: With <mark style="color:red;">`product_ids=[1, 2, 3, 4]`</mark> and <mark style="color:red;">`interval.count=60`</mark>, weight = max((60 \* 4 / 100), 2) = 2, allowing up to 1200 requests per min or 200 requests/10 secs.
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="Oracle Price" %}
Query oracle snapshots ordered by <mark style="color:red;">`timestamp`</mark> desc.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"oracle_snapshots": {
"interval": {
"count": 2,
"granularity": 3600,
"max_time": 1691083697,
},
"product_ids": [1, 2]
}
}
```
{% endtab %}
{% endtabs %}
### Request Parameters
<table><thead><tr><th width="192" align="center">Parameter</th><th width="103" align="center">Type</th><th width="101" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">interval</td><td align="center">object</td><td align="center">Yes</td><td>Object to specify desired time period for data</td></tr><tr><td align="center">interval.count</td><td align="center">number</td><td align="center">Yes</td><td>Number of snapshots to return, limit 100. Also limited to <code>interval.count * # product_ids &#x3C; 2000</code></td></tr><tr><td align="center">interval.granularity</td><td align="center">number</td><td align="center">Yes</td><td>Granularity value in seconds</td></tr><tr><td align="center">interval.max_time</td><td align="center">number / string</td><td align="center">No</td><td>When providing <mark style="color:red;"><code>max_time</code></mark> (unix epoch in seconds), only return snapshots with timestamp &#x3C;= <mark style="color:red;"><code>max_time</code></mark>. If no value is entered, <code>max_time</code> defaults to the current time.</td></tr><tr><td align="center">product_ids</td><td align="center">number[]</td><td align="center">No</td><td>list of product ids to fetch snapshots for, defaults to all products</td></tr></tbody></table>
## Response
{% hint style="info" %}
**Note**: Returns a map of <mark style="color:red;">`product_id -> oracle_price`</mark>
{% endhint %}
```json
{
"snapshots": [
{
"timestamp": 1750947789,
"oracle_prices": {
"1": "107070085854928675234384",
"2": "107142264360834928244199"
}
},
{
"timestamp": 1750946389,
"oracle_prices": {
"1": "106963557680819440289916",
"2": "106954360458642468300594"
}
}
]
}
```
@@ -0,0 +1,127 @@
# Orders
## Rate limits
* IP weight = <mark style="color:red;">`2 + (limit * subaccounts.length / 20)`</mark> where <mark style="color:red;">`limit`</mark> defaults to 100 (max 500) and <mark style="color:red;">`subaccounts.length`</mark> defaults to 1
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="Subaccount orders" %}
Query subaccounts <mark style="color:red;">`matched`</mark> orders, ordered by <mark style="color:red;">`submission index`</mark> desc.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"orders": {
"product_ids": [
1,
2
],
"subaccounts": [
"0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c740000000000"
],
"max_time": 1679728762,
"trigger_types": [
"price_trigger",
"time_trigger"
],
"isolated": false,
"limit": 5
}
}
```
{% endtab %}
{% tab title="Orders by digests" %}
Query orders by digests.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
<pre class="language-json"><code class="lang-json"><strong>{
</strong> "orders": {
"digests": [
"0xf4f7a8767faf0c7f72251a1f9e5da590f708fd9842bf8fcdeacbaa0237958fff",
"0x0495a88fb3b1c9bed9b643b8e264a391d04cdd48890d81cd7c4006473f28e361"
]
}
}
</code></pre>
{% endtab %}
{% endtabs %}
## Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="113" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">subaccounts</td><td align="center">string[]</td><td align="center">conditional</td><td>Array of <mark style="color:red;"><code>bytes32</code></mark> sent as hex strings; each includes the address and the subaccount identifier. Must be provided when querying by <mark style="color:red;"><code>subaccounts</code></mark><strong>.</strong></td></tr><tr><td align="center">product_ids</td><td align="center">number[]</td><td align="center">No</td><td>When provided, only return orders for the specified product ids; return orders for all products otherwise.</td></tr><tr><td align="center">idx</td><td align="center">number / string</td><td align="center">No</td><td>When provided, only return orders with <mark style="color:red;"><code>submission_idx</code></mark> &#x3C;= <mark style="color:red;"><code>idx</code></mark></td></tr><tr><td align="center">max_time</td><td align="center">number / string</td><td align="center">No</td><td>When <mark style="color:red;"><code>idx</code></mark> is not provided, <mark style="color:red;"><code>max_time</code></mark> (unix epoch in seconds) can be used to only return orders created &#x3C;= <mark style="color:red;"><code>max_time</code></mark></td></tr><tr><td align="center">digests</td><td align="center">string[]</td><td align="center">conditional</td><td>Must be provided when querying by <mark style="color:red;"><code>digests</code></mark>. only return orders matching the specified digests. <strong>note</strong>: cannot specify digests alongside with <mark style="color:red;"><code>subaccounts</code></mark> , <mark style="color:red;"><code>product_ids</code></mark> or <mark style="color:red;"><code>max_time</code></mark></td></tr><tr><td align="center">trigger_types</td><td align="center">string[]</td><td align="center">No</td><td>When provided, only return orders matching the specified trigger types. Possible values: <mark style="color:red;"><code>price_trigger</code></mark>, <mark style="color:red;"><code>time_trigger</code></mark>, <mark style="color:red;"><code>none</code></mark>. If not provided, returns orders of all trigger types.</td></tr><tr><td align="center">limit</td><td align="center">number</td><td align="center">No</td><td>Max number of orders to return. defaults to <mark style="color:red;"><code>100</code></mark>. max possible of <mark style="color:red;"><code>500</code></mark>. <strong>note</strong>: when querying by <mark style="color:red;"><code>digests</code></mark> limit must be &#x3C;= total digests provided</td></tr><tr><td align="center">isolated</td><td align="center">bool</td><td align="center">No</td><td><p>When provided --</p><ul><li><mark style="color:red;"><code>true</code></mark>: only returns orders associated to isolated positions.</li><li><mark style="color:red;"><code>false</code></mark>: only return matches associated to the cross-subaccount.</li></ul><p>defaults to <mark style="color:red;"><code>null</code></mark>. In which case it returns everything.</p><p>See <a href="https://github.com/nadohq/nado-docs/blob/main/docs/basics/isolated-margin.md">Isolated Margin</a> to learn more.</p></td></tr></tbody></table>
## Response
```json
{
"orders": [
{
"digest": "0xf4f7a8767faf0c7f72251a1f9e5da590f708fd9842bf8fcdeacbaa0237958fff",
"subaccount": "0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c740000000000",
"product_id": 1,
"submission_idx": "563024",
"last_fill_submission_idx": "563024",
"amount": "20000000000000000000",
"price_x18": "1751900000000000000000",
"base_filled": "2320000000000000000",
"quote_filled": "-4064898974794958991797",
"fee": "812974794958991797",
"expiration": "4611686020107120163",
"appendix": "1537",
"nonce": "1761323164913106944",
"isolated": false
},
{
"digest": "0x0495a88fb3b1c9bed9b643b8e264a391d04cdd48890d81cd7c4006473f28e361",
"subaccount": "0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c740000000000",
"product_id": 2,
"submission_idx": "563019",
"last_fill_submission_idx": "563019",
"amount": "-20000000000000000000",
"price_x18": "1750800000000000000000",
"base_filled": "-1159999999999999999",
"quote_filled": "2030293721599999999999",
"fee": "609278400000000000",
"expiration": "4611686020107119905",
"appendix": "1537",
"nonce": "1761322893628669952",
"isolated": false
},
{
"digest": "0x29078702ad95615f0040eafdccc85cbf92569bf9656be928f9f17c5ccbb52041",
"subaccount": "0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c740000000000",
"product_id": 2,
"submission_idx": "563018",
"last_fill_submission_idx": "563018",
"amount": "-20000000000000000000",
"price_x18": "1750700000000000000000",
"base_filled": "-1160000000000000000",
"quote_filled": "2030380837600000000000",
"fee": "406162400000000000",
"expiration": "4611686020107119880",
"appendix": "1537",
"nonce": "1761322865074896896",
"isolated": false
},
]
}
```
## Response Fields
<table><thead><tr><th width="307">Field name</th><th>Description</th></tr></thead><tbody><tr><td>digest</td><td>The unique hash of the order.</td></tr><tr><td>subaccount</td><td>The subaccount that placed the order.</td></tr><tr><td>product_id</td><td>The id of of the product the order was executed for.</td></tr><tr><td>submission_idx</td><td>Used to uniquely identify the blockchain transaction that generated the order. For multi-fills orders, this is the submission_idx of the first fill.</td></tr><tr><td>last_fill_submission_idx</td><td>For multi-fills orders, this is the submission_idx of the last fill. For single fill orders, it has the same value as <code>submission_idx</code>.</td></tr><tr><td>amount</td><td>The original amount of base to buy or sell.</td></tr><tr><td>price_x18</td><td>The original order price.</td></tr><tr><td>base_filled</td><td>The total amount of base (e.g: BTC) filled on this order.</td></tr><tr><td>quote_filled</td><td>The total amount of quote (e.g: USDT0) filled on this order.</td></tr><tr><td>fee</td><td>The total amount of fee paid on this order.</td></tr><tr><td>expiration</td><td>The original order expiration.</td></tr><tr><td>nonce</td><td>The original order nonce.</td></tr><tr><td>appendix</td><td>The original order appendix.</td></tr></tbody></table>
@@ -0,0 +1,94 @@
# Perp Prices
## Rate limits
* 1200 requests/min or 200 requests/10secs per IP address. (**weight = 2**)
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Single Product
### Request
{% tabs %}
{% tab title="Perp Prices" %} <mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"price": {
"product_id": 2
}
}
```
{% endtab %}
{% endtabs %}
### Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="113" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">product_id</td><td align="center">number</td><td align="center">Yes</td><td>Id of perp product to fetch prices for.</td></tr></tbody></table>
### Response
```json
{
"product_id": 2,
"index_price_x18": "28180063400000000000000",
"mark_price_x18": "28492853627394637978665",
"update_time": "1680734493"
}
```
## Multiple Products
### Request
{% tabs %}
{% tab title="Perp Prices" %} <mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"perp_prices": {
"product_ids": [2]
}
}
```
{% endtab %}
{% endtabs %}
### Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="113" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">product_ids</td><td align="center">number[]</td><td align="center">Yes</td><td>Ids of perp products to fetch prices for.</td></tr></tbody></table>
### Response
{% hint style="info" %}
**Note**: the response is a map of <mark style="color:red;">`product_id -> perp_prices`</mark> for each requested product.
{% endhint %}
```json
{
"2": {
"product_id": 2,
"index_price_x18": "31483202055051853950444",
"mark_price_x18": "31514830401018841708801",
"update_time": "1689281222"
}
}
```
## Response Fields
| Field name | Description |
| ----------------- | ------------------------------------------------------------ |
| product\_id | Id of the perp product. |
| index\_price\_x18 | Latest index price of the perp product, multiplied by 10^18. |
| mark\_price\_x18 | Latest mark price of the perp product, multiplied by 10^18. |
| update\_time | Epoch time in seconds the perp prices were last updated at. |
@@ -0,0 +1,228 @@
# Product Snapshots
## Rate limits
* 240 requests/min or 40 requests/10secs per IP address. (**weight = 10**)
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Single Product
### Request
{% tabs %}
{% tab title="Product snapshots" %}
Query snapshots for a given product ordered by <mark style="color:red;">`submission index`</mark> desc.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"products": {
"product_id": 2,
"max_time": 1679728762,
"limit": 1
}
}
```
{% endtab %}
{% endtabs %}
### Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="113" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">product_id</td><td align="center">number</td><td align="center">Yes</td><td>id of product to fetch snapshots for.</td></tr><tr><td align="center">idx</td><td align="center">number / string</td><td align="center">No</td><td>when provided, only return product snapshots with <mark style="color:red;"><code>submission_idx</code></mark> &#x3C;= <mark style="color:red;"><code>idx</code></mark></td></tr><tr><td align="center">max_time</td><td align="center">number / string</td><td align="center">No</td><td>when <mark style="color:red;"><code>idx</code></mark> is not provided, <mark style="color:red;"><code>max_time</code></mark> (unix epoch in seconds) can be used to only return snapshots created &#x3C;= <mark style="color:red;"><code>max_time</code></mark></td></tr><tr><td align="center">limit</td><td align="center">number</td><td align="center">No</td><td>max number of snapshots to return. defaults to <mark style="color:red;"><code>100</code></mark>. max possible of <mark style="color:red;"><code>500</code></mark>.</td></tr></tbody></table>
### Response
{% hint style="info" %}
**Note**:
* the response includes a <mark style="color:red;">`txs`</mark> field which contains the relevant transactions to the product snapshots. There are <mark style="color:red;">`>=1 product snapshots`</mark> per transaction.
* both <mark style="color:red;">`products`</mark> and <mark style="color:red;">`txs`</mark> are in descending order by <mark style="color:red;">`submission_idx`</mark>.
* use the <mark style="color:red;">`submission_idx`</mark> to associate a <mark style="color:red;">`product snapshot`</mark> to it's corresponding transaction.
{% endhint %}
```json
{
"products": [
{
"product_id": 1,
"submission_idx": "563014",
"product": {
"spot": {
"product_id": 1,
"oracle_price_x18": "115575316424148798147115",
"risk": {
"long_weight_initial_x18": "900000000000000000",
"short_weight_initial_x18": "1100000000000000000",
"long_weight_maintenance_x18": "950000000000000000",
"short_weight_maintenance_x18": "1050000000000000000",
"price_x18": "115575316424148798147115"
},
"config": {
"token": "0xc57c1c64561a37ac9e8f9039cb6deab7539d99fc",
"interest_inflection_util_x18": "800000000000000000",
"interest_floor_x18": "10000000000000000",
"interest_small_cap_x18": "40000000000000000",
"interest_large_cap_x18": "1000000000000000000",
"withdraw_fee_x18": "40000000000000",
"min_deposit_rate_x18": "0"
},
"state": {
"cumulative_deposits_multiplier_x18": "1000000000000318713",
"cumulative_borrows_multiplier_x18": "1000347390679880473",
"total_deposits_normalized": "9000399823280682696107190850",
"total_borrows_normalized": "9580268570661550719"
},
"book_info": {
"size_increment": "1000000000000000",
"price_increment_x18": "1000000000000000000",
"min_size": "4000000000000000",
"collected_fees": "0"
}
}
}
],
"txs": [
{
"tx": {
"update_price": {
"product_id": 3,
"price_x18": "1750710375000000000000"
}
},
"submission_idx": "563014",
"timestamp": "1679728271"
}
]
}
```
### Response Fields
#### Products
<table><thead><tr><th width="307">Field name</th><th>Description</th></tr></thead><tbody><tr><td>submission_idx</td><td>Used to uniquely identify the blockchain transaction that generated the product snapshot; you can use it to grab the relevant transaction in the <code>txs</code> section.</td></tr><tr><td>product_id</td><td>The id of of the product the event is associated with.</td></tr><tr><td>product</td><td>The state of the product at the time of the transaction.</td></tr></tbody></table>
#### Txs
| Field name | Description |
| --------------- | ------------------------------------------------------------- |
| submission\_idx | Unique identifier of the transaction. |
| tx | Raw data of the corresponding transaction |
| timestamp | The unix epoch in seconds of when the transaction took place. |
## Multiple Products
### Request
{% tabs %}
{% tab title="Multiple Products snapshots" %}
Query the latest snapshot for the provided products.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"product_snapshots": {
"product_ids": [1, 2],
"max_time": 1679728762
}
}
```
{% endtab %}
{% endtabs %}
### Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="113" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">product_ids</td><td align="center">number[]</td><td align="center">Yes</td><td>Ids of products to fetch snapshots for.</td></tr><tr><td align="center">max_time</td><td align="center">number / string</td><td align="center">No</td><td>When provided, returns the last snapshot created &#x3C;= <mark style="color:red;"><code>max_time</code></mark> for each product. Otherwise, the latest snapshot is returned.</td></tr></tbody></table>
### Response
{% hint style="info" %}
**Note**: the response is a map of <mark style="color:red;">`product_id -> snapshot`</mark> for each requested product.
{% endhint %}
```json
{
"1": {
"product_id": 1,
"submission_idx": "459743",
"product": {
"spot": {
"product_id": 1,
"oracle_price_x18": "115575316424148798147115",
"risk": {
"long_weight_initial_x18": "900000000000000000",
"short_weight_initial_x18": "1100000000000000000",
"long_weight_maintenance_x18": "950000000000000000",
"short_weight_maintenance_x18": "1050000000000000000",
"price_x18": "115575316424148798147115"
},
"config": {
"token": "0xc57c1c64561a37ac9e8f9039cb6deab7539d99fc",
"interest_inflection_util_x18": "800000000000000000",
"interest_floor_x18": "10000000000000000",
"interest_small_cap_x18": "40000000000000000",
"interest_large_cap_x18": "1000000000000000000",
"withdraw_fee_x18": "40000000000000",
"min_deposit_rate_x18": "0"
},
"state": {
"cumulative_deposits_multiplier_x18": "1000000000000318713",
"cumulative_borrows_multiplier_x18": "1000347390679880473",
"total_deposits_normalized": "9000399823280682696107190850",
"total_borrows_normalized": "9580268570661550719"
},
"book_info": {
"size_increment": "1000000000000000",
"price_increment_x18": "1000000000000000000",
"min_size": "4000000000000000",
"collected_fees": "0"
}
}
}
},
"2": {
"product_id": 2,
"submission_idx": "459842",
"product": {
"perp": {
"product_id": 2,
"oracle_price_x18": "115432187703236794231754",
"risk": {
"long_weight_initial_x18": "950000000000000000",
"short_weight_initial_x18": "1050000000000000000",
"long_weight_maintenance_x18": "970000000000000000",
"short_weight_maintenance_x18": "1030000000000000000",
"price_x18": "115432187703236794231754"
},
"state": {
"cumulative_funding_long_x18": "-394223711772447555304",
"cumulative_funding_short_x18": "-394223711772447555304",
"available_settle": "20092193239667417956947",
"open_interest": "113605000000000000000"
},
"book_info": {
"size_increment": "1000000000000000",
"price_increment_x18": "1000000000000000000",
"min_size": "4000000000000000",
"collected_fees": "0"
}
}
}
}
}
```
### Response Fields
<table><thead><tr><th width="307">Field name</th><th>Description</th></tr></thead><tbody><tr><td>submission_idx</td><td>Used to uniquely identify the blockchain transaction that generated the product snapshot.</td></tr><tr><td>product_id</td><td>The id of of the product the event is associated with.</td></tr><tr><td>product</td><td>The state of the product at the time of the transaction.</td></tr></tbody></table>
@@ -0,0 +1,33 @@
# Quote Price
## Rate limits
* 1200 requests/min or 200 requests/10secs per IP address. (**weight = 2**)
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="Get quote price" %} <mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"quote_price": {}
}
```
{% endtab %}
{% endtabs %}
## Response
```json
{
"price_x18": "999944870000000000"
}
```
@@ -0,0 +1,49 @@
# Sequencer Backlog
## Rate limits
* 2400 requests/min or 400 requests/10secs per IP address. (**weight = 1**)
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="Get sequencer backlog" %} <mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"backlog": {}
}
```
{% endtab %}
{% endtabs %}
## Response
```json
{
"total_txs": "45479039",
"total_submissions": "45478914",
"backlog_size": "125",
"updated_at": "1750365790",
"backlog_eta_in_seconds": "500",
"txs_per_second": "0.25"
}
```
### Response Fields
| Field name | Description |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| total\_txs | Total number of transactions stored in the indexer DB. |
| total\_submissions | Total number of transactions submitted on-chain. |
| backlog\_size | Number of unprocessed transactions (<mark style="color:red;">`total_txs - total_submissions`</mark>). |
| backlog\_eta\_in\_seconds | Estimated time in seconds (<mark style="color:red;">`float`</mark>) to clear the entire backlog (<mark style="color:red;">`null`</mark> if unavailable). |
| txs\_per\_second | Current submission rate in transactions per second (<mark style="color:red;">float</mark>) (<mark style="color:red;">`null`</mark> if unavailable). |
| updated\_at | UNIX timestamp (in seconds) of when the data was last updated. |
@@ -0,0 +1,60 @@
# Signatures
## Rate limits
* Dynamic based on <mark style="color:red;">`digests`</mark> param provided (**weight = 2 + len(digests) / 10**)
* E.g: With <mark style="color:red;">`digests=100`</mark>, you can make up to 200 requests per min or 33 requests / 10 secs.
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="Get order signatures by digests" %} <mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"signatures": {
"digests": [
"0xf4f7a8767faf0c7f72251a1f9e5da590f708fd9842bf8fcdeacbaa0237958fff",
"0x0495a88fb3b1c9bed9b643b8e264a391d04cdd48890d81cd7c4006473f28e361"
]
}
}
```
{% endtab %}
{% endtabs %}
## Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="113" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">digests</td><td align="center">string[]</td><td align="center">Yes</td><td>A list of order digests to retrieve signatures for.</td></tr></tbody></table>
## Response
```json
{
"signatures": [
{
"digest": "0xf4f7a8767faf0c7f72251a1f9e5da590f708fd9842bf8fcdeacbaa0237958fff",
"signature": "0xe8fa7151bde348afa3b46dc52798046b7c8318f1b0a7f689710debbc094658cc1bf5a7e478ccc8278b625da0b9402c86b580d2e31e13831337dfd6153f4b37811b",
"signer": "0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c740000000000",
"is_linked": false
},
{
"digest": "0x0495a88fb3b1c9bed9b643b8e264a391d04cdd48890d81cd7c4006473f28e361",
"signature": "0x826c68f1a3f76d9ffbe8041f8d45e969d31f1ab6f2ae2f6379d1493e479e56436091d6cf4c72e212dd2f1d2fa17c627c4c21bd6d281c77172b8af030488478b71c",
"signer": "0x44b525f7bf3441464e406a094bc5e791f13dd79f64656661756c740000000000",
"is_linked": true
},
]
}
```
## Response Fields
<table><thead><tr><th width="263">Field name</th><th>Description</th></tr></thead><tbody><tr><td>digest</td><td>The order's generated digest.</td></tr><tr><td>signature</td><td>The order's generated signature.</td></tr><tr><td>signer</td><td>The address that signed the order / generated the signature.</td></tr><tr><td>is_linked</td><td>Indicates whether this is a signature from a linked signer or the original sender.</td></tr></tbody></table>
@@ -0,0 +1,139 @@
# Subaccount Snapshots
Use this query to get a summary of the latest actions per product on Nado for provided subaccounts. Tracked variables (ex. net interest) are extrapolated to the timestamp or set of timestamps provided.
## Rate limits
* 480 requests/min or 80 requests/10secs per IP address. (**weight = 5**)
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="Subaccount snapshots" %}
Query latest subaccount events/actions ordered by <mark style="color:red;">`submission index`</mark> desc.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"account_snapshots": {
"subaccounts": [
"0xec132d41e542c7129268d9d4431f105e0830a81164656661756c745f31000000"
],
"timestamps": [
1738703761
],
"isolated": false,
"active": true
}
}
```
{% endtab %}
{% endtabs %}
## Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="113" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">subaccounts</td><td align="center">array</td><td align="center">Yes</td><td>A list of <mark style="color:red;"><code>bytes32</code></mark> sent as a hex string; includes the address and the subaccount identifier.</td></tr><tr><td align="center">timestamp</td><td align="center">array</td><td align="center">Yes</td><td>A list of timestamps to retrieve multiple subaccount snapshots (one per timestamp).</td></tr><tr><td align="center">isolated</td><td align="center">boolean</td><td align="center">No</td><td><p>A filter to include only isolated or cross margin events.</p><ul><li>If <mark style="color:red;"><code>true</code></mark>: returns only <strong>isolated</strong> margin events.</li><li>If <mark style="color:red;"><code>false</code></mark>: returns only <strong>cross</strong> margin events.</li><li>If omitted: returns <strong>both</strong> isolated and cross events.</li></ul></td></tr><tr><td align="center">active</td><td align="center">boolean</td><td align="center">No</td><td><p>Filters which products to include in the snapshot:</p><ul><li><mark style="color:red;"><code>true</code></mark>: returns only products with <strong>non-zero balance</strong> at the timestamp (currently active positions)</li><li><mark style="color:red;"><code>false</code></mark>: returns products with <strong>event history</strong> before the timestamp (any historical activity)</li><li>If omitted: defaults to <mark style="color:red;"><code>false</code></mark></li></ul></td></tr></tbody></table>
## Response
{% tabs %}
{% tab title="Single timestamp" %}
```json
{
"snapshots": {
"0xec132d41e542c7129268d9d4431f105e0830a81164656661756c745f31000000": {
"1738703761": [
{
"subaccount": "0xec132d41e542c7129268d9d4431f105e0830a81164656661756c745f31000000",
"product_id": 0,
"submission_idx": "17286676",
"event_type": "liquidate_subaccount",
"isolated": false,
"isolated_product_id": null,
"pre_balance": {
"spot": {
"product_id": 0,
"balance": {
"amount": "53278293456559329896"
}
}
},
"post_balance": {
"spot": {
"product_id": 0,
"balance": {
"amount": "0"
}
}
},
"product": {
"spot": {
"product_id": 0,
"oracle_price_x18": "1000000000000000000",
"risk": {
"long_weight_initial_x18": "1000000000000000000",
"short_weight_initial_x18": "1000000000000000000",
"long_weight_maintenance_x18": "1000000000000000000",
"short_weight_maintenance_x18": "1000000000000000000",
"price_x18": "1000000000000000000"
},
"config": {
"token": "0x5f65358d61a9a281ea3bb930d05889aca21e3f4f",
"interest_inflection_util_x18": "800000000000000000",
"interest_floor_x18": "10000000000000000",
"interest_small_cap_x18": "40000000000000000",
"interest_large_cap_x18": "1000000000000000000",
"withdraw_fee_x18": "1000000000000000000",
"min_deposit_rate_x18": "0"
},
"state": {
"cumulative_deposits_multiplier_x18": "1000000000025524653",
"cumulative_borrows_multiplier_x18": "1000347390837434279",
"total_deposits_normalized": "20001011744258817298755054194662",
"total_borrows_normalized": "1617724891363505323532211"
},
"book_info": {
"size_increment": "0",
"price_increment_x18": "0",
"min_size": "0",
"collected_fees": "0"
}
}
},
"net_interest_unrealized": "0",
"net_interest_cumulative": "1443761232166478119",
"net_funding_unrealized": "0",
"net_funding_cumulative": "0",
"net_entry_unrealized": "0",
"net_entry_cumulative": "13458165999999999998",
"quote_volume_cumulative": "1234567890123456789"
}
]
}
}
}
```
{% endtab %}
{% endtabs %}
## Response Fields
### Events
{% hint style="info" %}
* **Net cumulative**: the net difference in that quantity since the beginning of time. For example, if I want to compute total amount paid out in funding between two events, you can subtract the `net_funding_cumulative` of the larger event by the `net_funding_cumulative` of the smaller event.
* **Net unrealized**: similar to `net_cumulative`, but for `net_unrealized`, we have the caveat that when the magnitude of your position decreases, the magnitude of net\_unrealized `decreases` by the same amount.
{% endhint %}
<table><thead><tr><th width="307">Field name</th><th>Description</th></tr></thead><tbody><tr><td>submission_idx</td><td>Used to uniquely identify the blockchain transaction that generated the event; you can use it to grab the relevant transaction in the <code>txs</code> section.</td></tr><tr><td>product_id</td><td>The id of of the product the event is associated with.</td></tr><tr><td>event_type</td><td>Name of the transaction type this event corresponds to.</td></tr><tr><td>subaccount</td><td>The subaccount associated to the event.</td></tr><tr><td>pre_balance</td><td>The state of your balance before the event happened.</td></tr><tr><td>post_balance</td><td>The state of your balance after the event happened.</td></tr><tr><td>product</td><td>The state of the product throughout the event.</td></tr></tbody></table>
@@ -0,0 +1,91 @@
# Subaccounts
## Rate limits
* 1200 requests/min or 200 requests/10secs per IP address. (**weight = 2**)
{% hint style="info" %}
See more details in [API Rate limits](https://docs.nado.xyz/developer-resources/api/rate-limits)
{% endhint %}
## Request
{% tabs %}
{% tab title="List subaccounts" %}
Query subaccounts ordered by <mark style="color:red;">`subaccount id`</mark> ASC.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"subaccounts": {
"start": 100,
"limit": 10,
}
}
```
{% endtab %}
{% tab title="Find subaccounts by address" %}
Query all subaccounts associated to an address ordered by <mark style="color:red;">`subaccount id`</mark> ASC.
<mark style="color:orange;">`POST [ARCHIVE_ENDPOINT]`</mark>
**Body**
```json
{
"subaccounts": {
"address": "0x79CC76364b5Fb263A25bD52930E3d9788fCfEEA8"
}
}
```
{% endtab %}
{% endtabs %}
## Request Parameters
<table><thead><tr><th width="145" align="center">Parameter</th><th width="150" align="center">Type</th><th width="122" align="center">Required</th><th>Description</th></tr></thead><tbody><tr><td align="center">start</td><td align="center">string/number</td><td align="center">No</td><td>Subaccount id to start from (used for pagination). Defaults to 0.</td></tr><tr><td align="center">limit</td><td align="center">string/number</td><td align="center">No</td><td>Max number of subaccounts to return. Defaults to 100, max of 500.</td></tr><tr><td align="center">address</td><td align="center">string</td><td align="center">No</td><td>An optional wallet address to find all subaccounts associated to it.</td></tr></tbody></table>
## Response
```json
{
"subaccounts": [
{
"id": "25",
"subaccount": "0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c740000000000",
"address": "0x12a0b4888021576eb10a67616dd3dd3d9ce206b6",
"subaccount_name": "default",
"created_at": "1699949771",
"isolated": false
},
{
"id": "948",
"subaccount": "0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c745f31000000",
"address": "0x12a0b4888021576eb10a67616dd3dd3d9ce206b6",
"subaccount_name": "default_1",
"created_at": "1738000782",
"isolated": false
},
{
"id": "1094",
"subaccount": "0x12a0b4888021576eb10a67616dd3dd3d9ce206b600000000000000020069736f",
"address": "0x12a0b4888021576eb10a67616dd3dd3d9ce206b6",
"subaccount_name": "0x00000000000000020069736f",
"created_at": "1748982886",
"isolated": true
}
]
}
```
## Response Fields
### Subaccounts
<table><thead><tr><th width="263">Field name</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>Internal subaccount id</td></tr><tr><td>subaccount</td><td>Hex string of the subaccount (wallet + subaccount name)</td></tr><tr><td>address</td><td>Hex string of wallet address</td></tr><tr><td>subaccount_name</td><td>Subaccount identifier</td></tr><tr><td>created_at</td><td>When subaccount was created</td></tr><tr><td>isolated</td><td>Whether it's a subaccount for an isolated position</td></tr></tbody></table>