ccxt 4.4.29__py2.py3-none-any.whl → 4.4.31__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/alpaca.py +1 -0
  3. ccxt/abstract/binance.py +9 -0
  4. ccxt/abstract/binancecoinm.py +9 -0
  5. ccxt/abstract/binanceus.py +9 -0
  6. ccxt/abstract/binanceusdm.py +9 -0
  7. ccxt/ace.py +36 -12
  8. ccxt/alpaca.py +113 -28
  9. ccxt/ascendex.py +65 -30
  10. ccxt/async_support/__init__.py +1 -1
  11. ccxt/async_support/ace.py +36 -12
  12. ccxt/async_support/alpaca.py +113 -28
  13. ccxt/async_support/ascendex.py +65 -30
  14. ccxt/async_support/base/exchange.py +3 -3
  15. ccxt/async_support/bigone.py +71 -27
  16. ccxt/async_support/binance.py +564 -323
  17. ccxt/async_support/bingx.py +208 -108
  18. ccxt/async_support/bit2c.py +34 -12
  19. ccxt/async_support/bitbank.py +42 -14
  20. ccxt/async_support/bitbns.py +29 -21
  21. ccxt/async_support/bitfinex.py +77 -33
  22. ccxt/async_support/bitfinex2.py +116 -44
  23. ccxt/async_support/bitflyer.py +54 -18
  24. ccxt/async_support/bitget.py +277 -145
  25. ccxt/async_support/bithumb.py +39 -14
  26. ccxt/async_support/bitmart.py +198 -132
  27. ccxt/async_support/bitmex.py +90 -30
  28. ccxt/async_support/bitopro.py +66 -22
  29. ccxt/async_support/bitrue.py +109 -57
  30. ccxt/async_support/bitso.py +55 -19
  31. ccxt/async_support/bitstamp.py +84 -36
  32. ccxt/async_support/bitteam.py +51 -17
  33. ccxt/async_support/bitvavo.py +57 -19
  34. ccxt/async_support/bl3p.py +26 -10
  35. ccxt/async_support/blockchaincom.py +63 -21
  36. ccxt/async_support/blofin.py +95 -38
  37. ccxt/async_support/btcalpha.py +48 -16
  38. ccxt/async_support/btcbox.py +27 -9
  39. ccxt/async_support/btcmarkets.py +57 -19
  40. ccxt/async_support/btcturk.py +36 -12
  41. ccxt/async_support/bybit.py +251 -95
  42. ccxt/async_support/cex.py +65 -22
  43. ccxt/async_support/coinbase.py +138 -56
  44. ccxt/async_support/coinbaseexchange.py +76 -28
  45. ccxt/async_support/coinbaseinternational.py +75 -27
  46. ccxt/async_support/coincatch.py +191 -97
  47. ccxt/async_support/coincheck.py +33 -11
  48. ccxt/async_support/coinex.py +212 -101
  49. ccxt/async_support/coinlist.py +87 -30
  50. ccxt/async_support/coinmate.py +55 -24
  51. ccxt/async_support/coinmetro.py +52 -18
  52. ccxt/async_support/coinone.py +27 -10
  53. ccxt/async_support/coinsph.py +73 -27
  54. ccxt/async_support/coinspot.py +25 -9
  55. ccxt/async_support/cryptocom.py +103 -38
  56. ccxt/async_support/currencycom.py +70 -23
  57. ccxt/async_support/delta.py +90 -30
  58. ccxt/async_support/deribit.py +138 -53
  59. ccxt/async_support/digifinex.py +114 -51
  60. ccxt/async_support/exmo.py +104 -45
  61. ccxt/async_support/gate.py +298 -155
  62. ccxt/async_support/gemini.py +57 -20
  63. ccxt/async_support/hashkey.py +151 -66
  64. ccxt/async_support/hitbtc.py +156 -73
  65. ccxt/async_support/hollaex.py +76 -25
  66. ccxt/async_support/htx.py +297 -240
  67. ccxt/async_support/huobijp.py +1 -0
  68. ccxt/async_support/hyperliquid.py +203 -42
  69. ccxt/async_support/idex.py +73 -24
  70. ccxt/async_support/independentreserve.py +12 -5
  71. ccxt/async_support/indodax.py +53 -16
  72. ccxt/async_support/kraken.py +107 -35
  73. ccxt/async_support/krakenfutures.py +88 -34
  74. ccxt/async_support/kucoin.py +211 -109
  75. ccxt/async_support/kucoinfutures.py +119 -42
  76. ccxt/async_support/kuna.py +80 -39
  77. ccxt/async_support/latoken.py +70 -33
  78. ccxt/async_support/lbank.py +90 -39
  79. ccxt/async_support/luno.py +54 -19
  80. ccxt/async_support/lykke.py +54 -19
  81. ccxt/async_support/mercado.py +1 -0
  82. ccxt/async_support/mexc.py +226 -108
  83. ccxt/async_support/ndax.py +58 -19
  84. ccxt/async_support/novadax.py +67 -22
  85. ccxt/async_support/oceanex.py +58 -19
  86. ccxt/async_support/okcoin.py +81 -38
  87. ccxt/async_support/okx.py +270 -109
  88. ccxt/async_support/onetrading.py +3 -1
  89. ccxt/async_support/oxfun.py +95 -36
  90. ccxt/async_support/p2b.py +49 -23
  91. ccxt/async_support/paradex.py +75 -27
  92. ccxt/async_support/paymium.py +31 -11
  93. ccxt/async_support/phemex.py +91 -41
  94. ccxt/async_support/poloniex.py +80 -30
  95. ccxt/async_support/poloniexfutures.py +72 -30
  96. ccxt/async_support/probit.py +64 -22
  97. ccxt/async_support/timex.py +58 -19
  98. ccxt/async_support/tokocrypto.py +63 -22
  99. ccxt/async_support/tradeogre.py +7 -2
  100. ccxt/async_support/upbit.py +72 -25
  101. ccxt/async_support/vertex.py +74 -28
  102. ccxt/async_support/wavesexchange.py +29 -8
  103. ccxt/async_support/wazirx.py +51 -17
  104. ccxt/async_support/whitebit.py +105 -41
  105. ccxt/async_support/woo.py +162 -65
  106. ccxt/async_support/woofipro.py +118 -49
  107. ccxt/async_support/xt.py +150 -73
  108. ccxt/async_support/yobit.py +49 -16
  109. ccxt/async_support/zaif.py +30 -10
  110. ccxt/async_support/zonda.py +46 -16
  111. ccxt/base/exchange.py +34 -34
  112. ccxt/base/types.py +1 -0
  113. ccxt/bigone.py +71 -27
  114. ccxt/binance.py +564 -323
  115. ccxt/bingx.py +208 -108
  116. ccxt/bit2c.py +34 -12
  117. ccxt/bitbank.py +42 -14
  118. ccxt/bitbns.py +29 -21
  119. ccxt/bitfinex.py +77 -33
  120. ccxt/bitfinex2.py +116 -44
  121. ccxt/bitflyer.py +54 -18
  122. ccxt/bitget.py +277 -145
  123. ccxt/bithumb.py +39 -14
  124. ccxt/bitmart.py +198 -132
  125. ccxt/bitmex.py +90 -30
  126. ccxt/bitopro.py +66 -22
  127. ccxt/bitrue.py +109 -57
  128. ccxt/bitso.py +55 -19
  129. ccxt/bitstamp.py +84 -36
  130. ccxt/bitteam.py +51 -17
  131. ccxt/bitvavo.py +57 -19
  132. ccxt/bl3p.py +26 -10
  133. ccxt/blockchaincom.py +63 -21
  134. ccxt/blofin.py +95 -38
  135. ccxt/btcalpha.py +48 -16
  136. ccxt/btcbox.py +27 -9
  137. ccxt/btcmarkets.py +57 -19
  138. ccxt/btcturk.py +36 -12
  139. ccxt/bybit.py +251 -95
  140. ccxt/cex.py +65 -22
  141. ccxt/coinbase.py +138 -56
  142. ccxt/coinbaseexchange.py +76 -28
  143. ccxt/coinbaseinternational.py +75 -27
  144. ccxt/coincatch.py +191 -97
  145. ccxt/coincheck.py +33 -11
  146. ccxt/coinex.py +212 -101
  147. ccxt/coinlist.py +87 -30
  148. ccxt/coinmate.py +55 -24
  149. ccxt/coinmetro.py +52 -18
  150. ccxt/coinone.py +27 -10
  151. ccxt/coinsph.py +73 -27
  152. ccxt/coinspot.py +25 -9
  153. ccxt/cryptocom.py +103 -38
  154. ccxt/currencycom.py +70 -23
  155. ccxt/delta.py +90 -30
  156. ccxt/deribit.py +138 -53
  157. ccxt/digifinex.py +114 -51
  158. ccxt/exmo.py +104 -45
  159. ccxt/gate.py +298 -155
  160. ccxt/gemini.py +57 -20
  161. ccxt/hashkey.py +151 -66
  162. ccxt/hitbtc.py +156 -73
  163. ccxt/hollaex.py +76 -25
  164. ccxt/htx.py +297 -240
  165. ccxt/huobijp.py +1 -0
  166. ccxt/hyperliquid.py +203 -42
  167. ccxt/idex.py +73 -24
  168. ccxt/independentreserve.py +12 -5
  169. ccxt/indodax.py +53 -16
  170. ccxt/kraken.py +107 -35
  171. ccxt/krakenfutures.py +88 -34
  172. ccxt/kucoin.py +211 -109
  173. ccxt/kucoinfutures.py +119 -42
  174. ccxt/kuna.py +80 -39
  175. ccxt/latoken.py +70 -33
  176. ccxt/lbank.py +90 -39
  177. ccxt/luno.py +54 -19
  178. ccxt/lykke.py +54 -19
  179. ccxt/mercado.py +1 -0
  180. ccxt/mexc.py +226 -108
  181. ccxt/ndax.py +58 -19
  182. ccxt/novadax.py +67 -22
  183. ccxt/oceanex.py +58 -19
  184. ccxt/okcoin.py +81 -38
  185. ccxt/okx.py +270 -109
  186. ccxt/onetrading.py +3 -1
  187. ccxt/oxfun.py +95 -36
  188. ccxt/p2b.py +49 -23
  189. ccxt/paradex.py +75 -27
  190. ccxt/paymium.py +31 -11
  191. ccxt/phemex.py +91 -41
  192. ccxt/poloniex.py +80 -30
  193. ccxt/poloniexfutures.py +72 -30
  194. ccxt/pro/__init__.py +1 -1
  195. ccxt/pro/alpaca.py +15 -5
  196. ccxt/pro/ascendex.py +18 -6
  197. ccxt/pro/binance.py +200 -119
  198. ccxt/pro/bingx.py +44 -24
  199. ccxt/pro/bitfinex.py +13 -5
  200. ccxt/pro/bitget.py +75 -36
  201. ccxt/pro/bithumb.py +12 -4
  202. ccxt/pro/bitmart.py +44 -20
  203. ccxt/pro/bitmex.py +42 -14
  204. ccxt/pro/bitopro.py +15 -5
  205. ccxt/pro/bitrue.py +7 -3
  206. ccxt/pro/bitvavo.py +51 -17
  207. ccxt/pro/blockchaincom.py +18 -6
  208. ccxt/pro/blofin.py +38 -13
  209. ccxt/pro/bybit.py +100 -42
  210. ccxt/pro/cex.py +48 -16
  211. ccxt/pro/coinbase.py +32 -12
  212. ccxt/pro/coinbaseexchange.py +1 -1
  213. ccxt/pro/coinbaseinternational.py +34 -14
  214. ccxt/pro/coincatch.py +54 -19
  215. ccxt/pro/coincheck.py +6 -2
  216. ccxt/pro/coinex.py +40 -20
  217. ccxt/pro/coinone.py +9 -3
  218. ccxt/pro/cryptocom.py +70 -26
  219. ccxt/pro/deribit.py +36 -12
  220. ccxt/pro/exmo.py +10 -4
  221. ccxt/pro/gate.py +64 -30
  222. ccxt/pro/gemini.py +21 -7
  223. ccxt/pro/hashkey.py +26 -8
  224. ccxt/pro/hitbtc.py +61 -37
  225. ccxt/pro/hollaex.py +15 -5
  226. ccxt/pro/htx.py +39 -21
  227. ccxt/pro/hyperliquid.py +41 -14
  228. ccxt/pro/kraken.py +49 -17
  229. ccxt/pro/krakenfutures.py +47 -24
  230. ccxt/pro/kucoin.py +60 -31
  231. ccxt/pro/kucoinfutures.py +41 -19
  232. ccxt/pro/lbank.py +27 -9
  233. ccxt/pro/luno.py +3 -1
  234. ccxt/pro/mexc.py +35 -17
  235. ccxt/pro/ndax.py +12 -4
  236. ccxt/pro/okcoin.py +18 -6
  237. ccxt/pro/okx.py +76 -28
  238. ccxt/pro/onetrading.py +21 -7
  239. ccxt/pro/oxfun.py +54 -20
  240. ccxt/pro/p2b.py +23 -11
  241. ccxt/pro/paradex.py +12 -4
  242. ccxt/pro/phemex.py +31 -19
  243. ccxt/pro/poloniex.py +50 -22
  244. ccxt/pro/poloniexfutures.py +17 -7
  245. ccxt/pro/probit.py +18 -6
  246. ccxt/pro/upbit.py +25 -9
  247. ccxt/pro/vertex.py +20 -6
  248. ccxt/pro/wazirx.py +21 -7
  249. ccxt/pro/whitebit.py +25 -9
  250. ccxt/pro/woo.py +32 -12
  251. ccxt/pro/woofipro.py +35 -13
  252. ccxt/pro/xt.py +46 -26
  253. ccxt/probit.py +64 -22
  254. ccxt/test/tests_helpers.py +2 -2
  255. ccxt/timex.py +58 -19
  256. ccxt/tokocrypto.py +63 -22
  257. ccxt/tradeogre.py +7 -2
  258. ccxt/upbit.py +72 -25
  259. ccxt/vertex.py +74 -28
  260. ccxt/wavesexchange.py +29 -8
  261. ccxt/wazirx.py +51 -17
  262. ccxt/whitebit.py +105 -41
  263. ccxt/woo.py +162 -65
  264. ccxt/woofipro.py +118 -49
  265. ccxt/xt.py +150 -73
  266. ccxt/yobit.py +49 -16
  267. ccxt/zaif.py +30 -10
  268. ccxt/zonda.py +46 -16
  269. {ccxt-4.4.29.dist-info → ccxt-4.4.31.dist-info}/METADATA +5 -5
  270. {ccxt-4.4.29.dist-info → ccxt-4.4.31.dist-info}/RECORD +273 -273
  271. {ccxt-4.4.29.dist-info → ccxt-4.4.31.dist-info}/LICENSE.txt +0 -0
  272. {ccxt-4.4.29.dist-info → ccxt-4.4.31.dist-info}/WHEEL +0 -0
  273. {ccxt-4.4.29.dist-info → ccxt-4.4.31.dist-info}/top_level.txt +0 -0
ccxt/huobijp.py CHANGED
@@ -1117,6 +1117,7 @@ class huobijp(Exchange, ImplicitAPI):
1117
1117
  def fetch_order(self, id: str, symbol: Str = None, params={}):
1118
1118
  """
1119
1119
  fetches information on an order made by the user
1120
+ :param str id: order id
1120
1121
  :param str symbol: unified symbol of the market the order was made in
1121
1122
  :param dict [params]: extra parameters specific to the exchange API endpoint
1122
1123
  :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
ccxt/hyperliquid.py CHANGED
@@ -5,7 +5,8 @@
5
5
 
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.hyperliquid import ImplicitAPI
8
- from ccxt.base.types import Balances, Currencies, Currency, Int, LedgerEntry, MarginModification, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
8
+ import math
9
+ from ccxt.base.types import Balances, Currencies, Currency, Int, LedgerEntry, MarginModification, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, Transaction, TransferEntry
9
10
  from typing import List
10
11
  from ccxt.base.errors import ExchangeError
11
12
  from ccxt.base.errors import ArgumentsRequired
@@ -74,7 +75,7 @@ class hyperliquid(Exchange, ImplicitAPI):
74
75
  'fetchFundingHistory': False,
75
76
  'fetchFundingRate': False,
76
77
  'fetchFundingRateHistory': True,
77
- 'fetchFundingRates': False,
78
+ 'fetchFundingRates': True,
78
79
  'fetchIndexOHLCV': False,
79
80
  'fetchIsolatedBorrowRate': False,
80
81
  'fetchIsolatedBorrowRates': False,
@@ -130,12 +131,12 @@ class hyperliquid(Exchange, ImplicitAPI):
130
131
  '1h': '1h',
131
132
  '2h': '2h',
132
133
  '4h': '4h',
133
- '6h': '6h',
134
+ '8h': '8h',
134
135
  '12h': '12h',
135
136
  '1d': '1d',
136
137
  '3d': '3d',
137
138
  '1w': '1w',
138
- '1M': '1m',
139
+ '1M': '1M',
139
140
  },
140
141
  'hostname': 'hyperliquid.xyz',
141
142
  'urls': {
@@ -227,7 +228,9 @@ class hyperliquid(Exchange, ImplicitAPI):
227
228
  def fetch_currencies(self, params={}) -> Currencies:
228
229
  """
229
230
  fetches all available currencies on an exchange
230
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-metadata
231
+
232
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-metadata
233
+
231
234
  :param dict [params]: extra parameters specific to the exchange API endpoint
232
235
  :returns dict: an associative dictionary of currencies
233
236
  """
@@ -283,8 +286,10 @@ class hyperliquid(Exchange, ImplicitAPI):
283
286
  def fetch_markets(self, params={}) -> List[Market]:
284
287
  """
285
288
  retrieves data on all markets for hyperliquid
286
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
287
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
289
+
290
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
291
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
292
+
288
293
  :param dict [params]: extra parameters specific to the exchange API endpoint
289
294
  :returns dict[]: an array of objects representing market data
290
295
  """
@@ -300,7 +305,9 @@ class hyperliquid(Exchange, ImplicitAPI):
300
305
  def fetch_swap_markets(self, params={}) -> List[Market]:
301
306
  """
302
307
  retrieves data on all swap markets for hyperliquid
303
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
308
+
309
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
310
+
304
311
  :param dict [params]: extra parameters specific to the exchange API endpoint
305
312
  :returns dict[]: an array of objects representing market data
306
313
  """
@@ -355,7 +362,9 @@ class hyperliquid(Exchange, ImplicitAPI):
355
362
  def fetch_spot_markets(self, params={}) -> List[Market]:
356
363
  """
357
364
  retrieves data on all spot markets for hyperliquid
358
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
365
+
366
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
367
+
359
368
  :param dict [params]: extra parameters specific to the exchange API endpoint
360
369
  :returns dict[]: an array of objects representing market data
361
370
  """
@@ -414,7 +423,8 @@ class hyperliquid(Exchange, ImplicitAPI):
414
423
  markets = []
415
424
  for i in range(0, len(meta)):
416
425
  market = self.safe_dict(meta, i, {})
417
- extraData = self.safe_dict(second, i, {})
426
+ index = self.safe_integer(market, 'index')
427
+ extraData = self.safe_dict(second, index, {})
418
428
  marketName = self.safe_string(market, 'name')
419
429
  # if marketName.find('/') < 0:
420
430
  # # there are some weird spot markets in testnet, eg @2
@@ -587,8 +597,10 @@ class hyperliquid(Exchange, ImplicitAPI):
587
597
  def fetch_balance(self, params={}) -> Balances:
588
598
  """
589
599
  query for balance and get the amount of funds available for trading or funds locked in orders
590
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-a-users-token-balances
591
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
600
+
601
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-a-users-token-balances
602
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
603
+
592
604
  :param dict [params]: extra parameters specific to the exchange API endpoint
593
605
  :param str [params.user]: user address, will default to self.walletAddress if not provided
594
606
  :param str [params.type]: wallet type, ['spot', 'swap'], defaults to swap
@@ -669,7 +681,9 @@ class hyperliquid(Exchange, ImplicitAPI):
669
681
  def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
670
682
  """
671
683
  fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
672
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#l2-book-snapshot
684
+
685
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#l2-book-snapshot
686
+
673
687
  :param str symbol: unified symbol of the market to fetch the order book for
674
688
  :param int [limit]: the maximum amount of order book entries to return
675
689
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -715,8 +729,10 @@ class hyperliquid(Exchange, ImplicitAPI):
715
729
  def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
716
730
  """
717
731
  fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
718
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
719
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
732
+
733
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
734
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
735
+
720
736
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
721
737
  :param dict [params]: extra parameters specific to the exchange API endpoint
722
738
  :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
@@ -735,6 +751,113 @@ class hyperliquid(Exchange, ImplicitAPI):
735
751
  result[symbol] = ticker
736
752
  return self.filter_by_array_tickers(result, 'symbol', symbols)
737
753
 
754
+ def fetch_funding_rates(self, symbols: Strings = None, params={}) -> FundingRates:
755
+ """
756
+ retrieves data on all swap markets for hyperliquid
757
+
758
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
759
+
760
+ :param str[] [symbols]: list of unified market symbols
761
+ :param dict [params]: extra parameters specific to the exchange API endpoint
762
+ :returns dict[]: an array of objects representing market data
763
+ """
764
+ request: dict = {
765
+ 'type': 'metaAndAssetCtxs',
766
+ }
767
+ response = self.publicPostInfo(self.extend(request, params))
768
+ #
769
+ # [
770
+ # {
771
+ # "universe": [
772
+ # {
773
+ # "maxLeverage": 50,
774
+ # "name": "SOL",
775
+ # "onlyIsolated": False,
776
+ # "szDecimals": 2
777
+ # }
778
+ # ]
779
+ # },
780
+ # [
781
+ # {
782
+ # "dayNtlVlm": "9450588.2273",
783
+ # "funding": "0.0000198",
784
+ # "impactPxs": [
785
+ # "108.04",
786
+ # "108.06"
787
+ # ],
788
+ # "markPx": "108.04",
789
+ # "midPx": "108.05",
790
+ # "openInterest": "10764.48",
791
+ # "oraclePx": "107.99",
792
+ # "premium": "0.00055561",
793
+ # "prevDayPx": "111.81"
794
+ # }
795
+ # ]
796
+ # ]
797
+ #
798
+ #
799
+ meta = self.safe_dict(response, 0, {})
800
+ universe = self.safe_list(meta, 'universe', [])
801
+ assetCtxs = self.safe_list(response, 1, [])
802
+ result = []
803
+ for i in range(0, len(universe)):
804
+ data = self.extend(
805
+ self.safe_dict(universe, i, {}),
806
+ self.safe_dict(assetCtxs, i, {})
807
+ )
808
+ result.append(data)
809
+ funding_rates = self.parse_funding_rates(result)
810
+ return self.filter_by_array(funding_rates, 'symbol', symbols)
811
+
812
+ def parse_funding_rate(self, info, market: Market = None) -> FundingRate:
813
+ #
814
+ # {
815
+ # "maxLeverage": "50",
816
+ # "name": "ETH",
817
+ # "onlyIsolated": False,
818
+ # "szDecimals": "4",
819
+ # "dayNtlVlm": "1709813.11535",
820
+ # "funding": "0.00004807",
821
+ # "impactPxs": [
822
+ # "2369.3",
823
+ # "2369.6"
824
+ # ],
825
+ # "markPx": "2369.6",
826
+ # "midPx": "2369.45",
827
+ # "openInterest": "1815.4712",
828
+ # "oraclePx": "2367.3",
829
+ # "premium": "0.00090821",
830
+ # "prevDayPx": "2381.5"
831
+ # }
832
+ #
833
+ base = self.safe_string(info, 'name')
834
+ marketId = self.coin_to_market_id(base)
835
+ symbol = self.safe_symbol(marketId, market)
836
+ funding = self.safe_number(info, 'funding')
837
+ markPx = self.safe_number(info, 'markPx')
838
+ oraclePx = self.safe_number(info, 'oraclePx')
839
+ fundingTimestamp = (int(math.floor(self.milliseconds()) / 60 / 60 / 1000) + 1) * 60 * 60 * 1000
840
+ return {
841
+ 'info': info,
842
+ 'symbol': symbol,
843
+ 'markPrice': markPx,
844
+ 'indexPrice': oraclePx,
845
+ 'interestRate': None,
846
+ 'estimatedSettlePrice': None,
847
+ 'timestamp': None,
848
+ 'datetime': None,
849
+ 'fundingRate': funding,
850
+ 'fundingTimestamp': fundingTimestamp,
851
+ 'fundingDatetime': self.iso8601(fundingTimestamp),
852
+ 'nextFundingRate': None,
853
+ 'nextFundingTimestamp': None,
854
+ 'nextFundingDatetime': None,
855
+ 'previousFundingRate': None,
856
+ 'previousFundingTimestamp': None,
857
+ 'previousFundingDatetime': None,
858
+ 'interval': '1h',
859
+ }
860
+
738
861
  def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
739
862
  #
740
863
  # {
@@ -767,7 +890,9 @@ class hyperliquid(Exchange, ImplicitAPI):
767
890
  def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
768
891
  """
769
892
  fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
770
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#candle-snapshot
893
+
894
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#candle-snapshot
895
+
771
896
  :param str symbol: unified symbol of the market to fetch OHLCV data for
772
897
  :param str timeframe: the length of time each candle represents, support '1m', '15m', '1h', '1d'
773
898
  :param int [since]: timestamp in ms of the earliest candle to fetch
@@ -794,7 +919,7 @@ class hyperliquid(Exchange, ImplicitAPI):
794
919
  'type': 'candleSnapshot',
795
920
  'req': {
796
921
  'coin': market['base'] if market['swap'] else market['id'],
797
- 'interval': timeframe,
922
+ 'interval': self.safe_string(self.timeframes, timeframe, timeframe),
798
923
  'startTime': since,
799
924
  'endTime': until,
800
925
  },
@@ -845,8 +970,10 @@ class hyperliquid(Exchange, ImplicitAPI):
845
970
  def fetch_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
846
971
  """
847
972
  get the list of most recent trades for a particular symbol
848
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills
849
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills-by-time
973
+
974
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills
975
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills-by-time
976
+
850
977
  :param str symbol: unified market symbol
851
978
  :param int [since]: the earliest time in ms to fetch trades for
852
979
  :param int [limit]: the maximum number of trades structures to retrieve
@@ -1021,7 +1148,9 @@ class hyperliquid(Exchange, ImplicitAPI):
1021
1148
  def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
1022
1149
  """
1023
1150
  create a trade order
1024
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
1151
+
1152
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
1153
+
1025
1154
  :param str symbol: unified symbol of the market to create an order in
1026
1155
  :param str type: 'market' or 'limit'
1027
1156
  :param str side: 'buy' or 'sell'
@@ -1045,8 +1174,11 @@ class hyperliquid(Exchange, ImplicitAPI):
1045
1174
  def create_orders(self, orders: List[OrderRequest], params={}):
1046
1175
  """
1047
1176
  create a list of trade orders
1048
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
1177
+
1178
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
1179
+
1049
1180
  :param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
1181
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1050
1182
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1051
1183
  """
1052
1184
  self.load_markets()
@@ -1077,7 +1209,7 @@ class hyperliquid(Exchange, ImplicitAPI):
1077
1209
  def create_orders_request(self, orders, params={}) -> dict:
1078
1210
  """
1079
1211
  create a list of trade orders
1080
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
1212
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
1081
1213
  :param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
1082
1214
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1083
1215
  """
@@ -1189,8 +1321,10 @@ class hyperliquid(Exchange, ImplicitAPI):
1189
1321
  def cancel_order(self, id: str, symbol: Str = None, params={}):
1190
1322
  """
1191
1323
  cancels an open order
1192
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
1193
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
1324
+
1325
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
1326
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
1327
+
1194
1328
  :param str id: order id
1195
1329
  :param str symbol: unified symbol of the market the order was made in
1196
1330
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -1204,8 +1338,10 @@ class hyperliquid(Exchange, ImplicitAPI):
1204
1338
  def cancel_orders(self, ids: List[str], symbol: Str = None, params={}):
1205
1339
  """
1206
1340
  cancel multiple orders
1207
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
1208
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
1341
+
1342
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
1343
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
1344
+
1209
1345
  :param str[] ids: order ids
1210
1346
  :param str [symbol]: unified market symbol
1211
1347
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -1284,8 +1420,10 @@ class hyperliquid(Exchange, ImplicitAPI):
1284
1420
  def cancel_orders_for_symbols(self, orders: List[CancellationRequest], params={}):
1285
1421
  """
1286
1422
  cancel multiple orders for multiple symbols
1287
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
1288
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
1423
+
1424
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
1425
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
1426
+
1289
1427
  :param CancellationRequest[] orders: each order should contain the parameters required by cancelOrder namely id and symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
1290
1428
  :param dict [params]: extra parameters specific to the exchange API endpoint
1291
1429
  :param str [params.vaultAddress]: the vault address
@@ -1468,8 +1606,10 @@ class hyperliquid(Exchange, ImplicitAPI):
1468
1606
  def edit_order(self, id: str, symbol: str, type: str, side: str, amount: Num = None, price: Num = None, params={}):
1469
1607
  """
1470
1608
  edit a trade order
1471
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-an-order
1472
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders
1609
+
1610
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-an-order
1611
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders
1612
+
1473
1613
  :param str id: cancel order id
1474
1614
  :param str symbol: unified symbol of the market to create an order in
1475
1615
  :param str type: 'market' or 'limit'
@@ -1533,7 +1673,9 @@ class hyperliquid(Exchange, ImplicitAPI):
1533
1673
  def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
1534
1674
  """
1535
1675
  fetches historical funding rate prices
1536
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-historical-funding-rates
1676
+
1677
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-historical-funding-rates
1678
+
1537
1679
  :param str symbol: unified symbol of the market to fetch the funding rate history for
1538
1680
  :param int [since]: timestamp in ms of the earliest funding rate to fetch
1539
1681
  :param int [limit]: the maximum amount of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>` to fetch
@@ -1584,7 +1726,9 @@ class hyperliquid(Exchange, ImplicitAPI):
1584
1726
  def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1585
1727
  """
1586
1728
  fetch all unfilled currently open orders
1587
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-open-orders
1729
+
1730
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-open-orders
1731
+
1588
1732
  :param str symbol: unified market symbol
1589
1733
  :param int [since]: the earliest time in ms to fetch open orders for
1590
1734
  :param int [limit]: the maximum number of open orders structures to retrieve
@@ -1708,7 +1852,10 @@ class hyperliquid(Exchange, ImplicitAPI):
1708
1852
  def fetch_order(self, id: str, symbol: Str = None, params={}):
1709
1853
  """
1710
1854
  fetches information on an order made by the user
1711
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-order-status-by-oid-or-cloid
1855
+
1856
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-order-status-by-oid-or-cloid
1857
+
1858
+ :param str id: order id
1712
1859
  :param str symbol: unified symbol of the market the order was made in
1713
1860
  :param dict [params]: extra parameters specific to the exchange API endpoint
1714
1861
  :param str [params.user]: user address, will default to self.walletAddress if not provided
@@ -1914,8 +2061,10 @@ class hyperliquid(Exchange, ImplicitAPI):
1914
2061
  def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
1915
2062
  """
1916
2063
  fetch all trades made by the user
1917
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills
1918
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills-by-time
2064
+
2065
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills
2066
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills-by-time
2067
+
1919
2068
  :param str symbol: unified market symbol
1920
2069
  :param int [since]: the earliest time in ms to fetch trades for
1921
2070
  :param int [limit]: the maximum number of trades structures to retrieve
@@ -2017,7 +2166,9 @@ class hyperliquid(Exchange, ImplicitAPI):
2017
2166
  def fetch_position(self, symbol: str, params={}):
2018
2167
  """
2019
2168
  fetch data on an open position
2020
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
2169
+
2170
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
2171
+
2021
2172
  :param str symbol: unified market symbol of the market the position is held in
2022
2173
  :param dict [params]: extra parameters specific to the exchange API endpoint
2023
2174
  :param str [params.user]: user address, will default to self.walletAddress if not provided
@@ -2029,7 +2180,9 @@ class hyperliquid(Exchange, ImplicitAPI):
2029
2180
  def fetch_positions(self, symbols: Strings = None, params={}):
2030
2181
  """
2031
2182
  fetch all open positions
2032
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
2183
+
2184
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
2185
+
2033
2186
  :param str[] [symbols]: list of unified market symbols
2034
2187
  :param dict [params]: extra parameters specific to the exchange API endpoint
2035
2188
  :param str [params.user]: user address, will default to self.walletAddress if not provided
@@ -2266,7 +2419,9 @@ class hyperliquid(Exchange, ImplicitAPI):
2266
2419
  def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
2267
2420
  """
2268
2421
  add margin
2269
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-isolated-margin
2422
+
2423
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-isolated-margin
2424
+
2270
2425
  :param str symbol: unified market symbol
2271
2426
  :param float amount: amount of margin to add
2272
2427
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -2276,7 +2431,9 @@ class hyperliquid(Exchange, ImplicitAPI):
2276
2431
 
2277
2432
  def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
2278
2433
  """
2279
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-isolated-margin
2434
+
2435
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-isolated-margin
2436
+
2280
2437
  remove margin from a position
2281
2438
  :param str symbol: unified market symbol
2282
2439
  :param float amount: the amount of margin to remove
@@ -2345,7 +2502,9 @@ class hyperliquid(Exchange, ImplicitAPI):
2345
2502
  def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
2346
2503
  """
2347
2504
  transfer currency internally between wallets on the same account
2348
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#l1-usdc-transfer
2505
+
2506
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#l1-usdc-transfer
2507
+
2349
2508
  :param str code: unified currency code
2350
2509
  :param float amount: amount to transfer
2351
2510
  :param str fromAccount: account to transfer from *spot, swap*
@@ -2413,8 +2572,10 @@ class hyperliquid(Exchange, ImplicitAPI):
2413
2572
  def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2414
2573
  """
2415
2574
  make a withdrawal(only support USDC)
2416
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#initiate-a-withdrawal-request
2417
- :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#deposit-or-withdraw-from-a-vault
2575
+
2576
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#initiate-a-withdrawal-request
2577
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#deposit-or-withdraw-from-a-vault
2578
+
2418
2579
  :param str code: unified currency code
2419
2580
  :param float amount: the amount to withdraw
2420
2581
  :param str address: the address to withdraw to