1

I need to fetch funding rate history data from binance, but it only shows spot markets even when I type :

binance = ccxt.binance({'option': {'defaultType': 'future'}})

binance.fetch_markets()

How is it possible to fix?

Marco Polo
  • 21
  • 2
  • it's `options` not `option`, you can also use `binanceusdm` instead of `binance` – Sam Jun 13 '22 at 18:25

1 Answers1

1

Hope this helps:

import ccxt

exchange = ccxt.binance()

exchange.options = {'defaultType': 'future',
                    'adjustForTimeDifference': True}

symbol = 'BTC/USDT'
funding = exchange.fetchFundingRate(symbol)
print(funding)
Alex B
  • 1,092
  • 1
  • 14
  • 39