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={})
| 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 | """ |
no test coverage detected