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