ccxt 4.1.75__py2.py3-none-any.whl → 4.1.77__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 (114) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/binance.py +2 -0
  3. ccxt/abstract/binancecoinm.py +2 -0
  4. ccxt/abstract/binanceus.py +2 -0
  5. ccxt/abstract/binanceusdm.py +2 -0
  6. ccxt/abstract/okx.py +23 -9
  7. ccxt/ace.py +2 -0
  8. ccxt/alpaca.py +2 -0
  9. ccxt/async_support/__init__.py +1 -1
  10. ccxt/async_support/ace.py +2 -0
  11. ccxt/async_support/alpaca.py +2 -0
  12. ccxt/async_support/base/exchange.py +7 -1
  13. ccxt/async_support/binance.py +4 -0
  14. ccxt/async_support/binanceus.py +2 -0
  15. ccxt/async_support/bingx.py +76 -25
  16. ccxt/async_support/bit2c.py +2 -0
  17. ccxt/async_support/bitbank.py +2 -0
  18. ccxt/async_support/bithumb.py +2 -0
  19. ccxt/async_support/bitmex.py +5 -1
  20. ccxt/async_support/bitopro.py +2 -0
  21. ccxt/async_support/bitpanda.py +2 -0
  22. ccxt/async_support/bitrue.py +24 -1
  23. ccxt/async_support/bitso.py +2 -0
  24. ccxt/async_support/bitstamp.py +5 -2
  25. ccxt/async_support/bittrex.py +2 -0
  26. ccxt/async_support/bitvavo.py +2 -0
  27. ccxt/async_support/bl3p.py +2 -0
  28. ccxt/async_support/btcalpha.py +2 -0
  29. ccxt/async_support/btcbox.py +2 -0
  30. ccxt/async_support/btcmarkets.py +2 -0
  31. ccxt/async_support/btcturk.py +2 -0
  32. ccxt/async_support/bybit.py +2 -0
  33. ccxt/async_support/coinbase.py +33 -6
  34. ccxt/async_support/coincheck.py +2 -0
  35. ccxt/async_support/coinlist.py +2 -0
  36. ccxt/async_support/coinmate.py +2 -0
  37. ccxt/async_support/coinone.py +2 -0
  38. ccxt/async_support/coinsph.py +2 -0
  39. ccxt/async_support/coinspot.py +2 -0
  40. ccxt/async_support/cryptocom.py +2 -167
  41. ccxt/async_support/gate.py +1 -0
  42. ccxt/async_support/gemini.py +2 -0
  43. ccxt/async_support/idex.py +2 -0
  44. ccxt/async_support/independentreserve.py +2 -0
  45. ccxt/async_support/indodax.py +2 -0
  46. ccxt/async_support/kucoin.py +2 -0
  47. ccxt/async_support/kuna.py +2 -0
  48. ccxt/async_support/latoken.py +2 -0
  49. ccxt/async_support/luno.py +2 -0
  50. ccxt/async_support/mercado.py +2 -0
  51. ccxt/async_support/mexc.py +2 -0
  52. ccxt/async_support/ndax.py +2 -0
  53. ccxt/async_support/novadax.py +2 -0
  54. ccxt/async_support/okx.py +25 -10
  55. ccxt/async_support/p2b.py +2 -0
  56. ccxt/async_support/wavesexchange.py +2 -0
  57. ccxt/async_support/wazirx.py +2 -0
  58. ccxt/async_support/woo.py +2 -0
  59. ccxt/async_support/yobit.py +2 -0
  60. ccxt/async_support/zonda.py +2 -0
  61. ccxt/base/exchange.py +7 -1
  62. ccxt/binance.py +4 -0
  63. ccxt/binanceus.py +2 -0
  64. ccxt/bingx.py +76 -25
  65. ccxt/bit2c.py +2 -0
  66. ccxt/bitbank.py +2 -0
  67. ccxt/bithumb.py +2 -0
  68. ccxt/bitmex.py +5 -1
  69. ccxt/bitopro.py +2 -0
  70. ccxt/bitpanda.py +2 -0
  71. ccxt/bitrue.py +24 -1
  72. ccxt/bitso.py +2 -0
  73. ccxt/bitstamp.py +5 -2
  74. ccxt/bittrex.py +2 -0
  75. ccxt/bitvavo.py +2 -0
  76. ccxt/bl3p.py +2 -0
  77. ccxt/btcalpha.py +2 -0
  78. ccxt/btcbox.py +2 -0
  79. ccxt/btcmarkets.py +2 -0
  80. ccxt/btcturk.py +2 -0
  81. ccxt/bybit.py +2 -0
  82. ccxt/coinbase.py +33 -6
  83. ccxt/coincheck.py +2 -0
  84. ccxt/coinlist.py +2 -0
  85. ccxt/coinmate.py +2 -0
  86. ccxt/coinone.py +2 -0
  87. ccxt/coinsph.py +2 -0
  88. ccxt/coinspot.py +2 -0
  89. ccxt/cryptocom.py +2 -167
  90. ccxt/gate.py +1 -0
  91. ccxt/gemini.py +2 -0
  92. ccxt/idex.py +2 -0
  93. ccxt/independentreserve.py +2 -0
  94. ccxt/indodax.py +2 -0
  95. ccxt/kucoin.py +2 -0
  96. ccxt/kuna.py +2 -0
  97. ccxt/latoken.py +2 -0
  98. ccxt/luno.py +2 -0
  99. ccxt/mercado.py +2 -0
  100. ccxt/mexc.py +2 -0
  101. ccxt/ndax.py +2 -0
  102. ccxt/novadax.py +2 -0
  103. ccxt/okx.py +25 -10
  104. ccxt/p2b.py +2 -0
  105. ccxt/pro/__init__.py +1 -1
  106. ccxt/wavesexchange.py +2 -0
  107. ccxt/wazirx.py +2 -0
  108. ccxt/woo.py +2 -0
  109. ccxt/yobit.py +2 -0
  110. ccxt/zonda.py +2 -0
  111. {ccxt-4.1.75.dist-info → ccxt-4.1.77.dist-info}/METADATA +4 -4
  112. {ccxt-4.1.75.dist-info → ccxt-4.1.77.dist-info}/RECORD +114 -114
  113. {ccxt-4.1.75.dist-info → ccxt-4.1.77.dist-info}/WHEEL +0 -0
  114. {ccxt-4.1.75.dist-info → ccxt-4.1.77.dist-info}/top_level.txt +0 -0
@@ -34,6 +34,8 @@ class btcalpha(Exchange, ImplicitAPI):
34
34
  'option': False,
35
35
  'addMargin': False,
36
36
  'cancelOrder': True,
37
+ 'closeAllPositions': False,
38
+ 'closePosition': False,
37
39
  'createOrder': True,
38
40
  'createReduceOnlyOrder': False,
39
41
  'createStopLimitOrder': False,
@@ -40,6 +40,8 @@ class btcbox(Exchange, ImplicitAPI):
40
40
  'option': False,
41
41
  'addMargin': False,
42
42
  'cancelOrder': True,
43
+ 'closeAllPositions': False,
44
+ 'closePosition': False,
43
45
  'createOrder': True,
44
46
  'createReduceOnlyOrder': False,
45
47
  'fetchBalance': True,
@@ -38,6 +38,8 @@ class btcmarkets(Exchange, ImplicitAPI):
38
38
  'addMargin': False,
39
39
  'cancelOrder': True,
40
40
  'cancelOrders': True,
41
+ 'closeAllPositions': False,
42
+ 'closePosition': False,
41
43
  'createOrder': True,
42
44
  'createReduceOnlyOrder': False,
43
45
  'fetchBalance': True,
@@ -35,6 +35,8 @@ class btcturk(Exchange, ImplicitAPI):
35
35
  'option': False,
36
36
  'addMargin': False,
37
37
  'cancelOrder': True,
38
+ 'closeAllPositions': False,
39
+ 'closePosition': False,
38
40
  'createOrder': True,
39
41
  'createReduceOnlyOrder': False,
40
42
  'fetchBalance': True,
@@ -51,6 +51,8 @@ class bybit(Exchange, ImplicitAPI):
51
51
  'borrowCrossMargin': True,
52
52
  'cancelAllOrders': True,
53
53
  'cancelOrder': True,
54
+ 'closeAllPositions': False,
55
+ 'closePosition': False,
54
56
  'createMarketBuyOrderWithCost': True,
55
57
  'createMarketSellOrderWithCost': False,
56
58
  'createOrder': True,
@@ -45,11 +45,16 @@ class coinbase(Exchange, ImplicitAPI):
45
45
  'addMargin': False,
46
46
  'cancelOrder': True,
47
47
  'cancelOrders': True,
48
+ 'closeAllPositions': False,
49
+ 'closePosition': False,
48
50
  'createDepositAddress': True,
49
51
  'createLimitBuyOrder': True,
50
52
  'createLimitSellOrder': True,
51
53
  'createMarketBuyOrder': True,
54
+ 'createMarketBuyOrderWithCost': True,
55
+ 'createMarketOrderWithCost': False,
52
56
  'createMarketSellOrder': True,
57
+ 'createMarketSellOrderWithCost': False,
53
58
  'createOrder': True,
54
59
  'createPostOnlyOrder': True,
55
60
  'createReduceOnlyOrder': False,
@@ -2008,6 +2013,22 @@ class coinbase(Exchange, ImplicitAPI):
2008
2013
  request['limit'] = limit
2009
2014
  return request
2010
2015
 
2016
+ async def create_market_buy_order_with_cost(self, symbol: str, cost, params={}):
2017
+ """
2018
+ create a market buy order by providing the symbol and cost
2019
+ :see: https://docs.cloud.coinbase.com/advanced-trade-api/reference/retailbrokerageapi_postorder
2020
+ :param str symbol: unified symbol of the market to create an order in
2021
+ :param float cost: how much you want to trade in units of the quote currency
2022
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2023
+ :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
2024
+ """
2025
+ await self.load_markets()
2026
+ market = self.market(symbol)
2027
+ if not market['spot']:
2028
+ raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
2029
+ params['createMarketBuyOrderRequiresPrice'] = False
2030
+ return await self.create_order(symbol, 'market', 'buy', cost, None, params)
2031
+
2011
2032
  async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
2012
2033
  """
2013
2034
  create a trade order
@@ -2026,6 +2047,7 @@ class coinbase(Exchange, ImplicitAPI):
2026
2047
  :param str [params.timeInForce]: 'GTC', 'IOC', 'GTD' or 'PO'
2027
2048
  :param str [params.stop_direction]: 'UNKNOWN_STOP_DIRECTION', 'STOP_DIRECTION_STOP_UP', 'STOP_DIRECTION_STOP_DOWN' the direction the stopPrice is triggered from
2028
2049
  :param str [params.end_time]: '2023-05-25T17:01:05.092Z' for 'GTD' orders
2050
+ :param float [params.cost]: *spot market buy only* the quote quantity that can be used alternative for the amount
2029
2051
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
2030
2052
  """
2031
2053
  await self.load_markets()
@@ -2112,18 +2134,23 @@ class coinbase(Exchange, ImplicitAPI):
2112
2134
  if isStop or isStopLoss or isTakeProfit:
2113
2135
  raise NotSupported(self.id + ' createOrder() only stop limit orders are supported')
2114
2136
  if side == 'buy':
2115
- createMarketBuyOrderRequiresPrice = self.safe_value(self.options, 'createMarketBuyOrderRequiresPrice', True)
2116
2137
  total = None
2117
- if createMarketBuyOrderRequiresPrice:
2138
+ createMarketBuyOrderRequiresPrice = True
2139
+ createMarketBuyOrderRequiresPrice, params = self.handle_option_and_params(params, 'createOrder', 'createMarketBuyOrderRequiresPrice', True)
2140
+ cost = self.safe_number(params, 'cost')
2141
+ params = self.omit(params, 'cost')
2142
+ if cost is not None:
2143
+ total = self.cost_to_precision(symbol, cost)
2144
+ elif createMarketBuyOrderRequiresPrice:
2118
2145
  if price is None:
2119
- raise InvalidOrder(self.id + ' createOrder() requires a price argument for market buy orders on spot markets to calculate the total amount to spend(amount * price), alternatively set the createMarketBuyOrderRequiresPrice option to False and pass in the cost to spend into the amount parameter')
2146
+ raise InvalidOrder(self.id + ' createOrder() requires a price argument for market buy orders on spot markets to calculate the total amount to spend(amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to False and pass the cost to spend in the amount argument')
2120
2147
  else:
2121
2148
  amountString = self.number_to_string(amount)
2122
2149
  priceString = self.number_to_string(price)
2123
- cost = self.parse_number(Precise.string_mul(amountString, priceString))
2124
- total = self.price_to_precision(symbol, cost)
2150
+ costRequest = Precise.string_mul(amountString, priceString)
2151
+ total = self.cost_to_precision(symbol, costRequest)
2125
2152
  else:
2126
- total = self.price_to_precision(symbol, amount)
2153
+ total = self.cost_to_precision(symbol, amount)
2127
2154
  request['order_configuration'] = {
2128
2155
  'market_market_ioc': {
2129
2156
  'quote_size': total,
@@ -31,6 +31,8 @@ class coincheck(Exchange, ImplicitAPI):
31
31
  'option': False,
32
32
  'addMargin': False,
33
33
  'cancelOrder': True,
34
+ 'closeAllPositions': False,
35
+ 'closePosition': False,
34
36
  'createOrder': True,
35
37
  'createReduceOnlyOrder': False,
36
38
  'fetchBalance': True,
@@ -48,6 +48,8 @@ class coinlist(Exchange, ImplicitAPI):
48
48
  'cancelAllOrders': True,
49
49
  'cancelOrder': True,
50
50
  'cancelOrders': True,
51
+ 'closeAllPositions': False,
52
+ 'closePosition': False,
51
53
  'createDepositAddress': False,
52
54
  'createOrder': True,
53
55
  'createPostOnlyOrder': True,
@@ -36,6 +36,8 @@ class coinmate(Exchange, ImplicitAPI):
36
36
  'option': False,
37
37
  'addMargin': False,
38
38
  'cancelOrder': True,
39
+ 'closeAllPositions': False,
40
+ 'closePosition': False,
39
41
  'createOrder': True,
40
42
  'createReduceOnlyOrder': False,
41
43
  'fetchBalance': True,
@@ -38,6 +38,8 @@ class coinone(Exchange, ImplicitAPI):
38
38
  'option': False,
39
39
  'addMargin': False,
40
40
  'cancelOrder': True,
41
+ 'closeAllPositions': False,
42
+ 'closePosition': False,
41
43
  'createMarketOrder': False,
42
44
  'createOrder': True,
43
45
  'createReduceOnlyOrder': False,
@@ -51,6 +51,8 @@ class coinsph(Exchange, ImplicitAPI):
51
51
  'cancelAllOrders': True,
52
52
  'cancelOrder': True,
53
53
  'cancelOrders': False,
54
+ 'closeAllPositions': False,
55
+ 'closePosition': False,
54
56
  'createDepositAddress': False,
55
57
  'createOrder': True,
56
58
  'createPostOnlyOrder': False,
@@ -32,6 +32,8 @@ class coinspot(Exchange, ImplicitAPI):
32
32
  'option': False,
33
33
  'addMargin': False,
34
34
  'cancelOrder': True,
35
+ 'closeAllPositions': False,
36
+ 'closePosition': False,
35
37
  'createMarketOrder': False,
36
38
  'createOrder': True,
37
39
  'createReduceOnlyOrder': False,
@@ -102,7 +102,7 @@ class cryptocom(Exchange, ImplicitAPI):
102
102
  'fetchTradingFees': False,
103
103
  'fetchTransactionFees': False,
104
104
  'fetchTransactions': False,
105
- 'fetchTransfers': True,
105
+ 'fetchTransfers': False,
106
106
  'fetchUnderlyingAssets': False,
107
107
  'fetchVolatilityHistory': False,
108
108
  'fetchWithdrawals': True,
@@ -111,7 +111,7 @@ class cryptocom(Exchange, ImplicitAPI):
111
111
  'setLeverage': False,
112
112
  'setMarginMode': False,
113
113
  'setPositionMode': False,
114
- 'transfer': True,
114
+ 'transfer': False,
115
115
  'withdraw': True,
116
116
  },
117
117
  'timeframes': {
@@ -1707,171 +1707,6 @@ class cryptocom(Exchange, ImplicitAPI):
1707
1707
  withdrawalList = self.safe_value(data, 'withdrawal_list', [])
1708
1708
  return self.parse_transactions(withdrawalList, currency, since, limit)
1709
1709
 
1710
- async def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
1711
- """
1712
- transfer currency internally between wallets on the same account
1713
- :param str code: unified currency code
1714
- :param float amount: amount to transfer
1715
- :param str fromAccount: account to transfer from
1716
- :param str toAccount: account to transfer to
1717
- :param dict [params]: extra parameters specific to the exchange API endpoint
1718
- :returns dict: a `transfer structure <https://docs.ccxt.com/#/?id=transfer-structure>`
1719
- """
1720
- await self.load_markets()
1721
- currency = self.currency(code)
1722
- fromAccount = fromAccount.lower()
1723
- toAccount = toAccount.lower()
1724
- accountsById = self.safe_value(self.options, 'accountsById', {})
1725
- fromId = self.safe_string(accountsById, fromAccount, fromAccount)
1726
- toId = self.safe_string(accountsById, toAccount, toAccount)
1727
- request = {
1728
- 'currency': currency['id'],
1729
- 'amount': float(amount),
1730
- 'from': fromId,
1731
- 'to': toId,
1732
- }
1733
- method = 'v2PrivatePostPrivateDerivTransfer'
1734
- if (fromAccount == 'margin') or (toAccount == 'margin'):
1735
- method = 'v2PrivatePostPrivateMarginTransfer'
1736
- response = await getattr(self, method)(self.extend(request, params))
1737
- #
1738
- # {
1739
- # "id": 11,
1740
- # "method": "private/deriv/transfer",
1741
- # "code": 0
1742
- # }
1743
- #
1744
- return self.parse_transfer(response, currency)
1745
-
1746
- async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
1747
- """
1748
- fetch a history of internal transfers made on an account
1749
- :param str code: unified currency code of the currency transferred
1750
- :param int [since]: the earliest time in ms to fetch transfers for
1751
- :param int [limit]: the maximum number of transfers structures to retrieve
1752
- :param dict [params]: extra parameters specific to the exchange API endpoint
1753
- :returns dict[]: a list of `transfer structures <https://docs.ccxt.com/#/?id=transfer-structure>`
1754
- """
1755
- if not ('direction' in params):
1756
- raise ArgumentsRequired(self.id + ' fetchTransfers() requires a direction param to be either "IN" or "OUT"')
1757
- await self.load_markets()
1758
- currency = None
1759
- request = {
1760
- 'direction': 'OUT',
1761
- }
1762
- if code is not None:
1763
- currency = self.currency(code)
1764
- request['currency'] = currency['id']
1765
- if since is not None:
1766
- request['start_ts'] = since
1767
- if limit is not None:
1768
- request['page_size'] = limit
1769
- method = 'v2PrivatePostPrivateDerivGetTransferHistory'
1770
- marginMode, query = self.custom_handle_margin_mode_and_params('fetchTransfers', params)
1771
- if marginMode is not None:
1772
- method = 'v2PrivatePostPrivateMarginGetTransferHistory'
1773
- response = await getattr(self, method)(self.extend(request, query))
1774
- #
1775
- # {
1776
- # "id": "1641032709328",
1777
- # "method": "private/deriv/get-transfer-history",
1778
- # "code": "0",
1779
- # "result": {
1780
- # "transfer_list": [
1781
- # {
1782
- # "direction": "IN",
1783
- # "time": "1641025185223",
1784
- # "amount": "109.56",
1785
- # "status": "COMPLETED",
1786
- # "information": "From Spot Wallet",
1787
- # "currency": "USDC"
1788
- # }
1789
- # ]
1790
- # }
1791
- # }
1792
- #
1793
- transfer = []
1794
- transfer.append({
1795
- 'response': response,
1796
- })
1797
- return self.parse_transfers(transfer, currency, since, limit, params)
1798
-
1799
- def parse_transfer_status(self, status):
1800
- statuses = {
1801
- 'COMPLETED': 'ok',
1802
- 'PROCESSING': 'pending',
1803
- }
1804
- return self.safe_string(statuses, status, status)
1805
-
1806
- def parse_transfer(self, transfer, currency: Currency = None):
1807
- #
1808
- # {
1809
- # "response": {
1810
- # "id": "1641032709328",
1811
- # "method": "private/deriv/get-transfer-history",
1812
- # "code": "0",
1813
- # "result": {
1814
- # "transfer_list": [
1815
- # {
1816
- # "direction": "IN",
1817
- # "time": "1641025185223",
1818
- # "amount": "109.56",
1819
- # "status": "COMPLETED",
1820
- # "information": "From Spot Wallet",
1821
- # "currency": "USDC"
1822
- # }
1823
- # ]
1824
- # }
1825
- # }
1826
- # }
1827
- #
1828
- response = self.safe_value(transfer, 'response', {})
1829
- result = self.safe_value(response, 'result', {})
1830
- transferList = self.safe_value(result, 'transfer_list', [])
1831
- timestamp = None
1832
- amount = None
1833
- code = None
1834
- information = None
1835
- status = None
1836
- for i in range(0, len(transferList)):
1837
- entry = transferList[i]
1838
- timestamp = self.safe_integer(entry, 'time')
1839
- amount = self.safe_number(entry, 'amount')
1840
- currencyId = self.safe_string(entry, 'currency')
1841
- code = self.safe_currency_code(currencyId)
1842
- information = self.safe_string(entry, 'information')
1843
- rawStatus = self.safe_string(entry, 'status')
1844
- status = self.parse_transfer_status(rawStatus)
1845
- fromAccount = None
1846
- toAccount = None
1847
- if information is not None:
1848
- parts = information.split(' ')
1849
- direction = self.safe_string_lower(parts, 0)
1850
- method = self.safe_string(response, 'method')
1851
- if direction == 'from':
1852
- fromAccount = self.safe_string_lower(parts, 1)
1853
- if method == 'private/margin/get-transfer-history':
1854
- toAccount = 'margin'
1855
- else:
1856
- toAccount = 'derivative'
1857
- elif direction == 'to':
1858
- toAccount = self.safe_string_lower(parts, 1)
1859
- if method == 'private/margin/get-transfer-history':
1860
- fromAccount = 'margin'
1861
- else:
1862
- fromAccount = 'derivative'
1863
- return {
1864
- 'info': transferList,
1865
- 'id': self.safe_string(response, 'id'),
1866
- 'timestamp': timestamp,
1867
- 'datetime': self.iso8601(timestamp),
1868
- 'currency': code,
1869
- 'amount': amount,
1870
- 'fromAccount': fromAccount,
1871
- 'toAccount': toAccount,
1872
- 'status': status,
1873
- }
1874
-
1875
1710
  def parse_ticker(self, ticker, market: Market = None) -> Ticker:
1876
1711
  #
1877
1712
  # fetchTicker
@@ -561,6 +561,7 @@ class gate(Exchange, ImplicitAPI):
561
561
  '15m': '15m',
562
562
  '30m': '30m',
563
563
  '1h': '1h',
564
+ '2h': '2h',
564
565
  '4h': '4h',
565
566
  '8h': '8h',
566
567
  '1d': '1d',
@@ -47,6 +47,8 @@ class gemini(Exchange, ImplicitAPI):
47
47
  'option': False,
48
48
  'addMargin': False,
49
49
  'cancelOrder': True,
50
+ 'closeAllPositions': False,
51
+ 'closePosition': False,
50
52
  'createDepositAddress': True,
51
53
  'createMarketOrder': False,
52
54
  'createOrder': True,
@@ -48,6 +48,8 @@ class idex(Exchange, ImplicitAPI):
48
48
  'cancelAllOrders': True,
49
49
  'cancelOrder': True,
50
50
  'cancelOrders': False,
51
+ 'closeAllPositions': False,
52
+ 'closePosition': False,
51
53
  'createDepositAddress': False,
52
54
  'createOrder': True,
53
55
  'createReduceOnlyOrder': False,
@@ -30,6 +30,8 @@ class independentreserve(Exchange, ImplicitAPI):
30
30
  'option': False,
31
31
  'addMargin': False,
32
32
  'cancelOrder': True,
33
+ 'closeAllPositions': False,
34
+ 'closePosition': False,
33
35
  'createOrder': True,
34
36
  'createReduceOnlyOrder': False,
35
37
  'createStopLimitOrder': False,
@@ -39,6 +39,8 @@ class indodax(Exchange, ImplicitAPI):
39
39
  'cancelAllOrders': False,
40
40
  'cancelOrder': True,
41
41
  'cancelOrders': False,
42
+ 'closeAllPositions': False,
43
+ 'closePosition': False,
42
44
  'createDepositAddress': False,
43
45
  'createOrder': True,
44
46
  'createReduceOnlyOrder': False,
@@ -54,6 +54,8 @@ class kucoin(Exchange, ImplicitAPI):
54
54
  'borrowIsolatedMargin': True,
55
55
  'cancelAllOrders': True,
56
56
  'cancelOrder': True,
57
+ 'closeAllPositions': False,
58
+ 'closePosition': False,
57
59
  'createDepositAddress': True,
58
60
  'createOrder': True,
59
61
  'createOrders': True,
@@ -40,6 +40,8 @@ class kuna(Exchange, ImplicitAPI):
40
40
  'borrowMargin': False,
41
41
  'cancelOrder': True,
42
42
  'cancelOrders': True,
43
+ 'closeAllPositions': False,
44
+ 'closePosition': False,
43
45
  'createDepositAddress': True,
44
46
  'createOrder': True,
45
47
  'createPostOnlyOrder': False,
@@ -42,6 +42,8 @@ class latoken(Exchange, ImplicitAPI):
42
42
  'option': False,
43
43
  'cancelAllOrders': True,
44
44
  'cancelOrder': True,
45
+ 'closeAllPositions': False,
46
+ 'closePosition': False,
45
47
  'createOrder': True,
46
48
  'createPostOnlyOrder': False,
47
49
  'createStopLimitOrder': True,
@@ -33,6 +33,8 @@ class luno(Exchange, ImplicitAPI):
33
33
  'option': False,
34
34
  'addMargin': False,
35
35
  'cancelOrder': True,
36
+ 'closeAllPositions': False,
37
+ 'closePosition': False,
36
38
  'createOrder': True,
37
39
  'createReduceOnlyOrder': False,
38
40
  'fetchAccounts': True,
@@ -32,6 +32,8 @@ class mercado(Exchange, ImplicitAPI):
32
32
  'option': False,
33
33
  'addMargin': False,
34
34
  'cancelOrder': True,
35
+ 'closeAllPositions': False,
36
+ 'closePosition': False,
35
37
  'createMarketOrder': True,
36
38
  'createOrder': True,
37
39
  'createReduceOnlyOrder': False,
@@ -48,6 +48,8 @@ class mexc(Exchange, ImplicitAPI):
48
48
  'cancelAllOrders': True,
49
49
  'cancelOrder': True,
50
50
  'cancelOrders': None,
51
+ 'closeAllPositions': False,
52
+ 'closePosition': False,
51
53
  'createDepositAddress': True,
52
54
  'createOrder': True,
53
55
  'createOrders': True,
@@ -37,6 +37,8 @@ class ndax(Exchange, ImplicitAPI):
37
37
  'addMargin': False,
38
38
  'cancelAllOrders': True,
39
39
  'cancelOrder': True,
40
+ 'closeAllPositions': False,
41
+ 'closePosition': False,
40
42
  'createDepositAddress': True,
41
43
  'createOrder': True,
42
44
  'createReduceOnlyOrder': False,
@@ -46,6 +46,8 @@ class novadax(Exchange, ImplicitAPI):
46
46
  'option': False,
47
47
  'addMargin': False,
48
48
  'cancelOrder': True,
49
+ 'closeAllPositions': False,
50
+ 'closePosition': False,
49
51
  'createOrder': True,
50
52
  'createReduceOnlyOrder': False,
51
53
  'createStopLimitOrder': True,
ccxt/async_support/okx.py CHANGED
@@ -42,7 +42,7 @@ class okx(Exchange, ImplicitAPI):
42
42
  'name': 'OKX',
43
43
  'countries': ['CN', 'US'],
44
44
  'version': 'v5',
45
- 'rateLimit': 100,
45
+ 'rateLimit': 100 * 1.03, # 3% tolerance because of #20229
46
46
  'pro': True,
47
47
  'certified': True,
48
48
  'has': {
@@ -258,6 +258,13 @@ class okx(Exchange, ImplicitAPI):
258
258
  'finance/savings/lending-rate-history': 5 / 3,
259
259
  # public broker
260
260
  'finance/sfp/dcd/products': 2 / 3,
261
+ # copytrading
262
+ 'copytrading/public-lead-traders': 4,
263
+ 'copytrading/public-weekly-pnl': 4,
264
+ 'copytrading/public-stats': 4,
265
+ 'copytrading/public-preference-currency': 4,
266
+ 'copytrading/public-current-subpositions': 4,
267
+ 'copytrading/public-subpositions-history': 4,
261
268
  },
262
269
  },
263
270
  'private': {
@@ -367,12 +374,16 @@ class okx(Exchange, ImplicitAPI):
367
374
  'finance/staking-defi/eth/balance': 5 / 3,
368
375
  'finance/staking-defi/eth/purchase-redeem-history': 5 / 3,
369
376
  # copytrading
370
- 'copytrading/current-subpositions': 4,
371
- 'copytrading/subpositions-history': 10,
372
- 'copytrading/instruments': 10,
373
- 'copytrading/profit-sharing-details': 10,
374
- 'copytrading/total-profit-sharing': 10,
375
- 'copytrading/unrealized-profit-sharing-details': 10,
377
+ 'copytrading/current-subpositions': 1,
378
+ 'copytrading/subpositions-history': 1,
379
+ 'copytrading/instruments': 4,
380
+ 'copytrading/profit-sharing-details': 4,
381
+ 'copytrading/total-profit-sharing': 4,
382
+ 'copytrading/unrealized-profit-sharing-details': 4,
383
+ 'copytrading/copy-settings': 4,
384
+ 'copytrading/batch-leverage-info': 4,
385
+ 'copytrading/current-lead-traders': 4,
386
+ 'copytrading/lead-traders-history': 4,
376
387
  # broker
377
388
  'broker/nd/info': 10,
378
389
  'broker/nd/subaccount-info': 10,
@@ -477,9 +488,13 @@ class okx(Exchange, ImplicitAPI):
477
488
  'finance/staking-defi/eth/purchase': 5,
478
489
  'finance/staking-defi/eth/redeem': 5,
479
490
  # copytrading
480
- 'copytrading/algo-order': 20,
481
- 'copytrading/close-subposition': 4,
482
- 'copytrading/set-instruments': 10,
491
+ 'copytrading/algo-order': 1,
492
+ 'copytrading/close-subposition': 1,
493
+ 'copytrading/set-instruments': 4,
494
+ 'copytrading/first-copy-settings': 4,
495
+ 'copytrading/amend-copy-settings': 4,
496
+ 'copytrading/stop-copy-trading': 4,
497
+ 'copytrading/batch-set-leverage': 4,
483
498
  # broker
484
499
  'broker/nd/create-subaccount': 0.25,
485
500
  'broker/nd/delete-subaccount': 1,
ccxt/async_support/p2b.py CHANGED
@@ -36,6 +36,8 @@ class p2b(Exchange, ImplicitAPI):
36
36
  'cancelAllOrders': False,
37
37
  'cancelOrder': True,
38
38
  'cancelOrders': False,
39
+ 'closeAllPositions': False,
40
+ 'closePosition': False,
39
41
  'createDepositAddress': False,
40
42
  'createMarketOrder': False,
41
43
  'createOrder': True,
@@ -43,6 +43,8 @@ class wavesexchange(Exchange, ImplicitAPI):
43
43
  'option': False,
44
44
  'addMargin': False,
45
45
  'cancelOrder': True,
46
+ 'closeAllPositions': False,
47
+ 'closePosition': False,
46
48
  'createMarketOrder': True,
47
49
  'createOrder': True,
48
50
  'createReduceOnlyOrder': False,
@@ -41,6 +41,8 @@ class wazirx(Exchange, ImplicitAPI):
41
41
  'borrowMargin': False,
42
42
  'cancelAllOrders': True,
43
43
  'cancelOrder': True,
44
+ 'closeAllPositions': False,
45
+ 'closePosition': False,
44
46
  'createOrder': True,
45
47
  'createReduceOnlyOrder': False,
46
48
  'createStopLimitOrder': True,
ccxt/async_support/woo.py CHANGED
@@ -42,6 +42,8 @@ class woo(Exchange, ImplicitAPI):
42
42
  'cancelAllOrders': True,
43
43
  'cancelOrder': True,
44
44
  'cancelWithdraw': False, # exchange have that endpoint disabled atm, but was once implemented in ccxt per old docs: https://kronosresearch.github.io/wootrade-documents/#cancel-withdraw-request
45
+ 'closeAllPositions': False,
46
+ 'closePosition': False,
45
47
  'createDepositAddress': False,
46
48
  'createMarketOrder': False,
47
49
  'createOrder': True,
@@ -41,6 +41,8 @@ class yobit(Exchange, ImplicitAPI):
41
41
  'option': False,
42
42
  'addMargin': False,
43
43
  'cancelOrder': True,
44
+ 'closeAllPositions': False,
45
+ 'closePosition': False,
44
46
  'createDepositAddress': True,
45
47
  'createMarketOrder': False,
46
48
  'createOrder': True,
@@ -44,6 +44,8 @@ class zonda(Exchange, ImplicitAPI):
44
44
  'cancelAllOrders': False,
45
45
  'cancelOrder': True,
46
46
  'cancelOrders': False,
47
+ 'closeAllPositions': False,
48
+ 'closePosition': False,
47
49
  'createDepositAddress': False,
48
50
  'createOrder': True,
49
51
  'createReduceOnlyOrder': False,