Closed YuriyTigiev closed 2 years ago
At this moment, there is no unified codebase in CCXT that can return the spot/margin/futures markets (like:
exch.spot_markets_list
/exch.margin_markets_list
/exch.futures_markets_list
properties). [@kroitor do I miss anything?]
At this moment, you have to manually look into your desired exchange's loaded-markets and find out the specific custom flag (some of exchanges have i.e. marginable:true
flag into pair-properties, or something like that).
However, in the future this might get unified into CCXT, which might be obtainable using by smth like my mentioned functions (i.e. exch.spot_markets_list
).
Stay subscribed to this issue and whenever that is implemented, you will get notification.
@YuriyTigiev you can do that like this:
const ftx = new ccxt.ftx();
const kucoin = new ccxt.kucoin();
const binance = new ccxt.binance();
const binanceusdm = new ccxt.binanceusdm ();
// or const binanceusdm = new ccxt.binance({ 'options': { 'defaultType': 'future' }})
const binancecoinm = new ccxt.binancecoinm()
// or const binancecoinm = new ccxt.binance({ 'options': { 'defaultType': 'delivery' }})
const allMarkets = await Promise.all ([
ftx.loadMarkets (),
kucoin.loadMarkets (),
binance.loadMarkets (),
binanceusdm.loadMarkets (),
binancecoinm.loadMarkets ()
])
console.log (ftx.markets)
console.log (binance.markets)
console.log (binanceusdm.markets)
console.log (binancecoinm.markets)
// ...
Currently, Is it working? Because, I couldn't get the correct data seperately from python version of your script with ccxt.binance({ 'options': { 'defaultType': 'delivery' }})
Hello,
How to get a list of markets which support an Exchange and load a piece of market information only for the selected market? For example only for spot, margin, or future?