ccxt 4.4.30__py2.py3-none-any.whl → 4.4.32__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 (268) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/ace.py +36 -12
  3. ccxt/alpaca.py +62 -22
  4. ccxt/ascendex.py +65 -30
  5. ccxt/async_support/__init__.py +1 -1
  6. ccxt/async_support/ace.py +36 -12
  7. ccxt/async_support/alpaca.py +62 -22
  8. ccxt/async_support/ascendex.py +65 -30
  9. ccxt/async_support/base/exchange.py +3 -3
  10. ccxt/async_support/base/ws/aiohttp_client.py +25 -3
  11. ccxt/async_support/bigone.py +71 -27
  12. ccxt/async_support/binance.py +555 -323
  13. ccxt/async_support/bingx.py +208 -108
  14. ccxt/async_support/bit2c.py +34 -12
  15. ccxt/async_support/bitbank.py +42 -14
  16. ccxt/async_support/bitbns.py +17 -9
  17. ccxt/async_support/bitfinex.py +68 -24
  18. ccxt/async_support/bitfinex2.py +116 -44
  19. ccxt/async_support/bitflyer.py +54 -18
  20. ccxt/async_support/bitget.py +277 -145
  21. ccxt/async_support/bithumb.py +39 -14
  22. ccxt/async_support/bitmart.py +145 -79
  23. ccxt/async_support/bitmex.py +90 -30
  24. ccxt/async_support/bitopro.py +66 -22
  25. ccxt/async_support/bitrue.py +109 -57
  26. ccxt/async_support/bitso.py +55 -19
  27. ccxt/async_support/bitstamp.py +84 -36
  28. ccxt/async_support/bitteam.py +51 -17
  29. ccxt/async_support/bitvavo.py +57 -22
  30. ccxt/async_support/bl3p.py +26 -10
  31. ccxt/async_support/blockchaincom.py +63 -21
  32. ccxt/async_support/blofin.py +95 -38
  33. ccxt/async_support/btcalpha.py +48 -16
  34. ccxt/async_support/btcbox.py +27 -9
  35. ccxt/async_support/btcmarkets.py +57 -19
  36. ccxt/async_support/btcturk.py +36 -12
  37. ccxt/async_support/bybit.py +251 -95
  38. ccxt/async_support/cex.py +65 -22
  39. ccxt/async_support/coinbase.py +138 -56
  40. ccxt/async_support/coinbaseexchange.py +76 -28
  41. ccxt/async_support/coinbaseinternational.py +75 -27
  42. ccxt/async_support/coincatch.py +191 -97
  43. ccxt/async_support/coincheck.py +33 -11
  44. ccxt/async_support/coinex.py +212 -101
  45. ccxt/async_support/coinlist.py +87 -30
  46. ccxt/async_support/coinmate.py +55 -24
  47. ccxt/async_support/coinmetro.py +52 -18
  48. ccxt/async_support/coinone.py +27 -10
  49. ccxt/async_support/coinsph.py +73 -27
  50. ccxt/async_support/coinspot.py +25 -9
  51. ccxt/async_support/cryptocom.py +103 -38
  52. ccxt/async_support/currencycom.py +70 -23
  53. ccxt/async_support/delta.py +90 -30
  54. ccxt/async_support/deribit.py +131 -50
  55. ccxt/async_support/digifinex.py +114 -51
  56. ccxt/async_support/exmo.py +104 -45
  57. ccxt/async_support/gate.py +313 -157
  58. ccxt/async_support/gemini.py +57 -20
  59. ccxt/async_support/hashkey.py +151 -66
  60. ccxt/async_support/hitbtc.py +157 -74
  61. ccxt/async_support/hollaex.py +76 -25
  62. ccxt/async_support/htx.py +297 -240
  63. ccxt/async_support/huobijp.py +1 -0
  64. ccxt/async_support/hyperliquid.py +94 -38
  65. ccxt/async_support/idex.py +73 -24
  66. ccxt/async_support/independentreserve.py +12 -5
  67. ccxt/async_support/indodax.py +54 -17
  68. ccxt/async_support/kraken.py +108 -36
  69. ccxt/async_support/krakenfutures.py +88 -34
  70. ccxt/async_support/kucoin.py +214 -110
  71. ccxt/async_support/kucoinfutures.py +209 -64
  72. ccxt/async_support/kuna.py +80 -39
  73. ccxt/async_support/latoken.py +70 -33
  74. ccxt/async_support/lbank.py +89 -38
  75. ccxt/async_support/luno.py +54 -19
  76. ccxt/async_support/lykke.py +54 -19
  77. ccxt/async_support/mercado.py +1 -0
  78. ccxt/async_support/mexc.py +226 -108
  79. ccxt/async_support/ndax.py +58 -19
  80. ccxt/async_support/novadax.py +67 -22
  81. ccxt/async_support/oceanex.py +58 -19
  82. ccxt/async_support/okcoin.py +81 -38
  83. ccxt/async_support/okx.py +270 -109
  84. ccxt/async_support/onetrading.py +3 -1
  85. ccxt/async_support/oxfun.py +95 -36
  86. ccxt/async_support/p2b.py +49 -23
  87. ccxt/async_support/paradex.py +75 -27
  88. ccxt/async_support/paymium.py +31 -11
  89. ccxt/async_support/phemex.py +108 -56
  90. ccxt/async_support/poloniex.py +80 -30
  91. ccxt/async_support/poloniexfutures.py +72 -30
  92. ccxt/async_support/probit.py +64 -22
  93. ccxt/async_support/timex.py +58 -19
  94. ccxt/async_support/tokocrypto.py +63 -22
  95. ccxt/async_support/tradeogre.py +7 -2
  96. ccxt/async_support/upbit.py +72 -25
  97. ccxt/async_support/vertex.py +74 -28
  98. ccxt/async_support/wavesexchange.py +32 -8
  99. ccxt/async_support/wazirx.py +51 -17
  100. ccxt/async_support/whitebit.py +105 -41
  101. ccxt/async_support/woo.py +162 -65
  102. ccxt/async_support/woofipro.py +119 -50
  103. ccxt/async_support/xt.py +150 -73
  104. ccxt/async_support/yobit.py +49 -16
  105. ccxt/async_support/zaif.py +30 -10
  106. ccxt/async_support/zonda.py +46 -16
  107. ccxt/base/exchange.py +47 -35
  108. ccxt/base/types.py +1 -0
  109. ccxt/bigone.py +71 -27
  110. ccxt/binance.py +555 -323
  111. ccxt/bingx.py +208 -108
  112. ccxt/bit2c.py +34 -12
  113. ccxt/bitbank.py +42 -14
  114. ccxt/bitbns.py +17 -9
  115. ccxt/bitfinex.py +68 -24
  116. ccxt/bitfinex2.py +116 -44
  117. ccxt/bitflyer.py +54 -18
  118. ccxt/bitget.py +277 -145
  119. ccxt/bithumb.py +39 -14
  120. ccxt/bitmart.py +145 -79
  121. ccxt/bitmex.py +90 -30
  122. ccxt/bitopro.py +66 -22
  123. ccxt/bitrue.py +109 -57
  124. ccxt/bitso.py +55 -19
  125. ccxt/bitstamp.py +84 -36
  126. ccxt/bitteam.py +51 -17
  127. ccxt/bitvavo.py +57 -22
  128. ccxt/bl3p.py +26 -10
  129. ccxt/blockchaincom.py +63 -21
  130. ccxt/blofin.py +95 -38
  131. ccxt/btcalpha.py +48 -16
  132. ccxt/btcbox.py +27 -9
  133. ccxt/btcmarkets.py +57 -19
  134. ccxt/btcturk.py +36 -12
  135. ccxt/bybit.py +251 -95
  136. ccxt/cex.py +65 -22
  137. ccxt/coinbase.py +138 -56
  138. ccxt/coinbaseexchange.py +76 -28
  139. ccxt/coinbaseinternational.py +75 -27
  140. ccxt/coincatch.py +191 -97
  141. ccxt/coincheck.py +33 -11
  142. ccxt/coinex.py +212 -101
  143. ccxt/coinlist.py +87 -30
  144. ccxt/coinmate.py +55 -24
  145. ccxt/coinmetro.py +52 -18
  146. ccxt/coinone.py +27 -10
  147. ccxt/coinsph.py +73 -27
  148. ccxt/coinspot.py +25 -9
  149. ccxt/cryptocom.py +103 -38
  150. ccxt/currencycom.py +70 -23
  151. ccxt/delta.py +90 -30
  152. ccxt/deribit.py +131 -50
  153. ccxt/digifinex.py +114 -51
  154. ccxt/exmo.py +104 -45
  155. ccxt/gate.py +313 -157
  156. ccxt/gemini.py +57 -20
  157. ccxt/hashkey.py +151 -66
  158. ccxt/hitbtc.py +157 -74
  159. ccxt/hollaex.py +76 -25
  160. ccxt/htx.py +297 -240
  161. ccxt/huobijp.py +1 -0
  162. ccxt/hyperliquid.py +94 -38
  163. ccxt/idex.py +73 -24
  164. ccxt/independentreserve.py +12 -5
  165. ccxt/indodax.py +54 -17
  166. ccxt/kraken.py +108 -36
  167. ccxt/krakenfutures.py +88 -34
  168. ccxt/kucoin.py +214 -110
  169. ccxt/kucoinfutures.py +209 -64
  170. ccxt/kuna.py +80 -39
  171. ccxt/latoken.py +70 -33
  172. ccxt/lbank.py +89 -38
  173. ccxt/luno.py +54 -19
  174. ccxt/lykke.py +54 -19
  175. ccxt/mercado.py +1 -0
  176. ccxt/mexc.py +226 -108
  177. ccxt/ndax.py +58 -19
  178. ccxt/novadax.py +67 -22
  179. ccxt/oceanex.py +58 -19
  180. ccxt/okcoin.py +81 -38
  181. ccxt/okx.py +270 -109
  182. ccxt/onetrading.py +3 -1
  183. ccxt/oxfun.py +95 -36
  184. ccxt/p2b.py +49 -23
  185. ccxt/paradex.py +75 -27
  186. ccxt/paymium.py +31 -11
  187. ccxt/phemex.py +108 -56
  188. ccxt/poloniex.py +80 -30
  189. ccxt/poloniexfutures.py +72 -30
  190. ccxt/pro/__init__.py +1 -1
  191. ccxt/pro/alpaca.py +15 -5
  192. ccxt/pro/ascendex.py +18 -6
  193. ccxt/pro/binance.py +204 -123
  194. ccxt/pro/bingx.py +44 -24
  195. ccxt/pro/bitfinex.py +13 -5
  196. ccxt/pro/bitget.py +76 -37
  197. ccxt/pro/bithumb.py +12 -4
  198. ccxt/pro/bitmart.py +44 -20
  199. ccxt/pro/bitmex.py +42 -14
  200. ccxt/pro/bitopro.py +15 -5
  201. ccxt/pro/bitrue.py +7 -3
  202. ccxt/pro/bitvavo.py +97 -62
  203. ccxt/pro/blockchaincom.py +18 -6
  204. ccxt/pro/blofin.py +36 -12
  205. ccxt/pro/bybit.py +100 -42
  206. ccxt/pro/cex.py +48 -16
  207. ccxt/pro/coinbase.py +32 -12
  208. ccxt/pro/coinbaseexchange.py +1 -1
  209. ccxt/pro/coinbaseinternational.py +34 -14
  210. ccxt/pro/coincatch.py +54 -19
  211. ccxt/pro/coincheck.py +6 -2
  212. ccxt/pro/coinex.py +40 -20
  213. ccxt/pro/coinone.py +9 -3
  214. ccxt/pro/cryptocom.py +71 -27
  215. ccxt/pro/deribit.py +36 -12
  216. ccxt/pro/exmo.py +10 -4
  217. ccxt/pro/gate.py +65 -31
  218. ccxt/pro/gemini.py +21 -7
  219. ccxt/pro/hashkey.py +27 -9
  220. ccxt/pro/hitbtc.py +61 -37
  221. ccxt/pro/hollaex.py +15 -5
  222. ccxt/pro/htx.py +39 -21
  223. ccxt/pro/hyperliquid.py +41 -14
  224. ccxt/pro/kraken.py +49 -17
  225. ccxt/pro/krakenfutures.py +47 -24
  226. ccxt/pro/kucoin.py +60 -31
  227. ccxt/pro/kucoinfutures.py +41 -19
  228. ccxt/pro/lbank.py +27 -9
  229. ccxt/pro/luno.py +3 -1
  230. ccxt/pro/mexc.py +36 -19
  231. ccxt/pro/ndax.py +12 -4
  232. ccxt/pro/okcoin.py +18 -6
  233. ccxt/pro/okx.py +76 -28
  234. ccxt/pro/onetrading.py +21 -7
  235. ccxt/pro/oxfun.py +54 -20
  236. ccxt/pro/p2b.py +23 -11
  237. ccxt/pro/paradex.py +12 -4
  238. ccxt/pro/phemex.py +31 -19
  239. ccxt/pro/poloniex.py +50 -22
  240. ccxt/pro/poloniexfutures.py +17 -7
  241. ccxt/pro/probit.py +18 -6
  242. ccxt/pro/upbit.py +25 -9
  243. ccxt/pro/vertex.py +20 -6
  244. ccxt/pro/wazirx.py +21 -7
  245. ccxt/pro/whitebit.py +25 -9
  246. ccxt/pro/woo.py +32 -12
  247. ccxt/pro/woofipro.py +35 -13
  248. ccxt/pro/xt.py +46 -26
  249. ccxt/probit.py +64 -22
  250. ccxt/timex.py +58 -19
  251. ccxt/tokocrypto.py +63 -22
  252. ccxt/tradeogre.py +7 -2
  253. ccxt/upbit.py +72 -25
  254. ccxt/vertex.py +74 -28
  255. ccxt/wavesexchange.py +32 -8
  256. ccxt/wazirx.py +51 -17
  257. ccxt/whitebit.py +105 -41
  258. ccxt/woo.py +162 -65
  259. ccxt/woofipro.py +119 -50
  260. ccxt/xt.py +150 -73
  261. ccxt/yobit.py +49 -16
  262. ccxt/zaif.py +30 -10
  263. ccxt/zonda.py +46 -16
  264. {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/METADATA +11 -5
  265. {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/RECORD +268 -268
  266. {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/LICENSE.txt +0 -0
  267. {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/WHEEL +0 -0
  268. {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/top_level.txt +0 -0
ccxt/gate.py CHANGED
@@ -169,7 +169,7 @@ class gate(Exchange, ImplicitAPI):
169
169
  'fetchSettlementHistory': True,
170
170
  'fetchTicker': True,
171
171
  'fetchTickers': True,
172
- 'fetchTime': False,
172
+ 'fetchTime': True,
173
173
  'fetchTrades': True,
174
174
  'fetchTradingFee': True,
175
175
  'fetchTradingFees': True,
@@ -916,8 +916,11 @@ class gate(Exchange, ImplicitAPI):
916
916
 
917
917
  def load_unified_status(self, params={}):
918
918
  """
919
+ :param dict [params]: extra parameters specific to the exchange API endpoint
919
920
  returns unifiedAccount so the user can check if the unified account is enabled
920
- :see: https://www.gate.io/docs/developers/apiv4/#get-account-detail
921
+
922
+ https://www.gate.io/docs/developers/apiv4/#get-account-detail
923
+
921
924
  :returns boolean: True or False if the enabled unified account is enabled or not and sets the unifiedAccount option if it is None
922
925
  """
923
926
  unifiedAccount = self.safe_bool(self.options, 'unifiedAccount')
@@ -946,6 +949,23 @@ class gate(Exchange, ImplicitAPI):
946
949
  def upgrade_unified_trade_account(self, params={}):
947
950
  return self.privateUnifiedPutUnifiedMode(params)
948
951
 
952
+ def fetch_time(self, params={}):
953
+ """
954
+ fetches the current integer timestamp in milliseconds from the exchange server
955
+
956
+ https://www.gate.io/docs/developers/apiv4/en/#get-server-current-time
957
+
958
+ :param dict [params]: extra parameters specific to the exchange API endpoint
959
+ :returns int: the current integer timestamp in milliseconds from the exchange server
960
+ """
961
+ response = self.publicSpotGetTime(params)
962
+ #
963
+ # {
964
+ # "server_time": 1731447921098
965
+ # }
966
+ #
967
+ return self.safe_integer(response, 'server_time')
968
+
949
969
  def create_expired_option_market(self, symbol: str):
950
970
  # support expired option contracts
951
971
  quote = 'USDT'
@@ -1019,11 +1039,13 @@ class gate(Exchange, ImplicitAPI):
1019
1039
  def fetch_markets(self, params={}) -> List[Market]:
1020
1040
  """
1021
1041
  retrieves data on all markets for gate
1022
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-currency-pairs-supported # spot
1023
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-supported-currency-pairs-supported-in-margin-trading # margin
1024
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts # swap
1025
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts-2 # future
1026
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-the-contracts-with-specified-underlying-and-expiration-time # option
1042
+
1043
+ https://www.gate.io/docs/developers/apiv4/en/#list-all-currency-pairs-supported # spot
1044
+ https://www.gate.io/docs/developers/apiv4/en/#list-all-supported-currency-pairs-supported-in-margin-trading # margin
1045
+ https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts # swap
1046
+ https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts-2 # future
1047
+ https://www.gate.io/docs/developers/apiv4/en/#list-all-the-contracts-with-specified-underlying-and-expiration-time # option
1048
+
1027
1049
  :param dict [params]: extra parameters specific to the exchange API endpoint
1028
1050
  :returns dict[]: an array of objects representing market data
1029
1051
  """
@@ -1483,7 +1505,7 @@ class gate(Exchange, ImplicitAPI):
1483
1505
 
1484
1506
  def prepare_request(self, market=None, type=None, params={}):
1485
1507
  """
1486
- * @ignore
1508
+ @ignore
1487
1509
  Fills request params contract, settle, currency_pair, market and account where applicable
1488
1510
  :param dict market: CCXT market, required when type is None
1489
1511
  :param str type: 'spot', 'swap', or 'future', required when market is None
@@ -1511,7 +1533,7 @@ class gate(Exchange, ImplicitAPI):
1511
1533
 
1512
1534
  def spot_order_prepare_request(self, market=None, stop=False, params={}):
1513
1535
  """
1514
- * @ignore
1536
+ @ignore
1515
1537
  Fills request params currency_pair, market and account where applicable for spot order methods like fetchOpenOrders, cancelAllOrders
1516
1538
  :param dict market: CCXT market
1517
1539
  :param bool stop: True if for a stop order
@@ -1529,7 +1551,7 @@ class gate(Exchange, ImplicitAPI):
1529
1551
 
1530
1552
  def multi_order_spot_prepare_request(self, market=None, trigger=False, params={}):
1531
1553
  """
1532
- * @ignore
1554
+ @ignore
1533
1555
  Fills request params currency_pair, market and account where applicable for spot order methods like fetchOpenOrders, cancelAllOrders
1534
1556
  :param dict market: CCXT market
1535
1557
  :param bool stop: True if for a stop order
@@ -1550,7 +1572,7 @@ class gate(Exchange, ImplicitAPI):
1550
1572
 
1551
1573
  def get_margin_mode(self, stop, params):
1552
1574
  """
1553
- * @ignore
1575
+ @ignore
1554
1576
  Gets the margin type for self api call
1555
1577
  :param bool stop: True if for a stop order
1556
1578
  :param dict [params]: Request params
@@ -1586,7 +1608,9 @@ class gate(Exchange, ImplicitAPI):
1586
1608
  def fetch_currencies(self, params={}) -> Currencies:
1587
1609
  """
1588
1610
  fetches all available currencies on an exchange
1589
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-currencies-details
1611
+
1612
+ https://www.gate.io/docs/developers/apiv4/en/#list-all-currencies-details
1613
+
1590
1614
  :param dict [params]: extra parameters specific to the exchange API endpoint
1591
1615
  :returns dict: an associative dictionary of currencies
1592
1616
  """
@@ -1697,7 +1721,9 @@ class gate(Exchange, ImplicitAPI):
1697
1721
  def fetch_funding_rate(self, symbol: str, params={}) -> FundingRate:
1698
1722
  """
1699
1723
  fetch the current funding rate
1700
- :see: https://www.gate.io/docs/developers/apiv4/en/#get-a-single-contract
1724
+
1725
+ https://www.gate.io/docs/developers/apiv4/en/#get-a-single-contract
1726
+
1701
1727
  :param str symbol: unified market symbol
1702
1728
  :param dict [params]: extra parameters specific to the exchange API endpoint
1703
1729
  :returns dict: a `funding rate structure <https://docs.ccxt.com/#/?id=funding-rate-structure>`
@@ -1757,7 +1783,9 @@ class gate(Exchange, ImplicitAPI):
1757
1783
  def fetch_funding_rates(self, symbols: Strings = None, params={}) -> FundingRates:
1758
1784
  """
1759
1785
  fetch the funding rate for multiple markets
1760
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts
1786
+
1787
+ https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts
1788
+
1761
1789
  :param str[]|None symbols: list of unified market symbols
1762
1790
  :param dict [params]: extra parameters specific to the exchange API endpoint
1763
1791
  :returns dict[]: a list of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rates-structure>`, indexed by market symbols
@@ -1936,7 +1964,9 @@ class gate(Exchange, ImplicitAPI):
1936
1964
  def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1937
1965
  """
1938
1966
  fetch the deposit address for a currency associated with self account
1939
- :see: https://www.gate.io/docs/developers/apiv4/en/#generate-currency-deposit-address
1967
+
1968
+ https://www.gate.io/docs/developers/apiv4/en/#generate-currency-deposit-address
1969
+
1940
1970
  :param str code: unified currency code
1941
1971
  :param dict [params]: extra parameters specific to the exchange API endpoint
1942
1972
  :param str [params.network]: unified network code(not used directly by gate.io but used by ccxt to filter the response)
@@ -2007,7 +2037,9 @@ class gate(Exchange, ImplicitAPI):
2007
2037
  def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
2008
2038
  """
2009
2039
  fetch the trading fees for a market
2010
- :see: https://www.gate.io/docs/developers/apiv4/en/#retrieve-personal-trading-fee
2040
+
2041
+ https://www.gate.io/docs/developers/apiv4/en/#retrieve-personal-trading-fee
2042
+
2011
2043
  :param str symbol: unified market symbol
2012
2044
  :param dict [params]: extra parameters specific to the exchange API endpoint
2013
2045
  :returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
@@ -2037,7 +2069,9 @@ class gate(Exchange, ImplicitAPI):
2037
2069
  def fetch_trading_fees(self, params={}) -> TradingFees:
2038
2070
  """
2039
2071
  fetch the trading fees for multiple markets
2040
- :see: https://www.gate.io/docs/developers/apiv4/en/#retrieve-personal-trading-fee
2072
+
2073
+ https://www.gate.io/docs/developers/apiv4/en/#retrieve-personal-trading-fee
2074
+
2041
2075
  :param dict [params]: extra parameters specific to the exchange API endpoint
2042
2076
  :returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
2043
2077
  """
@@ -2099,9 +2133,11 @@ class gate(Exchange, ImplicitAPI):
2099
2133
 
2100
2134
  def fetch_transaction_fees(self, codes: Strings = None, params={}):
2101
2135
  """
2102
- * @deprecated
2136
+ @deprecated
2103
2137
  please use fetchDepositWithdrawFees instead
2104
- :see: https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-status
2138
+
2139
+ https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-status
2140
+
2105
2141
  :param str[]|None codes: list of unified currency codes
2106
2142
  :param dict [params]: extra parameters specific to the exchange API endpoint
2107
2143
  :returns dict: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
@@ -2152,7 +2188,9 @@ class gate(Exchange, ImplicitAPI):
2152
2188
  def fetch_deposit_withdraw_fees(self, codes: Strings = None, params={}):
2153
2189
  """
2154
2190
  fetch deposit and withdraw fees
2155
- :see: https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-status
2191
+
2192
+ https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-status
2193
+
2156
2194
  :param str[]|None codes: list of unified currency codes
2157
2195
  :param dict [params]: extra parameters specific to the exchange API endpoint
2158
2196
  :returns dict: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
@@ -2230,8 +2268,10 @@ class gate(Exchange, ImplicitAPI):
2230
2268
  def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
2231
2269
  """
2232
2270
  fetch the history of funding payments paid and received on self account
2233
- :see: https://www.gate.io/docs/developers/apiv4/en/#query-account-book-2
2234
- :see: https://www.gate.io/docs/developers/apiv4/en/#query-account-book-3
2271
+
2272
+ https://www.gate.io/docs/developers/apiv4/en/#query-account-book-2
2273
+ https://www.gate.io/docs/developers/apiv4/en/#query-account-book-3
2274
+
2235
2275
  :param str symbol: unified market symbol
2236
2276
  :param int [since]: the earliest time in ms to fetch funding history for
2237
2277
  :param int [limit]: the maximum number of funding history structures to retrieve
@@ -2308,10 +2348,12 @@ class gate(Exchange, ImplicitAPI):
2308
2348
  def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
2309
2349
  """
2310
2350
  fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
2311
- :see: https://www.gate.io/docs/developers/apiv4/en/#retrieve-order-book
2312
- :see: https://www.gate.io/docs/developers/apiv4/en/#futures-order-book
2313
- :see: https://www.gate.io/docs/developers/apiv4/en/#futures-order-book-2
2314
- :see: https://www.gate.io/docs/developers/apiv4/en/#options-order-book
2351
+
2352
+ https://www.gate.io/docs/developers/apiv4/en/#retrieve-order-book
2353
+ https://www.gate.io/docs/developers/apiv4/en/#futures-order-book
2354
+ https://www.gate.io/docs/developers/apiv4/en/#futures-order-book-2
2355
+ https://www.gate.io/docs/developers/apiv4/en/#options-order-book
2356
+
2315
2357
  :param str symbol: unified symbol of the market to fetch the order book for
2316
2358
  :param int [limit]: the maximum amount of order book entries to return
2317
2359
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -2419,10 +2461,12 @@ class gate(Exchange, ImplicitAPI):
2419
2461
  def fetch_ticker(self, symbol: str, params={}) -> Ticker:
2420
2462
  """
2421
2463
  fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
2422
- :see: https://www.gate.io/docs/developers/apiv4/en/#get-details-of-a-specifc-order
2423
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers
2424
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers-2
2425
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
2464
+
2465
+ https://www.gate.io/docs/developers/apiv4/en/#get-details-of-a-specifc-order
2466
+ https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers
2467
+ https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers-2
2468
+ https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
2469
+
2426
2470
  :param str symbol: unified symbol of the market to fetch the ticker for
2427
2471
  :param dict [params]: extra parameters specific to the exchange API endpoint
2428
2472
  :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
@@ -2570,10 +2614,12 @@ class gate(Exchange, ImplicitAPI):
2570
2614
  def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
2571
2615
  """
2572
2616
  fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
2573
- :see: https://www.gate.io/docs/developers/apiv4/en/#get-details-of-a-specifc-order
2574
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers
2575
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers-2
2576
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
2617
+
2618
+ https://www.gate.io/docs/developers/apiv4/en/#get-details-of-a-specifc-order
2619
+ https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers
2620
+ https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers-2
2621
+ https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
2622
+
2577
2623
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
2578
2624
  :param dict [params]: extra parameters specific to the exchange API endpoint
2579
2625
  :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
@@ -2621,6 +2667,7 @@ class gate(Exchange, ImplicitAPI):
2621
2667
  :param str [params.marginMode]: 'cross' or 'isolated' - marginMode for margin trading if not provided self.options['defaultMarginMode'] is used
2622
2668
  :param str [params.symbol]: margin only - unified ccxt symbol
2623
2669
  :param boolean [params.unifiedAccount]: default False, set to True for fetching the unified account balance
2670
+ :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
2624
2671
  """
2625
2672
  self.load_markets()
2626
2673
  self.load_unified_status()
@@ -2890,10 +2937,12 @@ class gate(Exchange, ImplicitAPI):
2890
2937
  def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
2891
2938
  """
2892
2939
  fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
2893
- :see: https://www.gate.io/docs/developers/apiv4/en/#market-candlesticks # spot
2894
- :see: https://www.gate.io/docs/developers/apiv4/en/#get-futures-candlesticks # swap
2895
- :see: https://www.gate.io/docs/developers/apiv4/en/#market-candlesticks # future
2896
- :see: https://www.gate.io/docs/developers/apiv4/en/#get-options-candlesticks # option
2940
+
2941
+ https://www.gate.io/docs/developers/apiv4/en/#market-candlesticks # spot
2942
+ https://www.gate.io/docs/developers/apiv4/en/#get-futures-candlesticks # swap
2943
+ https://www.gate.io/docs/developers/apiv4/en/#market-candlesticks # future
2944
+ https://www.gate.io/docs/developers/apiv4/en/#get-options-candlesticks # option
2945
+
2897
2946
  :param str symbol: unified symbol of the market to fetch OHLCV data for
2898
2947
  :param str timeframe: the length of time each candle represents
2899
2948
  :param int [since]: timestamp in ms of the earliest candle to fetch
@@ -2966,23 +3015,38 @@ class gate(Exchange, ImplicitAPI):
2966
3015
  def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
2967
3016
  """
2968
3017
  fetches historical funding rate prices
2969
- :see: https://www.gate.io/docs/developers/apiv4/en/#funding-rate-history
3018
+
3019
+ https://www.gate.io/docs/developers/apiv4/en/#funding-rate-history
3020
+
2970
3021
  :param str symbol: unified symbol of the market to fetch the funding rate history for
2971
3022
  :param int [since]: timestamp in ms of the earliest funding rate to fetch
2972
3023
  :param int [limit]: the maximum amount of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>` to fetch
2973
3024
  :param dict [params]: extra parameters specific to the exchange API endpoint
3025
+ :param int [params.until]: timestamp in ms of the latest funding rate to fetch
3026
+ :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
2974
3027
  :returns dict[]: a list of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>`
2975
3028
  """
2976
3029
  if symbol is None:
2977
3030
  raise ArgumentsRequired(self.id + ' fetchFundingRateHistory() requires a symbol argument')
2978
3031
  self.load_markets()
3032
+ paginate = False
3033
+ paginate, params = self.handle_option_and_params(params, 'fetchFundingRateHistory', 'paginate')
3034
+ if paginate:
3035
+ return self.fetch_paginated_call_deterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params)
2979
3036
  market = self.market(symbol)
2980
3037
  if not market['swap']:
2981
3038
  raise BadSymbol(self.id + ' fetchFundingRateHistory() supports swap contracts only')
2982
- request, query = self.prepare_request(market, None, params)
3039
+ request: dict = {}
3040
+ request, params = self.prepare_request(market, None, params)
2983
3041
  if limit is not None:
2984
3042
  request['limit'] = limit
2985
- response = self.publicFuturesGetSettleFundingRate(self.extend(request, query))
3043
+ if since is not None:
3044
+ request['from'] = self.parse_to_int(since / 1000)
3045
+ until = self.safe_integer(params, 'until')
3046
+ if until is not None:
3047
+ params = self.omit(params, 'until')
3048
+ request['to'] = self.parse_to_int(until / 1000)
3049
+ response = self.publicFuturesGetSettleFundingRate(self.extend(request, params))
2986
3050
  #
2987
3051
  # {
2988
3052
  # "r": "0.00063521",
@@ -3051,10 +3115,12 @@ class gate(Exchange, ImplicitAPI):
3051
3115
  def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
3052
3116
  """
3053
3117
  get the list of most recent trades for a particular symbol
3054
- :see: https://www.gate.io/docs/developers/apiv4/en/#retrieve-market-trades
3055
- :see: https://www.gate.io/docs/developers/apiv4/en/#futures-trading-history
3056
- :see: https://www.gate.io/docs/developers/apiv4/en/#futures-trading-history-2
3057
- :see: https://www.gate.io/docs/developers/apiv4/en/#options-trade-history
3118
+
3119
+ https://www.gate.io/docs/developers/apiv4/en/#retrieve-market-trades
3120
+ https://www.gate.io/docs/developers/apiv4/en/#futures-trading-history
3121
+ https://www.gate.io/docs/developers/apiv4/en/#futures-trading-history-2
3122
+ https://www.gate.io/docs/developers/apiv4/en/#options-trade-history
3123
+
3058
3124
  :param str symbol: unified symbol of the market to fetch trades for
3059
3125
  :param int [since]: timestamp in ms of the earliest trade to fetch
3060
3126
  :param int [limit]: the maximum amount of trades to fetch
@@ -3155,10 +3221,12 @@ class gate(Exchange, ImplicitAPI):
3155
3221
  def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3156
3222
  """
3157
3223
  fetch all the trades made from a single order
3158
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history
3159
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-2
3160
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-3
3161
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-4
3224
+
3225
+ https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history
3226
+ https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-2
3227
+ https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-3
3228
+ https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-4
3229
+
3162
3230
  :param str id: order id
3163
3231
  :param str symbol: unified market symbol
3164
3232
  :param int [since]: the earliest time in ms to fetch trades for
@@ -3194,10 +3262,12 @@ class gate(Exchange, ImplicitAPI):
3194
3262
  def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3195
3263
  """
3196
3264
  Fetch personal trading history
3197
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history
3198
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-2
3199
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-3
3200
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-4
3265
+
3266
+ https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history
3267
+ https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-2
3268
+ https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-3
3269
+ https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-4
3270
+
3201
3271
  :param str symbol: unified market symbol
3202
3272
  :param int [since]: the earliest time in ms to fetch trades for
3203
3273
  :param int [limit]: the maximum number of trades structures to retrieve
@@ -3466,12 +3536,14 @@ class gate(Exchange, ImplicitAPI):
3466
3536
  def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
3467
3537
  """
3468
3538
  fetch all deposits made to an account
3469
- :see: https://www.gate.io/docs/developers/apiv4/en/#retrieve-deposit-records
3539
+
3540
+ https://www.gate.io/docs/developers/apiv4/en/#retrieve-deposit-records
3541
+
3470
3542
  :param str code: unified currency code
3471
3543
  :param int [since]: the earliest time in ms to fetch deposits for
3472
3544
  :param int [limit]: the maximum number of deposits structures to retrieve
3473
- :param int [params.until]: end time in ms
3474
3545
  :param dict [params]: extra parameters specific to the exchange API endpoint
3546
+ :param int [params.until]: end time in ms
3475
3547
  :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
3476
3548
  :returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
3477
3549
  """
@@ -3498,7 +3570,9 @@ class gate(Exchange, ImplicitAPI):
3498
3570
  def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
3499
3571
  """
3500
3572
  fetch all withdrawals made from an account
3501
- :see: https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-records
3573
+
3574
+ https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-records
3575
+
3502
3576
  :param str code: unified currency code
3503
3577
  :param int [since]: the earliest time in ms to fetch withdrawals for
3504
3578
  :param int [limit]: the maximum number of withdrawals structures to retrieve
@@ -3530,7 +3604,9 @@ class gate(Exchange, ImplicitAPI):
3530
3604
  def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
3531
3605
  """
3532
3606
  make a withdrawal
3533
- :see: https://www.gate.io/docs/developers/apiv4/en/#withdraw
3607
+
3608
+ https://www.gate.io/docs/developers/apiv4/en/#withdraw
3609
+
3534
3610
  :param str code: unified currency code
3535
3611
  :param float amount: the amount to withdraw
3536
3612
  :param str address: the address to withdraw to
@@ -3706,13 +3782,15 @@ class gate(Exchange, ImplicitAPI):
3706
3782
  def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
3707
3783
  """
3708
3784
  Create an order on the exchange
3709
- :see: https://www.gate.io/docs/developers/apiv4/en/#create-an-order
3710
- :see: https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order
3711
- :see: https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order
3712
- :see: https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order-2
3713
- :see: https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order-2
3714
- :see: https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order-3
3715
- :see: https://www.gate.io/docs/developers/apiv4/en/#create-an-options-order
3785
+
3786
+ https://www.gate.io/docs/developers/apiv4/en/#create-an-order
3787
+ https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order
3788
+ https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order
3789
+ https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order-2
3790
+ https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order-2
3791
+ https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order-3
3792
+ https://www.gate.io/docs/developers/apiv4/en/#create-an-options-order
3793
+
3716
3794
  :param str symbol: Unified CCXT market symbol
3717
3795
  :param str type: 'limit' or 'market' *"market" is contract only*
3718
3796
  :param str side: 'buy' or 'sell'
@@ -3866,10 +3944,13 @@ class gate(Exchange, ImplicitAPI):
3866
3944
  def create_orders(self, orders: List[OrderRequest], params={}):
3867
3945
  """
3868
3946
  create a list of trade orders
3869
- :see: https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-2
3870
- :see: https://www.gate.io/docs/developers/apiv4/en/#create-a-batch-of-orders
3871
- :see: https://www.gate.io/docs/developers/apiv4/en/#create-a-batch-of-futures-orders
3947
+
3948
+ https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-2
3949
+ https://www.gate.io/docs/developers/apiv4/en/#create-a-batch-of-orders
3950
+ https://www.gate.io/docs/developers/apiv4/en/#create-a-batch-of-futures-orders
3951
+
3872
3952
  :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
3953
+ :param dict [params]: extra parameters specific to the exchange API endpoint
3873
3954
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
3874
3955
  """
3875
3956
  self.load_markets()
@@ -4098,7 +4179,9 @@ class gate(Exchange, ImplicitAPI):
4098
4179
  def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
4099
4180
  """
4100
4181
  create a market buy order by providing the symbol and cost
4101
- :see: https://www.gate.io/docs/developers/apiv4/en/#create-an-order
4182
+
4183
+ https://www.gate.io/docs/developers/apiv4/en/#create-an-order
4184
+
4102
4185
  :param str symbol: unified symbol of the market to create an order in
4103
4186
  :param float cost: how much you want to trade in units of the quote currency
4104
4187
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -4149,8 +4232,10 @@ class gate(Exchange, ImplicitAPI):
4149
4232
  def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
4150
4233
  """
4151
4234
  edit a trade order, gate currently only supports the modification of the price or amount fields
4152
- :see: https://www.gate.io/docs/developers/apiv4/en/#amend-an-order
4153
- :see: https://www.gate.io/docs/developers/apiv4/en/#amend-an-order-2
4235
+
4236
+ https://www.gate.io/docs/developers/apiv4/en/#amend-an-order
4237
+ https://www.gate.io/docs/developers/apiv4/en/#amend-an-order-2
4238
+
4154
4239
  :param str id: order id
4155
4240
  :param str symbol: unified symbol of the market to create an order in
4156
4241
  :param str type: 'market' or 'limit'
@@ -4493,10 +4578,12 @@ class gate(Exchange, ImplicitAPI):
4493
4578
  def fetch_order(self, id: str, symbol: Str = None, params={}):
4494
4579
  """
4495
4580
  Retrieves information on an order
4496
- :see: https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order
4497
- :see: https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-2
4498
- :see: https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-3
4499
- :see: https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-4
4581
+
4582
+ https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order
4583
+ https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-2
4584
+ https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-3
4585
+ https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-4
4586
+
4500
4587
  :param str id: Order id
4501
4588
  :param str symbol: Unified market symbol, *required for spot and margin*
4502
4589
  :param dict [params]: Parameters specified by the exchange api
@@ -4539,8 +4626,10 @@ class gate(Exchange, ImplicitAPI):
4539
4626
  def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
4540
4627
  """
4541
4628
  fetch all unfilled currently open orders
4542
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-open-orders
4543
- :see: https://www.gate.io/docs/developers/apiv4/en/#retrieve-running-auto-order-list
4629
+
4630
+ https://www.gate.io/docs/developers/apiv4/en/#list-all-open-orders
4631
+ https://www.gate.io/docs/developers/apiv4/en/#retrieve-running-auto-order-list
4632
+
4544
4633
  :param str symbol: unified market symbol
4545
4634
  :param int [since]: the earliest time in ms to fetch open orders for
4546
4635
  :param int [limit]: the maximum number of open orders structures to retrieve
@@ -4556,14 +4645,16 @@ class gate(Exchange, ImplicitAPI):
4556
4645
  def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
4557
4646
  """
4558
4647
  fetches information on multiple closed orders made by the user
4559
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-orders
4560
- :see: https://www.gate.io/docs/developers/apiv4/en/#retrieve-running-auto-order-list
4561
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders
4562
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-auto-orders
4563
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders-2
4564
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-auto-orders-2
4565
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-options-orders
4566
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders-by-time-range
4648
+
4649
+ https://www.gate.io/docs/developers/apiv4/en/#list-orders
4650
+ https://www.gate.io/docs/developers/apiv4/en/#retrieve-running-auto-order-list
4651
+ https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders
4652
+ https://www.gate.io/docs/developers/apiv4/en/#list-all-auto-orders
4653
+ https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders-2
4654
+ https://www.gate.io/docs/developers/apiv4/en/#list-all-auto-orders-2
4655
+ https://www.gate.io/docs/developers/apiv4/en/#list-options-orders
4656
+ https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders-by-time-range
4657
+
4567
4658
  :param str symbol: unified market symbol of the market orders were made in
4568
4659
  :param int [since]: the earliest time in ms to fetch orders for
4569
4660
  :param int [limit]: the maximum number of order structures to retrieve
@@ -4828,10 +4919,12 @@ class gate(Exchange, ImplicitAPI):
4828
4919
  def cancel_order(self, id: str, symbol: Str = None, params={}):
4829
4920
  """
4830
4921
  Cancels an open order
4831
- :see: https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order
4832
- :see: https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-2
4833
- :see: https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-3
4834
- :see: https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-4
4922
+
4923
+ https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order
4924
+ https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-2
4925
+ https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-3
4926
+ https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-4
4927
+
4835
4928
  :param str id: Order id
4836
4929
  :param str symbol: Unified market symbol
4837
4930
  :param dict [params]: Parameters specified by the exchange api
@@ -4953,8 +5046,10 @@ class gate(Exchange, ImplicitAPI):
4953
5046
  def cancel_orders(self, ids: List[str], symbol: Str = None, params={}):
4954
5047
  """
4955
5048
  cancel multiple orders
4956
- :see: https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
4957
- :see: https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list-2
5049
+
5050
+ https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
5051
+ https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list-2
5052
+
4958
5053
  :param str[] ids: order ids
4959
5054
  :param str symbol: unified symbol of the market the order was made in
4960
5055
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -4995,7 +5090,9 @@ class gate(Exchange, ImplicitAPI):
4995
5090
  def cancel_orders_for_symbols(self, orders: List[CancellationRequest], params={}):
4996
5091
  """
4997
5092
  cancel multiple orders for multiple symbols
4998
- :see: https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
5093
+
5094
+ https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
5095
+
4999
5096
  :param CancellationRequest[] orders: list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
5000
5097
  :param dict [params]: extra parameters specific to the exchange API endpoint
5001
5098
  :param str[] [params.clientOrderIds]: client order ids
@@ -5031,10 +5128,12 @@ class gate(Exchange, ImplicitAPI):
5031
5128
  def cancel_all_orders(self, symbol: Str = None, params={}):
5032
5129
  """
5033
5130
  cancel all open orders
5034
- :see: https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-in-specified-currency-pair
5035
- :see: https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched
5036
- :see: https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched-2
5037
- :see: https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched-3
5131
+
5132
+ https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-in-specified-currency-pair
5133
+ https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched
5134
+ https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched-2
5135
+ https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched-3
5136
+
5038
5137
  :param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
5039
5138
  :param dict [params]: extra parameters specific to the exchange API endpoint
5040
5139
  :param bool [params.unifiedAccount]: set to True for canceling unified account orders
@@ -5100,7 +5199,9 @@ class gate(Exchange, ImplicitAPI):
5100
5199
  def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
5101
5200
  """
5102
5201
  transfer currency internally between wallets on the same account
5103
- :see: https://www.gate.io/docs/developers/apiv4/en/#transfer-between-trading-accounts
5202
+
5203
+ https://www.gate.io/docs/developers/apiv4/en/#transfer-between-trading-accounts
5204
+
5104
5205
  :param str code: unified currency code for currency being transferred
5105
5206
  :param float amount: the amount of currency to transfer
5106
5207
  :param str fromAccount: the account to transfer currency from
@@ -5176,8 +5277,10 @@ class gate(Exchange, ImplicitAPI):
5176
5277
  def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
5177
5278
  """
5178
5279
  set the level of leverage for a market
5179
- :see: https://www.gate.io/docs/developers/apiv4/en/#update-position-leverage
5180
- :see: https://www.gate.io/docs/developers/apiv4/en/#update-position-leverage-2
5280
+
5281
+ https://www.gate.io/docs/developers/apiv4/en/#update-position-leverage
5282
+ https://www.gate.io/docs/developers/apiv4/en/#update-position-leverage-2
5283
+
5181
5284
  :param float leverage: the rate of leverage
5182
5285
  :param str symbol: unified market symbol
5183
5286
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -5378,9 +5481,11 @@ class gate(Exchange, ImplicitAPI):
5378
5481
  def fetch_position(self, symbol: str, params={}):
5379
5482
  """
5380
5483
  fetch data on an open contract position
5381
- :see: https://www.gate.io/docs/developers/apiv4/en/#get-single-position
5382
- :see: https://www.gate.io/docs/developers/apiv4/en/#get-single-position-2
5383
- :see: https://www.gate.io/docs/developers/apiv4/en/#get-specified-contract-position
5484
+
5485
+ https://www.gate.io/docs/developers/apiv4/en/#get-single-position
5486
+ https://www.gate.io/docs/developers/apiv4/en/#get-single-position-2
5487
+ https://www.gate.io/docs/developers/apiv4/en/#get-specified-contract-position
5488
+
5384
5489
  :param str symbol: unified market symbol of the market the position is held in
5385
5490
  :param dict [params]: extra parameters specific to the exchange API endpoint
5386
5491
  :returns dict: a `position structure <https://docs.ccxt.com/#/?id=position-structure>`
@@ -5460,9 +5565,11 @@ class gate(Exchange, ImplicitAPI):
5460
5565
  def fetch_positions(self, symbols: Strings = None, params={}):
5461
5566
  """
5462
5567
  fetch all open positions
5463
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-positions-of-a-user
5464
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-positions-of-a-user-2
5465
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-user-s-positions-of-specified-underlying
5568
+
5569
+ https://www.gate.io/docs/developers/apiv4/en/#list-all-positions-of-a-user
5570
+ https://www.gate.io/docs/developers/apiv4/en/#list-all-positions-of-a-user-2
5571
+ https://www.gate.io/docs/developers/apiv4/en/#list-user-s-positions-of-specified-underlying
5572
+
5466
5573
  :param str[]|None symbols: Not used by gate, but parsed internally by CCXT
5467
5574
  :param dict [params]: extra parameters specific to the exchange API endpoint
5468
5575
  :param str [params.settle]: 'btc' or 'usdt' - settle currency for perpetual swap and future - default="usdt" for swap and "btc" for future
@@ -5560,8 +5667,10 @@ class gate(Exchange, ImplicitAPI):
5560
5667
  def fetch_leverage_tiers(self, symbols: Strings = None, params={}) -> LeverageTiers:
5561
5668
  """
5562
5669
  retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
5563
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts
5564
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts-2
5670
+
5671
+ https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts
5672
+ https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts-2
5673
+
5565
5674
  :param str[] [symbols]: list of unified market symbols
5566
5675
  :param dict [params]: extra parameters specific to the exchange API endpoint
5567
5676
  :returns dict: a dictionary of `leverage tiers structures <https://docs.ccxt.com/#/?id=leverage-tiers-structure>`, indexed by market symbols
@@ -5675,7 +5784,9 @@ class gate(Exchange, ImplicitAPI):
5675
5784
  def fetch_market_leverage_tiers(self, symbol: str, params={}) -> List[LeverageTier]:
5676
5785
  """
5677
5786
  retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
5678
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-risk-limit-tiers
5787
+
5788
+ https://www.gate.io/docs/developers/apiv4/en/#list-risk-limit-tiers
5789
+
5679
5790
  :param str symbol: unified market symbol
5680
5791
  :param dict [params]: extra parameters specific to the exchange API endpoint
5681
5792
  :returns dict: a `leverage tiers structure <https://docs.ccxt.com/#/?id=leverage-tiers-structure>`
@@ -5700,7 +5811,8 @@ class gate(Exchange, ImplicitAPI):
5700
5811
  #
5701
5812
  return self.parse_market_leverage_tiers(response, market)
5702
5813
 
5703
- def parse_emulated_leverage_tiers(self, info, market=None):
5814
+ def parse_emulated_leverage_tiers(self, info, market=None) -> List[LeverageTier]:
5815
+ marketId = self.safe_string(info, 'name')
5704
5816
  maintenanceMarginUnit = self.safe_string(info, 'maintenance_rate') # '0.005',
5705
5817
  leverageMax = self.safe_string(info, 'leverage_max') # '100',
5706
5818
  riskLimitStep = self.safe_string(info, 'risk_limit_step') # '1000000',
@@ -5714,6 +5826,7 @@ class gate(Exchange, ImplicitAPI):
5714
5826
  cap = Precise.string_add(floor, riskLimitStep)
5715
5827
  tiers.append({
5716
5828
  'tier': self.parse_number(Precise.string_div(cap, riskLimitStep)),
5829
+ 'symbol': self.safe_symbol(marketId, market, None, 'contract'),
5717
5830
  'currency': self.safe_string(market, 'settle'),
5718
5831
  'minNotional': self.parse_number(floor),
5719
5832
  'maxNotional': self.parse_number(cap),
@@ -5747,6 +5860,7 @@ class gate(Exchange, ImplicitAPI):
5747
5860
  maxNotional = self.safe_number(item, 'risk_limit')
5748
5861
  tiers.append({
5749
5862
  'tier': self.sum(i, 1),
5863
+ 'symbol': market['symbol'],
5750
5864
  'currency': market['base'],
5751
5865
  'minNotional': minNotional,
5752
5866
  'maxNotional': maxNotional,
@@ -5760,7 +5874,9 @@ class gate(Exchange, ImplicitAPI):
5760
5874
  def repay_isolated_margin(self, symbol: str, code: str, amount, params={}):
5761
5875
  """
5762
5876
  repay borrowed margin and interest
5763
- :see: https://www.gate.io/docs/apiv4/en/#repay-a-loan
5877
+
5878
+ https://www.gate.io/docs/apiv4/en/#repay-a-loan
5879
+
5764
5880
  :param str symbol: unified market symbol
5765
5881
  :param str code: unified currency code of the currency to repay
5766
5882
  :param float amount: the amount to repay
@@ -5787,11 +5903,12 @@ class gate(Exchange, ImplicitAPI):
5787
5903
  def repay_cross_margin(self, code: str, amount, params={}):
5788
5904
  """
5789
5905
  repay cross margin borrowed margin and interest
5790
- :see: https://www.gate.io/docs/developers/apiv4/en/#cross-margin-repayments
5791
- :see: https://www.gate.io/docs/developers/apiv4/en/#borrow-or-repay
5906
+
5907
+ https://www.gate.io/docs/developers/apiv4/en/#cross-margin-repayments
5908
+ https://www.gate.io/docs/developers/apiv4/en/#borrow-or-repay
5909
+
5792
5910
  :param str code: unified currency code of the currency to repay
5793
5911
  :param float amount: the amount to repay
5794
- :param str symbol: unified market symbol, required for isolated margin
5795
5912
  :param dict [params]: extra parameters specific to the exchange API endpoint
5796
5913
  :param str [params.mode]: 'all' or 'partial' payment mode, extra parameter required for isolated margin
5797
5914
  :param str [params.id]: '34267567' loan id, extra parameter required for isolated margin
@@ -5835,10 +5952,12 @@ class gate(Exchange, ImplicitAPI):
5835
5952
  def borrow_isolated_margin(self, symbol: str, code: str, amount: float, params={}):
5836
5953
  """
5837
5954
  create a loan to borrow margin
5838
- :see: https://www.gate.io/docs/developers/apiv4/en/#marginuni
5955
+
5956
+ https://www.gate.io/docs/developers/apiv4/en/#marginuni
5957
+
5958
+ :param str symbol: unified market symbol, required for isolated margin
5839
5959
  :param str code: unified currency code of the currency to borrow
5840
5960
  :param float amount: the amount to borrow
5841
- :param str symbol: unified market symbol, required for isolated margin
5842
5961
  :param dict [params]: extra parameters specific to the exchange API endpoint
5843
5962
  :param str [params.rate]: '0.0002' or '0.002' extra parameter required for isolated margin
5844
5963
  :returns dict: a `margin loan structure <https://docs.ccxt.com/#/?id=margin-loan-structure>`
@@ -5878,11 +5997,12 @@ class gate(Exchange, ImplicitAPI):
5878
5997
  def borrow_cross_margin(self, code: str, amount: float, params={}):
5879
5998
  """
5880
5999
  create a loan to borrow margin
5881
- :see: https://www.gate.io/docs/apiv4/en/#create-a-cross-margin-borrow-loan
5882
- :see: https://www.gate.io/docs/developers/apiv4/en/#borrow-or-repay
6000
+
6001
+ https://www.gate.io/docs/apiv4/en/#create-a-cross-margin-borrow-loan
6002
+ https://www.gate.io/docs/developers/apiv4/en/#borrow-or-repay
6003
+
5883
6004
  :param str code: unified currency code of the currency to borrow
5884
6005
  :param float amount: the amount to borrow
5885
- :param str symbol: unified market symbol, required for isolated margin
5886
6006
  :param dict [params]: extra parameters specific to the exchange API endpoint
5887
6007
  :param str [params.rate]: '0.0002' or '0.002' extra parameter required for isolated margin
5888
6008
  :param boolean [params.unifiedAccount]: set to True for borrowing in the unified account
@@ -5975,9 +6095,11 @@ class gate(Exchange, ImplicitAPI):
5975
6095
  def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[BorrowInterest]:
5976
6096
  """
5977
6097
  fetch the interest owed by the user for borrowing currency for margin trading
5978
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-interest-records
5979
- :see: https://www.gate.io/docs/developers/apiv4/en/#interest-records-for-the-cross-margin-account
5980
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-interest-records-2
6098
+
6099
+ https://www.gate.io/docs/developers/apiv4/en/#list-interest-records
6100
+ https://www.gate.io/docs/developers/apiv4/en/#interest-records-for-the-cross-margin-account
6101
+ https://www.gate.io/docs/developers/apiv4/en/#list-interest-records-2
6102
+
5981
6103
  :param str [code]: unified currency code
5982
6104
  :param str [symbol]: unified market symbol when fetching interest in isolated markets
5983
6105
  :param int [since]: the earliest time in ms to fetch borrow interest for
@@ -6169,8 +6291,10 @@ class gate(Exchange, ImplicitAPI):
6169
6291
  def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
6170
6292
  """
6171
6293
  remove margin from a position
6172
- :see: https://www.gate.io/docs/developers/apiv4/en/#update-position-margin
6173
- :see: https://www.gate.io/docs/developers/apiv4/en/#update-position-margin-2
6294
+
6295
+ https://www.gate.io/docs/developers/apiv4/en/#update-position-margin
6296
+ https://www.gate.io/docs/developers/apiv4/en/#update-position-margin-2
6297
+
6174
6298
  :param str symbol: unified market symbol
6175
6299
  :param float amount: the amount of margin to remove
6176
6300
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -6181,8 +6305,10 @@ class gate(Exchange, ImplicitAPI):
6181
6305
  def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
6182
6306
  """
6183
6307
  add margin
6184
- :see: https://www.gate.io/docs/developers/apiv4/en/#update-position-margin
6185
- :see: https://www.gate.io/docs/developers/apiv4/en/#update-position-margin-2
6308
+
6309
+ https://www.gate.io/docs/developers/apiv4/en/#update-position-margin
6310
+ https://www.gate.io/docs/developers/apiv4/en/#update-position-margin-2
6311
+
6186
6312
  :param str symbol: unified market symbol
6187
6313
  :param float amount: amount of margin to add
6188
6314
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -6193,7 +6319,9 @@ class gate(Exchange, ImplicitAPI):
6193
6319
  def fetch_open_interest_history(self, symbol: str, timeframe='5m', since: Int = None, limit: Int = None, params={}):
6194
6320
  """
6195
6321
  Retrieves the open interest of a currency
6196
- :see: https://www.gate.io/docs/developers/apiv4/en/#futures-stats
6322
+
6323
+ https://www.gate.io/docs/developers/apiv4/en/#futures-stats
6324
+
6197
6325
  :param str symbol: Unified CCXT market symbol
6198
6326
  :param str timeframe: "5m", "15m", "30m", "1h", "4h", "1d"
6199
6327
  :param int [since]: the time(ms) of the earliest record to retrieve unix timestamp
@@ -6275,7 +6403,9 @@ class gate(Exchange, ImplicitAPI):
6275
6403
  def fetch_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
6276
6404
  """
6277
6405
  fetches historical settlement records
6278
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-settlement-history-2
6406
+
6407
+ https://www.gate.io/docs/developers/apiv4/en/#list-settlement-history-2
6408
+
6279
6409
  :param str symbol: unified market symbol of the settlement history, required on gate
6280
6410
  :param int [since]: timestamp in ms
6281
6411
  :param int [limit]: number of records
@@ -6319,7 +6449,9 @@ class gate(Exchange, ImplicitAPI):
6319
6449
  def fetch_my_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
6320
6450
  """
6321
6451
  fetches historical settlement records of the user
6322
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-my-options-settlements
6452
+
6453
+ https://www.gate.io/docs/developers/apiv4/en/#list-my-options-settlements
6454
+
6323
6455
  :param str symbol: unified market symbol of the settlement history
6324
6456
  :param int [since]: timestamp in ms
6325
6457
  :param int [limit]: number of records
@@ -6442,11 +6574,13 @@ class gate(Exchange, ImplicitAPI):
6442
6574
  def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
6443
6575
  """
6444
6576
  fetch the history of changes, actions done by the user or operations that altered the balance of the user
6445
- :see: https://www.gate.io/docs/developers/apiv4/en/#query-account-book
6446
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-margin-account-balance-change-history
6447
- :see: https://www.gate.io/docs/developers/apiv4/en/#query-account-book-2
6448
- :see: https://www.gate.io/docs/developers/apiv4/en/#query-account-book-3
6449
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-account-changing-history
6577
+
6578
+ https://www.gate.io/docs/developers/apiv4/en/#query-account-book
6579
+ https://www.gate.io/docs/developers/apiv4/en/#list-margin-account-balance-change-history
6580
+ https://www.gate.io/docs/developers/apiv4/en/#query-account-book-2
6581
+ https://www.gate.io/docs/developers/apiv4/en/#query-account-book-3
6582
+ https://www.gate.io/docs/developers/apiv4/en/#list-account-changing-history
6583
+
6450
6584
  :param str [code]: unified currency code
6451
6585
  :param int [since]: timestamp in ms of the earliest ledger entry
6452
6586
  :param int [limit]: max number of ledger entries to return
@@ -6671,7 +6805,9 @@ class gate(Exchange, ImplicitAPI):
6671
6805
  def set_position_mode(self, hedged: bool, symbol: Str = None, params={}):
6672
6806
  """
6673
6807
  set dual/hedged mode to True or False for a swap market, make sure all positions are closed and no orders are open before setting dual mode
6674
- :see: https://www.gate.io/docs/developers/apiv4/en/#enable-or-disable-dual-mode
6808
+
6809
+ https://www.gate.io/docs/developers/apiv4/en/#enable-or-disable-dual-mode
6810
+
6675
6811
  :param bool hedged: set to True to enable dual mode
6676
6812
  :param str|None symbol: if passed, dual mode is set for all markets with the same settle currency
6677
6813
  :param dict params: extra parameters specific to the exchange API endpoint
@@ -6686,7 +6822,9 @@ class gate(Exchange, ImplicitAPI):
6686
6822
  def fetch_underlying_assets(self, params={}):
6687
6823
  """
6688
6824
  fetches the market ids of underlying assets for a specific contract market type
6689
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-underlyings
6825
+
6826
+ https://www.gate.io/docs/developers/apiv4/en/#list-all-underlyings
6827
+
6690
6828
  :param dict [params]: exchange specific params
6691
6829
  :param str [params.type]: the contract market type, 'option', 'swap' or 'future', the default is 'option'
6692
6830
  :returns dict[]: a list of `underlying assets <https://docs.ccxt.com/#/?id=underlying-assets-structure>`
@@ -6719,7 +6857,9 @@ class gate(Exchange, ImplicitAPI):
6719
6857
  def fetch_liquidations(self, symbol: str, since: Int = None, limit: Int = None, params={}):
6720
6858
  """
6721
6859
  retrieves the public liquidations of a trading pair
6722
- :see: https://www.gate.io/docs/developers/apiv4/en/#retrieve-liquidation-history
6860
+
6861
+ https://www.gate.io/docs/developers/apiv4/en/#retrieve-liquidation-history
6862
+
6723
6863
  :param str symbol: unified CCXT market symbol
6724
6864
  :param int [since]: the earliest time in ms to fetch liquidations for
6725
6865
  :param int [limit]: the maximum number of liquidation structures to retrieve
@@ -6758,9 +6898,11 @@ class gate(Exchange, ImplicitAPI):
6758
6898
  def fetch_my_liquidations(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
6759
6899
  """
6760
6900
  retrieves the users liquidated positions
6761
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-liquidation-history
6762
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-liquidation-history-2
6763
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-user-s-liquidation-history-of-specified-underlying
6901
+
6902
+ https://www.gate.io/docs/developers/apiv4/en/#list-liquidation-history
6903
+ https://www.gate.io/docs/developers/apiv4/en/#list-liquidation-history-2
6904
+ https://www.gate.io/docs/developers/apiv4/en/#list-user-s-liquidation-history-of-specified-underlying
6905
+
6764
6906
  :param str symbol: unified CCXT market symbol
6765
6907
  :param int [since]: the earliest time in ms to fetch liquidations for
6766
6908
  :param int [limit]: the maximum number of liquidation structures to retrieve
@@ -6893,7 +7035,9 @@ class gate(Exchange, ImplicitAPI):
6893
7035
  def fetch_greeks(self, symbol: str, params={}) -> Greeks:
6894
7036
  """
6895
7037
  fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
6896
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
7038
+
7039
+ https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
7040
+
6897
7041
  :param str symbol: unified symbol of the market to fetch greeks for
6898
7042
  :param dict [params]: extra parameters specific to the exchange API endpoint
6899
7043
  :returns dict: a `greeks structure <https://docs.ccxt.com/#/?id=greeks-structure>`
@@ -6982,9 +7126,11 @@ class gate(Exchange, ImplicitAPI):
6982
7126
  def close_position(self, symbol: str, side: OrderSide = None, params={}) -> Order:
6983
7127
  """
6984
7128
  closes open positions for a market
6985
- :see: https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order
6986
- :see: https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order-2
6987
- :see: https://www.gate.io/docs/developers/apiv4/en/#create-an-options-order
7129
+
7130
+ https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order
7131
+ https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order-2
7132
+ https://www.gate.io/docs/developers/apiv4/en/#create-an-options-order
7133
+
6988
7134
  :param str symbol: Unified CCXT market symbol
6989
7135
  :param str side: 'buy' or 'sell'
6990
7136
  :param dict [params]: extra parameters specific to the okx api endpoint
@@ -7001,9 +7147,11 @@ class gate(Exchange, ImplicitAPI):
7001
7147
  def fetch_leverage(self, symbol: str, params={}) -> Leverage:
7002
7148
  """
7003
7149
  fetch the set leverage for a market
7004
- :see: https://www.gate.io/docs/developers/apiv4/en/#get-unified-account-information
7005
- :see: https://www.gate.io/docs/developers/apiv4/en/#get-detail-of-lending-market
7006
- :see: https://www.gate.io/docs/developers/apiv4/en/#query-one-single-margin-currency-pair-deprecated
7150
+
7151
+ https://www.gate.io/docs/developers/apiv4/en/#get-unified-account-information
7152
+ https://www.gate.io/docs/developers/apiv4/en/#get-detail-of-lending-market
7153
+ https://www.gate.io/docs/developers/apiv4/en/#query-one-single-margin-currency-pair-deprecated
7154
+
7007
7155
  :param str symbol: unified market symbol
7008
7156
  :param dict [params]: extra parameters specific to the exchange API endpoint
7009
7157
  :param boolean [params.unified]: default False, set to True for fetching the unified accounts leverage
@@ -7103,8 +7251,10 @@ class gate(Exchange, ImplicitAPI):
7103
7251
  def fetch_leverages(self, symbols: Strings = None, params={}) -> Leverages:
7104
7252
  """
7105
7253
  fetch the set leverage for all leverage markets, only spot margin is supported on gate
7106
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-lending-markets
7107
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-supported-currency-pairs-supported-in-margin-trading-deprecated
7254
+
7255
+ https://www.gate.io/docs/developers/apiv4/en/#list-lending-markets
7256
+ https://www.gate.io/docs/developers/apiv4/en/#list-all-supported-currency-pairs-supported-in-margin-trading-deprecated
7257
+
7108
7258
  :param str[] symbols: a list of unified market symbols
7109
7259
  :param dict [params]: extra parameters specific to the exchange API endpoint
7110
7260
  :param boolean [params.unified]: default False, set to True for fetching unified account leverages
@@ -7161,7 +7311,9 @@ class gate(Exchange, ImplicitAPI):
7161
7311
  def fetch_option(self, symbol: str, params={}) -> Option:
7162
7312
  """
7163
7313
  fetches option data that is commonly found in an option chain
7164
- :see: https://www.gate.io/docs/developers/apiv4/en/#query-specified-contract-detail
7314
+
7315
+ https://www.gate.io/docs/developers/apiv4/en/#query-specified-contract-detail
7316
+
7165
7317
  :param str symbol: unified market symbol
7166
7318
  :param dict [params]: extra parameters specific to the exchange API endpoint
7167
7319
  :returns dict: an `option chain structure <https://docs.ccxt.com/#/?id=option-chain-structure>`
@@ -7217,8 +7369,10 @@ class gate(Exchange, ImplicitAPI):
7217
7369
  def fetch_option_chain(self, code: str, params={}) -> OptionChain:
7218
7370
  """
7219
7371
  fetches data for an underlying asset that is commonly found in an option chain
7220
- :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-the-contracts-with-specified-underlying-and-expiration-time
7221
- :param str currency: base currency to fetch an option chain for
7372
+
7373
+ https://www.gate.io/docs/developers/apiv4/en/#list-all-the-contracts-with-specified-underlying-and-expiration-time
7374
+
7375
+ :param str code: base currency to fetch an option chain for
7222
7376
  :param dict [params]: extra parameters specific to the exchange API endpoint
7223
7377
  :param str [params.underlying]: the underlying asset, can be obtained from fetchUnderlyingAssets()
7224
7378
  :param int [params.expiration]: unix timestamp of the expiration time
@@ -7341,18 +7495,20 @@ class gate(Exchange, ImplicitAPI):
7341
7495
  def fetch_positions_history(self, symbols: Strings = None, since: Int = None, limit: Int = None, params={}) -> List[Position]:
7342
7496
  """
7343
7497
  fetches historical positions
7344
- :see: https://www.gate.io/docs/developers/apiv4/#list-position-close-history
7345
- :see: https://www.gate.io/docs/developers/apiv4/#list-position-close-history-2
7498
+
7499
+ https://www.gate.io/docs/developers/apiv4/#list-position-close-history
7500
+ https://www.gate.io/docs/developers/apiv4/#list-position-close-history-2
7501
+
7346
7502
  :param str[] symbols: unified conract symbols, must all have the same settle currency and the same market type
7347
7503
  :param int [since]: the earliest time in ms to fetch positions for
7348
7504
  :param int [limit]: the maximum amount of records to fetch, default=1000
7349
7505
  :param dict params: extra parameters specific to the exchange api endpoint
7350
7506
  :param int [params.until]: the latest time in ms to fetch positions for
7351
- *
7352
- * EXCHANGE SPECIFIC PARAMETERS
7353
- :param int offset: list offset, starting from 0
7354
- :param str side: long or short
7355
- :param str pnl: query profit or loss
7507
+
7508
+ EXCHANGE SPECIFIC PARAMETERS
7509
+ :param int [params.offset]: list offset, starting from 0
7510
+ :param str [params.side]: long or short
7511
+ :param str [params.pnl]: query profit or loss
7356
7512
  :returns dict[]: a list of `position structures <https://docs.ccxt.com/#/?id=position-structure>`
7357
7513
  """
7358
7514
  self.load_markets()