get trade history

API details

This API returns historical trading records of the market.

Get market trade history

get
Query parameters
MarketIdstringRequired
TradedAtStartinteger · int64Optional
TradedAtEndinteger · int64Optional
Limitinteger · int32Optional

maximum number of items to return. maximum value is 500.

Offsetinteger · int32Optional

number of items to skip before starting to collect the result set.

OrderBystringOptional

the sorting parameters for the list.

see https://learn.microsoft.com/en-us/azure/search/search-query-odata-orderby#examples for the format of the OrderBy string.

supported sorting parameters are: "TradedAt".

default sorting is by " TradedAt desc".

Responses
200
OK
get
GET /v1/market/trade HTTP/1.1
Host: testnetopenapi.hibit.app
Accept: */*
{
  "code": 1,
  "message": "text",
  "data": {
    "items": [
      {
        "maker": "text",
        "taker": "text",
        "takerSide": 1,
        "p": "text",
        "v": "text",
        "a": "text",
        "t": null
      }
    ],
    "totalCount": 1
  }
}

Code example

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

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

const depth = await hibitClient.getMarketDepth({
const trades = await hibitClient.getMarketTrade({
  marketId: 10006n,
  limit: 10,
  offset:0
});

SDK

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

Last updated