Files
ritmex-bot/docs/nado/developer-resources/api/gateway/queries/market-liquidity.md
T

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

ParameterTypeRequiredDescription
product_idnumberYesId of spot / perp product for which to retrieve market liquidity.
depthnumberYesNumber 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 1e18 times greater than the decimal price.
  • timestamp is in nanoseconds. {% endhint %}