MCPcopy Create free account
hub / github.com/ccxt/ccxt / fetch_markets

Method fetch_markets

python/ccxt/async_support/xt.py:986–1005  ·  view source on GitHub ↗

retrieves data on all markets for xt https://doc.xt.com/#market2symbol https://doc.xt.com/#futures_quotesgetSymbols :param dict params: extra parameters specific to the xt api endpoint :returns dict[]: an array of objects representing market data

(self, params={})

Source from the content-addressed store, hash-verified

984 return result
985
986 async def fetch_markets(self, params={}) -> List[Market]:
987 """
988 retrieves data on all markets for xt
989
990 https://doc.xt.com/#market2symbol
991 https://doc.xt.com/#futures_quotesgetSymbols
992
993 :param dict params: extra parameters specific to the xt api endpoint
994 :returns dict[]: an array of objects representing market data
995 """
996 if self.options['adjustForTimeDifference']:
997 await self.load_time_difference()
998 promisesUnresolved = [
999 self.fetch_spot_markets(params),
1000 self.fetch_swap_and_future_markets(params),
1001 ]
1002 promises = await asyncio.gather(*promisesUnresolved)
1003 spotMarkets = promises[0]
1004 swapAndFutureMarkets = promises[1]
1005 return self.array_concat(spotMarkets, swapAndFutureMarkets)
1006
1007 async def fetch_spot_markets(self, params={}):
1008 response = await self.publicSpotGetSymbol(params)

Callers 2

test_fetch_marketsFunction · 0.45
test_fetch_marketsFunction · 0.45

Calls 4

fetch_spot_marketsMethod · 0.95
array_concatMethod · 0.80
load_time_differenceMethod · 0.45

Tested by 2

test_fetch_marketsFunction · 0.36
test_fetch_marketsFunction · 0.36