getOpenInterest method

Future<Map<String, dynamic>?> getOpenInterest({
  1. required String symbol,
  2. required String interval,
  3. int? limit,
})

Gets the total amount of unsettled contracts. In other words, the total number of contracts held in open positions.

period must be one of the followin strings : '5min', '15min', '30min', '1h', '4h', '1d' https://bybit-exchange.github.io/docs/inverse/#t-marketopeninterest

Implementation

Future<Map<String, dynamic>?> getOpenInterest(
    {required String symbol, required String interval, int? limit}) async {
  log.d('ByBitRest.getOpenInterest');
  var parameters = <String, dynamic>{};
  parameters['symbol'] = symbol;
  parameters['period'] = interval;
  if (limit != null) parameters['limit'] = limit;
  return await request(
      path: '/v2/public/open-interest', type: 'GET', parameters: parameters);
}