mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-10 08:48:07 +00:00
2.3 KiB
2.3 KiB
Market Liquidity
Rate limits
- 2400 requests/min or 40 requests/sec per IP address. (weight = 1)
{% hint style="info" %} See more details in API Rate limits {% endhint %}
Request
{% tabs %} {% tab title="Websocket" %} Connect
WEBSOCKET [GATEWAY_WEBSOCKET_ENDPOINT]
Message
{
"type": "market_liquidity",
"product_id": 1,
"depth": 10
}
{% endtab %}
{% tab title="REST (GET)" %} GET [GATEWAY_REST_ENDPOINT]/query?type=market_liquidity&product_id={product_id}&depth={depth}
{% endtab %}
{% tab title="REST (POST)" %} POST [GATEWAY_REST_ENDPOINT]/query
Body
{
"type": "market_liquidity",
"product_id": 1,
"depth": 10
}
{% endtab %} {% endtabs %}
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| product_id | number | Yes | Id of spot / perp product for which to retrieve market liquidity. |
| depth | number | Yes | Number of price levels to retrieve. (max: 100) |
Response
{
"status": "success",
"data": {
"bids": [
[
"30234000000000000000000",
"663000000000000000"
],
[
"30170000000000000000000",
"24623000000000000000"
]
],
"asks": [
[
"30245000000000000000000",
"664000000000000000"
],
[
"30252000000000000000000",
"4646000000000000000"
]
],
"timestamp": "1681850046966693400",
"product_id": 1
},
"request_type": "query_market_liquidity"
}
{% hint style="info" %} Note:
- Each entry inside bids and asks is an array of price and size respectively. Note: that price is represented using fixed point, so it is
1e18times greater than the decimal price. timestampis in nanoseconds. {% endhint %}