Closed pier0074 closed 2 years ago
What was wrong with this answer?
There is nothing wrong with your answer. I just think there is inconsistency in the way markets and symbols are loaded when using options['defaultType']. As you pointed out, when you initialize ftx with the swap options, symbols return more than 800 symbols whereas -Perp (really swap symbols usable in ftx future) are less than 150. When loading ftx with options['defaultType']= 'swap', the markets and symbols array should be reduced to the ones that are actually future and tradable in ftx future (-perp one in the case of ftx). Ftx is not the only exchange where I think there is inconsistency between the exchange with parameters options['defaultType'] and array of symbols/markets returned.
There is nothing wrong with your answer. I just think there is inconsistency in the way markets and symbols are loaded when using options['defaultType']. As you pointed out, when you initialize ftx with the swap options, symbols return more than 800 symbols whereas -Perp (really swap symbols usable in ftx future) are less than 150. When loading ftx with options['defaultType']= 'swap', the markets and symbols array should be reduced to the ones that are actually future and tradable in ftx future (-perp one in the case of ftx). Ftx is not the only exchange where I think there is inconsistency between the exchange with parameters options['defaultType'] and array of symbols/markets returned.
ftx
uses one api endpoint to fetch every market available.
binance
uses a different endpoint for spot
/swap
/future
, and they use the same market ids for spot
/swap
(ADAUSDT
is used for ADA/USDT
and ADA/USDT:USDT
). marketId
returned from the exchange (ADAUSDT
) and then give you the unified symbol (ADA/USDT
or ADA/USDT:USDT
). defaultType
defaultType
isn't neededI'm going to close this issue, feel free to reopen it if you have any more questions
OS: linux Programming Language version: PHP 8.1 CCXT version: 1.92.48
Hello,
How do I get all future or swap symbols from a specific exchange. It seems to be working fine for binance but not for others. After reading a lot of issues and comments I did not find the exact answer to my question, closer one was this one.
When I instantiate a binance exchange like following, it limits markets and symbols to futureMarket.
However, when I do it to aax or ftx, there are all markets and symbols, exact as if I did not include [ 'options' => [ 'defaultType' => 'swap' ] ].
Both codes return all markets and symbols, include spot ones.
What is included in markets seems to be correct, as it includes the type, for example :
So I think, it would be interesting that load_markets and symbols object would be filtered by type based on 'defaultType'.