Skip to content

Instantly share code, notes, and snippets.

@normanlmfung
Last active September 21, 2021 04:54
Show Gist options
  • Save normanlmfung/211fe6116117a04d5b5bca16ba43888f to your computer and use it in GitHub Desktop.
Save normanlmfung/211fe6116117a04d5b5bca16ba43888f to your computer and use it in GitHub Desktop.
ccxt.binance.load_markets retrieve perpetuals
import ccxt
from typing import Dict
class binanceperps(ccxt.binance):
def describe(self) -> Dict:
description = super().describe()
description["options"]["defaultType"] = "future"
return description
apiKey = 'lala'
secret = 'lala'
param = {
'apiKey' : apiKey,
'secret' : secret
}
exchange = binanceperps(param)
markets = exchange.load_markets()
print(markets["BTC/USDT"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment