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

Method fetch_markets

python/ccxt/hyperliquid.py:511–536  ·  view source on GitHub ↗

retrieves data on all markets for hyperliquid https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc https://hyperliquid.gitbook.io/hyperliquid-docs

(self, params={})

Source from the content-addressed store, hash-verified

509 return result
510
511 def fetch_markets(self, params={}) -> List[Market]:
512 """
513 retrieves data on all markets for hyperliquid
514
515 https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
516 https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
517
518 :param dict [params]: extra parameters specific to the exchange API endpoint
519 :returns dict[]: an array of objects representing market data
520 """
521 options = self.safe_dict(self.options, 'fetchMarkets', {})
522 types = self.safe_list(options, 'types', [])
523 rawPromises = []
524 for i in range(0, len(types)):
525 marketType = types[i]
526 if marketType == 'swap':
527 rawPromises.append(self.fetch_swap_markets(params))
528 elif marketType == 'spot':
529 rawPromises.append(self.fetch_spot_markets(params))
530 elif marketType == 'hip3':
531 rawPromises.append(self.fetch_hip3_markets(params))
532 promises = rawPromises
533 result = []
534 for i in range(0, len(promises)):
535 result = self.array_concat(result, promises[i])
536 return result
537
538 def fetch_hip3_markets(self, params={}) -> List[Market]:
539 """

Callers 1

fetch_tickersMethod · 0.95

Calls 8

fetch_swap_marketsMethod · 0.95
fetch_spot_marketsMethod · 0.95
fetch_hip3_marketsMethod · 0.95
safe_dictMethod · 0.80
safe_listMethod · 0.80
array_concatMethod · 0.80
rangeFunction · 0.50
appendMethod · 0.45

Tested by

no test coverage detected