get depth

API details

This API returns market depth data, which is a combination of the orderbook and swap liquidity.

Get market depth

get

it is a combination of the orderbook and the swap liquidity.

Query parameters
Indexinteger · enumOptionalPossible values:
MarketIdstringOptional
Limitinteger · int32 · min: 1 · max: 100Optional
Responses
200
OK
get
GET /v1/market/depth HTTP/1.1
Host: testnetopenapi.hibit.app
Accept: */*
{
  "code": 1,
  "message": "text",
  "data": {
    "asks": [
      [
        "text"
      ]
    ],
    "bids": [
      [
        "text"
      ]
    ]
  }
}

Code example

import { hibitClient } from '@delandlabs/hibit-sdk';

const options = {
  network: HibitNetwork.Testnet
};
hibitClient.setOptions(options);

const marketId = 10008n;
const depth = await hibitClient.getMarketDepth({
  index: DepthIndex.L3,
  marketId: 10000n,
  limit: 10
});

SDK

Source code https://github.com/Deland-Labs/hibit-sdk

Last updated