ccxt 4.4.41__py2.py3-none-any.whl → 4.4.43__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 (177) hide show
  1. ccxt/__init__.py +3 -1
  2. ccxt/abstract/binance.py +3 -0
  3. ccxt/abstract/binancecoinm.py +3 -0
  4. ccxt/abstract/binanceus.py +3 -0
  5. ccxt/abstract/binanceusdm.py +3 -0
  6. ccxt/abstract/bingx.py +4 -0
  7. ccxt/abstract/bitstamp.py +1 -0
  8. ccxt/abstract/myokx.py +340 -0
  9. ccxt/ace.py +1 -1
  10. ccxt/alpaca.py +0 -1
  11. ccxt/ascendex.py +0 -1
  12. ccxt/async_support/__init__.py +3 -1
  13. ccxt/async_support/ace.py +1 -1
  14. ccxt/async_support/alpaca.py +0 -1
  15. ccxt/async_support/ascendex.py +0 -1
  16. ccxt/async_support/base/exchange.py +15 -15
  17. ccxt/async_support/bigone.py +0 -1
  18. ccxt/async_support/binance.py +3 -0
  19. ccxt/async_support/bingx.py +27 -7
  20. ccxt/async_support/bitfinex.py +122 -0
  21. ccxt/async_support/bitstamp.py +54 -0
  22. ccxt/async_support/blofin.py +16 -7
  23. ccxt/async_support/cex.py +1 -1
  24. ccxt/async_support/coinbase.py +8 -9
  25. ccxt/async_support/coinbaseexchange.py +5 -6
  26. ccxt/async_support/coinbaseinternational.py +7 -8
  27. ccxt/async_support/coincatch.py +0 -1
  28. ccxt/async_support/coincheck.py +0 -1
  29. ccxt/async_support/coinex.py +91 -6
  30. ccxt/async_support/coinlist.py +3 -4
  31. ccxt/async_support/coinmate.py +1 -3
  32. ccxt/async_support/coinmetro.py +4 -5
  33. ccxt/async_support/coinone.py +0 -1
  34. ccxt/async_support/coinsph.py +7 -8
  35. ccxt/async_support/cryptocom.py +3 -0
  36. ccxt/async_support/currencycom.py +3 -4
  37. ccxt/async_support/defx.py +6 -7
  38. ccxt/async_support/deribit.py +1 -3
  39. ccxt/async_support/digifinex.py +0 -1
  40. ccxt/async_support/ellipx.py +0 -2
  41. ccxt/async_support/exmo.py +1 -2
  42. ccxt/async_support/gate.py +1 -2
  43. ccxt/async_support/gemini.py +63 -6
  44. ccxt/async_support/hashkey.py +79 -67
  45. ccxt/async_support/hitbtc.py +47 -5
  46. ccxt/async_support/hollaex.py +4 -6
  47. ccxt/async_support/htx.py +1 -3
  48. ccxt/async_support/huobijp.py +0 -1
  49. ccxt/async_support/hyperliquid.py +1 -1
  50. ccxt/async_support/idex.py +8 -8
  51. ccxt/async_support/independentreserve.py +0 -1
  52. ccxt/async_support/indodax.py +0 -1
  53. ccxt/async_support/kraken.py +63 -3
  54. ccxt/async_support/krakenfutures.py +75 -3
  55. ccxt/async_support/kucoin.py +1 -3
  56. ccxt/async_support/kucoinfutures.py +10 -9
  57. ccxt/async_support/kuna.py +1 -3
  58. ccxt/async_support/latoken.py +1 -3
  59. ccxt/async_support/lbank.py +0 -1
  60. ccxt/async_support/luno.py +0 -1
  61. ccxt/async_support/lykke.py +0 -1
  62. ccxt/async_support/mercado.py +0 -1
  63. ccxt/async_support/mexc.py +3 -4
  64. ccxt/async_support/myokx.py +35 -0
  65. ccxt/async_support/ndax.py +1 -1
  66. ccxt/async_support/novadax.py +4 -6
  67. ccxt/async_support/oceanex.py +0 -1
  68. ccxt/async_support/okcoin.py +1 -3
  69. ccxt/async_support/okx.py +1 -3
  70. ccxt/async_support/onetrading.py +1 -3
  71. ccxt/async_support/p2b.py +1 -1
  72. ccxt/async_support/paradex.py +5 -7
  73. ccxt/async_support/phemex.py +14 -14
  74. ccxt/async_support/poloniex.py +1 -3
  75. ccxt/async_support/poloniexfutures.py +6 -6
  76. ccxt/async_support/probit.py +0 -1
  77. ccxt/async_support/timex.py +0 -1
  78. ccxt/async_support/tokocrypto.py +11 -14
  79. ccxt/async_support/tradeogre.py +1 -1
  80. ccxt/async_support/upbit.py +0 -1
  81. ccxt/async_support/vertex.py +63 -4
  82. ccxt/async_support/wavesexchange.py +4 -5
  83. ccxt/async_support/whitebit.py +8 -9
  84. ccxt/async_support/woo.py +100 -14
  85. ccxt/async_support/woofipro.py +96 -15
  86. ccxt/async_support/xt.py +3 -2
  87. ccxt/async_support/yobit.py +0 -1
  88. ccxt/async_support/zaif.py +0 -1
  89. ccxt/async_support/zonda.py +1 -2
  90. ccxt/base/exchange.py +21 -17
  91. ccxt/bigone.py +0 -1
  92. ccxt/binance.py +3 -0
  93. ccxt/bingx.py +27 -7
  94. ccxt/bitfinex.py +122 -0
  95. ccxt/bitstamp.py +54 -0
  96. ccxt/blofin.py +16 -7
  97. ccxt/cex.py +1 -1
  98. ccxt/coinbase.py +8 -9
  99. ccxt/coinbaseexchange.py +5 -6
  100. ccxt/coinbaseinternational.py +7 -8
  101. ccxt/coincatch.py +0 -1
  102. ccxt/coincheck.py +0 -1
  103. ccxt/coinex.py +91 -6
  104. ccxt/coinlist.py +3 -4
  105. ccxt/coinmate.py +1 -3
  106. ccxt/coinmetro.py +4 -5
  107. ccxt/coinone.py +0 -1
  108. ccxt/coinsph.py +7 -8
  109. ccxt/cryptocom.py +3 -0
  110. ccxt/currencycom.py +3 -4
  111. ccxt/defx.py +6 -7
  112. ccxt/deribit.py +1 -3
  113. ccxt/digifinex.py +0 -1
  114. ccxt/ellipx.py +0 -2
  115. ccxt/exmo.py +1 -2
  116. ccxt/gate.py +1 -2
  117. ccxt/gemini.py +63 -6
  118. ccxt/hashkey.py +79 -67
  119. ccxt/hitbtc.py +47 -5
  120. ccxt/hollaex.py +4 -6
  121. ccxt/htx.py +1 -3
  122. ccxt/huobijp.py +0 -1
  123. ccxt/hyperliquid.py +1 -1
  124. ccxt/idex.py +8 -8
  125. ccxt/independentreserve.py +0 -1
  126. ccxt/indodax.py +0 -1
  127. ccxt/kraken.py +63 -3
  128. ccxt/krakenfutures.py +75 -3
  129. ccxt/kucoin.py +1 -3
  130. ccxt/kucoinfutures.py +10 -9
  131. ccxt/kuna.py +1 -3
  132. ccxt/latoken.py +1 -3
  133. ccxt/lbank.py +0 -1
  134. ccxt/luno.py +0 -1
  135. ccxt/lykke.py +0 -1
  136. ccxt/mercado.py +0 -1
  137. ccxt/mexc.py +3 -4
  138. ccxt/myokx.py +35 -0
  139. ccxt/ndax.py +1 -1
  140. ccxt/novadax.py +4 -6
  141. ccxt/oceanex.py +0 -1
  142. ccxt/okcoin.py +1 -3
  143. ccxt/okx.py +1 -3
  144. ccxt/onetrading.py +1 -3
  145. ccxt/p2b.py +1 -1
  146. ccxt/paradex.py +5 -7
  147. ccxt/phemex.py +14 -14
  148. ccxt/poloniex.py +1 -3
  149. ccxt/poloniexfutures.py +6 -6
  150. ccxt/pro/__init__.py +3 -1
  151. ccxt/pro/myokx.py +23 -0
  152. ccxt/probit.py +0 -1
  153. ccxt/timex.py +0 -1
  154. ccxt/tokocrypto.py +11 -14
  155. ccxt/tradeogre.py +1 -1
  156. ccxt/upbit.py +0 -1
  157. ccxt/vertex.py +63 -4
  158. ccxt/wavesexchange.py +4 -5
  159. ccxt/whitebit.py +8 -9
  160. ccxt/woo.py +100 -14
  161. ccxt/woofipro.py +96 -15
  162. ccxt/xt.py +3 -2
  163. ccxt/yobit.py +0 -1
  164. ccxt/zaif.py +0 -1
  165. ccxt/zonda.py +1 -2
  166. {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/METADATA +37 -35
  167. {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/RECORD +170 -173
  168. ccxt/async_support/bitbay.py +0 -17
  169. ccxt/async_support/bitfinex2.py +0 -3625
  170. ccxt/async_support/hitbtc3.py +0 -16
  171. ccxt/bitbay.py +0 -17
  172. ccxt/bitfinex2.py +0 -3624
  173. ccxt/hitbtc3.py +0 -16
  174. ccxt/pro/bitfinex2.py +0 -1086
  175. {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/LICENSE.txt +0 -0
  176. {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/WHEEL +0 -0
  177. {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/top_level.txt +0 -0
@@ -276,6 +276,78 @@ class krakenfutures(Exchange, ImplicitAPI):
276
276
  'method': 'historyGetMarketSymbolExecutions', # historyGetMarketSymbolExecutions, publicGetHistory
277
277
  },
278
278
  },
279
+ 'features': {
280
+ 'default': {
281
+ 'sandbox': True,
282
+ 'createOrder': {
283
+ 'marginMode': False,
284
+ 'triggerPrice': True,
285
+ 'triggerPriceType': {
286
+ 'last': True,
287
+ 'mark': True,
288
+ 'index': True,
289
+ },
290
+ 'triggerDirection': False,
291
+ 'stopLossPrice': True,
292
+ 'takeProfitPrice': True,
293
+ 'attachedStopLossTakeProfit': None,
294
+ 'timeInForce': {
295
+ 'IOC': True,
296
+ 'FOK': True,
297
+ 'PO': True,
298
+ 'GTD': False,
299
+ },
300
+ 'hedged': False,
301
+ 'trailing': False,
302
+ },
303
+ 'createOrders': {
304
+ 'max': 100,
305
+ },
306
+ 'fetchMyTrades': {
307
+ 'marginMode': False,
308
+ 'limit': None,
309
+ 'daysBack': None,
310
+ 'untilDays': 100000,
311
+ },
312
+ 'fetchOrder': None,
313
+ 'fetchOpenOrders': {
314
+ 'marginMode': False,
315
+ 'limit': None,
316
+ 'trigger': False,
317
+ 'trailing': False,
318
+ },
319
+ 'fetchOrders': None,
320
+ 'fetchClosedOrders': {
321
+ 'marginMode': False,
322
+ 'limit': None,
323
+ 'daysBackClosed': None,
324
+ 'daysBackCanceled': None,
325
+ 'untilDays': None,
326
+ 'trigger': False,
327
+ 'trailing': False,
328
+ },
329
+ 'fetchOHLCV': {
330
+ 'limit': 5000,
331
+ },
332
+ },
333
+ 'spot': None,
334
+ 'swap': {
335
+ 'linear': {
336
+ 'extends': 'default',
337
+ },
338
+ 'inverse': {
339
+ 'extends': 'default',
340
+ },
341
+ },
342
+ 'future': {
343
+ 'linear': {
344
+ 'extends': 'default',
345
+ },
346
+ 'inverse': {
347
+ 'extends': 'default',
348
+ },
349
+ },
350
+ },
279
351
  'timeframes': {
280
352
  '1m': '1m',
281
353
  '5m': '5m',
@@ -1011,7 +1083,7 @@ class krakenfutures(Exchange, ImplicitAPI):
1011
1083
  """
1012
1084
  Create an order on the exchange
1013
1085
 
1014
- https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-send-order
1086
+ https://docs.kraken.com/api/docs/futures-api/trading/send-order
1015
1087
 
1016
1088
  :param str symbol: unified market symbol
1017
1089
  :param str type: 'limit' or 'market'
@@ -1071,7 +1143,7 @@ class krakenfutures(Exchange, ImplicitAPI):
1071
1143
  """
1072
1144
  create a list of trade orders
1073
1145
 
1074
- https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-batch-order-management
1146
+ https://docs.kraken.com/api/docs/futures-api/trading/send-batch-order
1075
1147
 
1076
1148
  :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
1077
1149
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -1804,7 +1876,6 @@ class krakenfutures(Exchange, ImplicitAPI):
1804
1876
  'reduceOnly': self.safe_bool_2(details, 'reduceOnly', 'reduce_only'),
1805
1877
  'side': self.safe_string(details, 'side'),
1806
1878
  'price': price,
1807
- 'stopPrice': self.safe_string(details, 'triggerPrice'),
1808
1879
  'triggerPrice': self.safe_string(details, 'triggerPrice'),
1809
1880
  'amount': amount,
1810
1881
  'cost': cost,
@@ -1834,6 +1905,7 @@ class krakenfutures(Exchange, ImplicitAPI):
1834
1905
  market = None
1835
1906
  if symbol is not None:
1836
1907
  market = self.market(symbol)
1908
+ # todo: lastFillTime: self.iso8601(end)
1837
1909
  response = await self.privateGetFills(params)
1838
1910
  #
1839
1911
  # {
@@ -3043,7 +3043,6 @@ class kucoin(Exchange, ImplicitAPI):
3043
3043
  status = 'canceled'
3044
3044
  if responseStatus == 'fail':
3045
3045
  status = 'rejected'
3046
- stopPrice = self.safe_number(order, 'stopPrice')
3047
3046
  return self.safe_order({
3048
3047
  'info': order,
3049
3048
  'id': self.safe_string_n(order, ['id', 'orderId', 'newOrderId', 'cancelledOrderId']),
@@ -3055,8 +3054,7 @@ class kucoin(Exchange, ImplicitAPI):
3055
3054
  'side': self.safe_string(order, 'side'),
3056
3055
  'amount': self.safe_string(order, 'size'),
3057
3056
  'price': self.safe_string(order, 'price'), # price is zero for market order, omitZero is called in safeOrder2
3058
- 'stopPrice': stopPrice,
3059
- 'triggerPrice': stopPrice,
3057
+ 'triggerPrice': self.safe_number(order, 'stopPrice'),
3060
3058
  'cost': self.safe_string(order, 'dealFunds'),
3061
3059
  'filled': self.safe_string(order, 'dealSize'),
3062
3060
  'remaining': None,
@@ -1498,8 +1498,8 @@ class kucoinfutures(kucoin, ImplicitAPI):
1498
1498
  :param float amount: the amount of currency to trade
1499
1499
  :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1500
1500
  :param dict [params]: extra parameters specific to the exchange API endpoint
1501
- :param dict [params.takeProfit]: *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
1502
- :param dict [params.stopLoss]: *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
1501
+ :param dict [params.takeProfit]: *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered and the triggerPriceType
1502
+ :param dict [params.stopLoss]: *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered and the triggerPriceType
1503
1503
  :param float [params.triggerPrice]: The price a trigger order is triggered at
1504
1504
  :param float [params.stopLossPrice]: price to trigger stop-loss orders
1505
1505
  :param float [params.takeProfitPrice]: price to trigger take-profit orders
@@ -1511,8 +1511,9 @@ class kucoinfutures(kucoin, ImplicitAPI):
1511
1511
  :param float [params.leverage]: Leverage size of the order(mandatory param in request, default is 1)
1512
1512
  :param str [params.clientOid]: client order id, defaults to uuid if not passed
1513
1513
  :param str [params.remark]: remark for the order, length cannot exceed 100 utf8 characters
1514
- :param str [params.stop]: 'up' or 'down', the direction the stopPrice is triggered from, requires stopPrice. down: Triggers when the price reaches or goes below the stopPrice. up: Triggers when the price reaches or goes above the stopPrice.
1515
- :param str [params.stopPriceType]: TP, IP or MP, defaults to MP: Mark Price
1514
+ :param str [params.stop]: 'up' or 'down', the direction the triggerPrice is triggered from, requires triggerPrice. down: Triggers when the price reaches or goes below the triggerPrice. up: Triggers when the price reaches or goes above the triggerPrice.
1515
+ :param str [params.triggerPriceType]: "last", "mark", "index" - defaults to "mark"
1516
+ :param str [params.stopPriceType]: exchange-specific alternative for triggerPriceType: TP, IP or MP
1516
1517
  :param bool [params.closeOrder]: set to True to close position
1517
1518
  :param bool [params.test]: set to True to use the test order endpoint(does not submit order, use to validate params)
1518
1519
  :param bool [params.forceHold]: A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to False by default.
@@ -1632,11 +1633,13 @@ class kucoinfutures(kucoin, ImplicitAPI):
1632
1633
  if stopLoss is not None:
1633
1634
  slPrice = self.safe_string_2(stopLoss, 'triggerPrice', 'stopPrice')
1634
1635
  request['triggerStopDownPrice'] = self.price_to_precision(symbol, slPrice)
1635
- priceType = self.safe_string(stopLoss, 'triggerPriceType', triggerPriceTypeValue)
1636
+ priceType = self.safe_string(stopLoss, 'triggerPriceType', 'mark')
1637
+ priceType = self.safe_string(triggerPriceTypes, priceType, priceType)
1636
1638
  if takeProfit is not None:
1637
1639
  tpPrice = self.safe_string_2(takeProfit, 'triggerPrice', 'takeProfitPrice')
1638
1640
  request['triggerStopUpPrice'] = self.price_to_precision(symbol, tpPrice)
1639
- priceType = self.safe_string(stopLoss, 'triggerPriceType', triggerPriceTypeValue)
1641
+ priceType = self.safe_string(takeProfit, 'triggerPriceType', 'mark')
1642
+ priceType = self.safe_string(triggerPriceTypes, priceType, priceType)
1640
1643
  request['stopPriceType'] = priceType
1641
1644
  elif stopLossPrice or takeProfitPrice:
1642
1645
  if stopLossPrice:
@@ -2266,7 +2269,6 @@ class kucoinfutures(kucoin, ImplicitAPI):
2266
2269
  }
2267
2270
  clientOrderId = self.safe_string(order, 'clientOid')
2268
2271
  timeInForce = self.safe_string(order, 'timeInForce')
2269
- stopPrice = self.safe_number(order, 'stopPrice')
2270
2272
  postOnly = self.safe_value(order, 'postOnly')
2271
2273
  reduceOnly = self.safe_value(order, 'reduceOnly')
2272
2274
  lastUpdateTimestamp = self.safe_integer(order, 'updatedAt')
@@ -2281,8 +2283,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
2281
2283
  'side': side,
2282
2284
  'amount': amount,
2283
2285
  'price': price,
2284
- 'stopPrice': stopPrice,
2285
- 'triggerPrice': stopPrice,
2286
+ 'triggerPrice': self.safe_number(order, 'stopPrice'),
2286
2287
  'cost': cost,
2287
2288
  'filled': filled,
2288
2289
  'remaining': None,
@@ -1091,7 +1091,6 @@ class kuna(Exchange, ImplicitAPI):
1091
1091
  #
1092
1092
  marketId = self.safe_string(order, 'pair')
1093
1093
  datetime = self.safe_string(order, 'createdAt')
1094
- triggerPrice = self.safe_string(order, 'stopPrice')
1095
1094
  side = self.safe_string(order, 'side')
1096
1095
  if side == 'Bid':
1097
1096
  side = 'buy'
@@ -1112,8 +1111,7 @@ class kuna(Exchange, ImplicitAPI):
1112
1111
  'postOnly': None,
1113
1112
  'side': side,
1114
1113
  'price': self.safe_string(order, 'price'),
1115
- 'stopPrice': triggerPrice,
1116
- 'triggerPrice': triggerPrice,
1114
+ 'triggerPrice': self.safe_string(order, 'stopPrice'),
1117
1115
  'amount': self.safe_string(order, 'quantity'),
1118
1116
  'filled': self.safe_string(order, 'executedQuantity'),
1119
1117
  'remaining': None,
@@ -1055,7 +1055,6 @@ class latoken(Exchange, ImplicitAPI):
1055
1055
  status = 'open'
1056
1056
  clientOrderId = self.safe_string(order, 'clientOrderId')
1057
1057
  timeInForce = self.parse_time_in_force(self.safe_string(order, 'condition'))
1058
- triggerPrice = self.safe_string(order, 'stopPrice')
1059
1058
  return self.safe_order({
1060
1059
  'id': id,
1061
1060
  'clientOrderId': clientOrderId,
@@ -1070,8 +1069,7 @@ class latoken(Exchange, ImplicitAPI):
1070
1069
  'postOnly': None,
1071
1070
  'side': side,
1072
1071
  'price': price,
1073
- 'stopPrice': triggerPrice,
1074
- 'triggerPrice': triggerPrice,
1072
+ 'triggerPrice': self.safe_string(order, 'stopPrice'),
1075
1073
  'cost': cost,
1076
1074
  'amount': amount,
1077
1075
  'filled': filled,
@@ -1610,7 +1610,6 @@ class lbank(Exchange, ImplicitAPI):
1610
1610
  'postOnly': postOnly,
1611
1611
  'side': side,
1612
1612
  'price': price,
1613
- 'stopPrice': None,
1614
1613
  'triggerPrice': None,
1615
1614
  'cost': costString,
1616
1615
  'amount': amountString,
@@ -441,7 +441,6 @@ class luno(Exchange, ImplicitAPI):
441
441
  'postOnly': None,
442
442
  'side': side,
443
443
  'price': price,
444
- 'stopPrice': None,
445
444
  'triggerPrice': None,
446
445
  'amount': amount,
447
446
  'filled': filled,
@@ -772,7 +772,6 @@ class lykke(Exchange, ImplicitAPI):
772
772
  'postOnly': None,
773
773
  'side': side,
774
774
  'price': price,
775
- 'stopPrice': None,
776
775
  'triggerPrice': None,
777
776
  'amount': amount,
778
777
  'cost': cost,
@@ -569,7 +569,6 @@ class mercado(Exchange, ImplicitAPI):
569
569
  'postOnly': None,
570
570
  'side': side,
571
571
  'price': price,
572
- 'stopPrice': None,
573
572
  'triggerPrice': None,
574
573
  'cost': None,
575
574
  'average': average,
@@ -2442,11 +2442,11 @@ class mexc(Exchange, ImplicitAPI):
2442
2442
  clientOrderId = self.safe_string_2(params, 'clientOrderId', 'externalOid')
2443
2443
  if clientOrderId is not None:
2444
2444
  request['externalOid'] = clientOrderId
2445
- stopPrice = self.safe_number_2(params, 'triggerPrice', 'stopPrice')
2445
+ triggerPrice = self.safe_number_2(params, 'triggerPrice', 'stopPrice')
2446
2446
  params = self.omit(params, ['clientOrderId', 'externalOid', 'postOnly', 'stopPrice', 'triggerPrice', 'hedged'])
2447
2447
  response = None
2448
- if stopPrice:
2449
- request['triggerPrice'] = self.price_to_precision(symbol, stopPrice)
2448
+ if triggerPrice:
2449
+ request['triggerPrice'] = self.price_to_precision(symbol, triggerPrice)
2450
2450
  request['triggerType'] = self.safe_integer(params, 'triggerType', 1)
2451
2451
  request['executeCycle'] = self.safe_integer(params, 'executeCycle', 1)
2452
2452
  request['trend'] = self.safe_integer(params, 'trend', 1)
@@ -3427,7 +3427,6 @@ class mexc(Exchange, ImplicitAPI):
3427
3427
  'timeInForce': self.parse_order_time_in_force(self.safe_string(order, 'timeInForce')),
3428
3428
  'side': self.parse_order_side(self.safe_string(order, 'side')),
3429
3429
  'price': self.safe_number(order, 'price'),
3430
- 'stopPrice': self.safe_number_2(order, 'stopPrice', 'triggerPrice'),
3431
3430
  'triggerPrice': self.safe_number_2(order, 'stopPrice', 'triggerPrice'),
3432
3431
  'average': self.safe_number(order, 'dealAvgPrice'),
3433
3432
  'amount': self.safe_number_2(order, 'origQty', 'vol'),
@@ -0,0 +1,35 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
4
+ # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
+
6
+ from ccxt.async_support.okx import okx
7
+ from ccxt.abstract.myokx import ImplicitAPI
8
+
9
+
10
+ class myokx(okx, ImplicitAPI):
11
+
12
+ def describe(self):
13
+ return self.deep_extend(super(myokx, self).describe(), {
14
+ 'id': 'myokx',
15
+ 'name': 'MyOKX(EEA)',
16
+ 'certified': False,
17
+ 'pro': True,
18
+ 'hostname': 'eea.okx.com',
19
+ 'urls': {
20
+ 'logo': 'https://user-images.githubusercontent.com/1294454/152485636-38b19e4a-bece-4dec-979a-5982859ffc04.jpg',
21
+ 'api': {
22
+ 'rest': 'https://{hostname}',
23
+ },
24
+ 'www': 'https://my.okx.com',
25
+ 'doc': 'https://my.okx.com/docs-v5/en/#overview',
26
+ 'fees': 'https://my.okx.com/pages/products/fees.html',
27
+ 'referral': {
28
+ 'url': 'https://www.my.okx.com/join/CCXT2023',
29
+ 'discount': 0.2,
30
+ },
31
+ 'test': {
32
+ 'rest': 'https://{hostname}',
33
+ },
34
+ },
35
+ })
@@ -1327,7 +1327,7 @@ class ndax(Exchange, ImplicitAPI):
1327
1327
  'postOnly': None,
1328
1328
  'side': self.safe_string_lower(order, 'Side'),
1329
1329
  'price': self.safe_string(order, 'Price'),
1330
- 'stopPrice': self.parse_number(self.omit_zero(self.safe_string(order, 'StopPrice'))),
1330
+ 'triggerPrice': self.parse_number(self.omit_zero(self.safe_string(order, 'StopPrice'))),
1331
1331
  'cost': self.safe_string(order, 'GrossValueExecuted'),
1332
1332
  'amount': self.safe_string(order, 'OrigQuantity'),
1333
1333
  'filled': self.safe_string(order, 'QuantityExecuted'),
@@ -763,8 +763,8 @@ class novadax(Exchange, ImplicitAPI):
763
763
  # "stopPrice": self.price_to_precision(symbol, stopPrice),
764
764
  # "accountId": "...", # subaccount id, optional
765
765
  }
766
- stopPrice = self.safe_value_2(params, 'triggerPrice', 'stopPrice')
767
- if stopPrice is None:
766
+ triggerPrice = self.safe_value_2(params, 'triggerPrice', 'stopPrice')
767
+ if triggerPrice is None:
768
768
  if (uppercaseType == 'STOP_LIMIT') or (uppercaseType == 'STOP_MARKET'):
769
769
  raise ArgumentsRequired(self.id + ' createOrder() requires a stopPrice parameter for ' + uppercaseType + ' orders')
770
770
  else:
@@ -774,7 +774,7 @@ class novadax(Exchange, ImplicitAPI):
774
774
  uppercaseType = 'STOP_MARKET'
775
775
  defaultOperator = 'LTE' if (uppercaseSide == 'BUY') else 'GTE'
776
776
  request['operator'] = self.safe_string(params, 'operator', defaultOperator)
777
- request['stopPrice'] = self.price_to_precision(symbol, stopPrice)
777
+ request['stopPrice'] = self.price_to_precision(symbol, triggerPrice)
778
778
  params = self.omit(params, ['triggerPrice', 'stopPrice'])
779
779
  if (uppercaseType == 'LIMIT') or (uppercaseType == 'STOP_LIMIT'):
780
780
  request['price'] = self.price_to_precision(symbol, price)
@@ -1092,7 +1092,6 @@ class novadax(Exchange, ImplicitAPI):
1092
1092
  }
1093
1093
  marketId = self.safe_string(order, 'symbol')
1094
1094
  symbol = self.safe_symbol(marketId, market, '_')
1095
- stopPrice = self.safe_number(order, 'stopPrice')
1096
1095
  return self.safe_order({
1097
1096
  'id': id,
1098
1097
  'clientOrderId': None,
@@ -1106,8 +1105,7 @@ class novadax(Exchange, ImplicitAPI):
1106
1105
  'postOnly': None,
1107
1106
  'side': side,
1108
1107
  'price': price,
1109
- 'stopPrice': stopPrice,
1110
- 'triggerPrice': stopPrice,
1108
+ 'triggerPrice': self.safe_number(order, 'stopPrice'),
1111
1109
  'amount': amount,
1112
1110
  'cost': cost,
1113
1111
  'average': average,
@@ -835,7 +835,6 @@ class oceanex(Exchange, ImplicitAPI):
835
835
  'postOnly': None,
836
836
  'side': self.safe_value(order, 'side'),
837
837
  'price': price,
838
- 'stopPrice': None,
839
838
  'triggerPrice': None,
840
839
  'average': average,
841
840
  'amount': amount,
@@ -1845,7 +1845,6 @@ class okcoin(Exchange, ImplicitAPI):
1845
1845
  clientOrderId = None # fix empty clientOrderId string
1846
1846
  stopLossPrice = self.safe_number_2(order, 'slTriggerPx', 'slOrdPx')
1847
1847
  takeProfitPrice = self.safe_number_2(order, 'tpTriggerPx', 'tpOrdPx')
1848
- stopPrice = self.safe_number_n(order, ['triggerPx', 'moveTriggerPx'])
1849
1848
  reduceOnlyRaw = self.safe_string(order, 'reduceOnly')
1850
1849
  reduceOnly = False
1851
1850
  if reduceOnly is not None:
@@ -1866,8 +1865,7 @@ class okcoin(Exchange, ImplicitAPI):
1866
1865
  'price': price,
1867
1866
  'stopLossPrice': stopLossPrice,
1868
1867
  'takeProfitPrice': takeProfitPrice,
1869
- 'stopPrice': stopPrice,
1870
- 'triggerPrice': stopPrice,
1868
+ 'triggerPrice': self.safe_number_n(order, ['triggerPx', 'moveTriggerPx']),
1871
1869
  'average': average,
1872
1870
  'cost': cost,
1873
1871
  'amount': amount,
ccxt/async_support/okx.py CHANGED
@@ -3668,7 +3668,6 @@ class okx(Exchange, ImplicitAPI):
3668
3668
  clientOrderId = None # fix empty clientOrderId string
3669
3669
  stopLossPrice = self.safe_number_2(order, 'slTriggerPx', 'slOrdPx')
3670
3670
  takeProfitPrice = self.safe_number_2(order, 'tpTriggerPx', 'tpOrdPx')
3671
- stopPrice = self.safe_number_n(order, ['triggerPx', 'moveTriggerPx'])
3672
3671
  reduceOnlyRaw = self.safe_string(order, 'reduceOnly')
3673
3672
  reduceOnly = False
3674
3673
  if reduceOnly is not None:
@@ -3689,8 +3688,7 @@ class okx(Exchange, ImplicitAPI):
3689
3688
  'price': price,
3690
3689
  'stopLossPrice': stopLossPrice,
3691
3690
  'takeProfitPrice': takeProfitPrice,
3692
- 'stopPrice': stopPrice,
3693
- 'triggerPrice': stopPrice,
3691
+ 'triggerPrice': self.safe_number_n(order, ['triggerPx', 'moveTriggerPx']),
3694
3692
  'average': average,
3695
3693
  'cost': cost,
3696
3694
  'amount': amount,
@@ -1083,7 +1083,6 @@ class onetrading(Exchange, ImplicitAPI):
1083
1083
  side = self.safe_string_lower(rawOrder, 'side')
1084
1084
  type = self.safe_string_lower(rawOrder, 'type')
1085
1085
  timeInForce = self.parse_time_in_force(self.safe_string(rawOrder, 'time_in_force'))
1086
- stopPrice = self.safe_number(rawOrder, 'trigger_price')
1087
1086
  postOnly = self.safe_value(rawOrder, 'is_post_only')
1088
1087
  rawTrades = self.safe_value(order, 'trades', [])
1089
1088
  return self.safe_order({
@@ -1099,8 +1098,7 @@ class onetrading(Exchange, ImplicitAPI):
1099
1098
  'postOnly': postOnly,
1100
1099
  'side': side,
1101
1100
  'price': price,
1102
- 'stopPrice': stopPrice,
1103
- 'triggerPrice': stopPrice,
1101
+ 'triggerPrice': self.safe_number(rawOrder, 'trigger_price'),
1104
1102
  'amount': amount,
1105
1103
  'cost': None,
1106
1104
  'average': None,
ccxt/async_support/p2b.py CHANGED
@@ -1174,7 +1174,7 @@ class p2b(Exchange, ImplicitAPI):
1174
1174
  'postOnly': None,
1175
1175
  'side': self.safe_string(order, 'side'),
1176
1176
  'price': self.safe_string(order, 'price'),
1177
- 'stopPrice': None,
1177
+ 'triggerPrice': None,
1178
1178
  'amount': self.safe_string(order, 'amount'),
1179
1179
  'cost': None,
1180
1180
  'average': None,
@@ -1093,7 +1093,6 @@ class paradex(Exchange, ImplicitAPI):
1093
1093
  side = self.safe_string_lower(order, 'side')
1094
1094
  average = self.omit_zero(self.safe_string(order, 'avg_fill_price'))
1095
1095
  remaining = self.omit_zero(self.safe_string(order, 'remaining_size'))
1096
- stopPrice = self.safe_string(order, 'trigger_price')
1097
1096
  lastUpdateTimestamp = self.safe_integer(order, 'last_updated_at')
1098
1097
  return self.safe_order({
1099
1098
  'id': orderId,
@@ -1110,8 +1109,7 @@ class paradex(Exchange, ImplicitAPI):
1110
1109
  'reduceOnly': None,
1111
1110
  'side': side,
1112
1111
  'price': price,
1113
- 'stopPrice': stopPrice,
1114
- 'triggerPrice': stopPrice,
1112
+ 'triggerPrice': self.safe_string(order, 'trigger_price'),
1115
1113
  'takeProfitPrice': None,
1116
1114
  'stopLossPrice': None,
1117
1115
  'average': average,
@@ -1174,7 +1172,7 @@ class paradex(Exchange, ImplicitAPI):
1174
1172
  :param float amount: how much of currency you want to trade in units of base currency
1175
1173
  :param float [price]: the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1176
1174
  :param dict [params]: extra parameters specific to the exchange API endpoint
1177
- :param float [params.stopPrice]: The price a trigger order is triggered at
1175
+ :param float [params.stopPrice]: alias for triggerPrice
1178
1176
  :param float [params.triggerPrice]: The price a trigger order is triggered at
1179
1177
  :param str [params.timeInForce]: "GTC", "IOC", or "POST_ONLY"
1180
1178
  :param bool [params.postOnly]: True or False
@@ -1194,7 +1192,7 @@ class paradex(Exchange, ImplicitAPI):
1194
1192
  'type': orderType, # LIMIT/MARKET/STOP_LIMIT/STOP_MARKET
1195
1193
  'size': self.amount_to_precision(symbol, amount),
1196
1194
  }
1197
- stopPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
1195
+ triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
1198
1196
  isMarket = orderType == 'MARKET'
1199
1197
  timeInForce = self.safe_string_upper(params, 'timeInForce')
1200
1198
  postOnly = self.is_post_only(isMarket, None, params)
@@ -1212,12 +1210,12 @@ class paradex(Exchange, ImplicitAPI):
1212
1210
  clientOrderId = self.safe_string_n(params, ['clOrdID', 'clientOrderId', 'client_order_id'])
1213
1211
  if clientOrderId is not None:
1214
1212
  request['client_id'] = clientOrderId
1215
- if stopPrice is not None:
1213
+ if triggerPrice is not None:
1216
1214
  if isMarket:
1217
1215
  request['type'] = 'STOP_MARKET'
1218
1216
  else:
1219
1217
  request['type'] = 'STOP_LIMIT'
1220
- request['trigger_price'] = self.price_to_precision(symbol, stopPrice)
1218
+ request['trigger_price'] = self.price_to_precision(symbol, triggerPrice)
1221
1219
  params = self.omit(params, ['reduceOnly', 'reduce_only', 'clOrdID', 'clientOrderId', 'client_order_id', 'postOnly', 'timeInForce', 'stopPrice', 'triggerPrice'])
1222
1220
  account = await self.retrieve_account()
1223
1221
  now = self.nonce()
@@ -2198,7 +2198,7 @@ class phemex(Exchange, ImplicitAPI):
2198
2198
  'currency': self.safe_currency_code(self.safe_string(order, 'feeCurrency')),
2199
2199
  }
2200
2200
  timeInForce = self.parse_time_in_force(self.safe_string(order, 'timeInForce'))
2201
- stopPrice = self.parse_number(self.omit_zero(self.from_ep(self.safe_string(order, 'stopPxEp'))))
2201
+ triggerPrice = self.parse_number(self.omit_zero(self.from_ep(self.safe_string(order, 'stopPxEp'))))
2202
2202
  postOnly = (timeInForce == 'PO')
2203
2203
  return self.safe_order({
2204
2204
  'info': order,
@@ -2213,8 +2213,7 @@ class phemex(Exchange, ImplicitAPI):
2213
2213
  'postOnly': postOnly,
2214
2214
  'side': side,
2215
2215
  'price': price,
2216
- 'stopPrice': stopPrice,
2217
- 'triggerPrice': stopPrice,
2216
+ 'triggerPrice': triggerPrice,
2218
2217
  'amount': amount,
2219
2218
  'cost': cost,
2220
2219
  'average': average,
@@ -2358,7 +2357,7 @@ class phemex(Exchange, ImplicitAPI):
2358
2357
  if lastTradeTimestamp == 0:
2359
2358
  lastTradeTimestamp = None
2360
2359
  timeInForce = self.parse_time_in_force(self.safe_string(order, 'timeInForce'))
2361
- stopPrice = self.omit_zero(self.safe_string_2(order, 'stopPx', 'stopPxRp'))
2360
+ triggerPrice = self.omit_zero(self.safe_string_2(order, 'stopPx', 'stopPxRp'))
2362
2361
  postOnly = (timeInForce == 'PO')
2363
2362
  reduceOnly = self.safe_value(order, 'reduceOnly')
2364
2363
  execInst = self.safe_string(order, 'execInst')
@@ -2393,8 +2392,7 @@ class phemex(Exchange, ImplicitAPI):
2393
2392
  'reduceOnly': reduceOnly,
2394
2393
  'side': side,
2395
2394
  'price': price,
2396
- 'stopPrice': stopPrice,
2397
- 'triggerPrice': stopPrice,
2395
+ 'triggerPrice': triggerPrice,
2398
2396
  'takeProfitPrice': takeProfit,
2399
2397
  'stopLossPrice': stopLoss,
2400
2398
  'amount': amount,
@@ -2732,12 +2730,12 @@ class phemex(Exchange, ImplicitAPI):
2732
2730
  request['orderQtyRq'] = self.amount_to_precision(market['symbol'], amount)
2733
2731
  else:
2734
2732
  request['baseQtyEV'] = self.to_ev(amount, market)
2735
- stopPrice = self.safe_string_n(params, ['triggerPrice', 'stopPx', 'stopPrice'])
2736
- if stopPrice is not None:
2733
+ triggerPrice = self.safe_string_n(params, ['triggerPrice', 'stopPx', 'stopPrice'])
2734
+ if triggerPrice is not None:
2737
2735
  if isUSDTSettled:
2738
- request['stopPxRp'] = self.price_to_precision(symbol, stopPrice)
2736
+ request['stopPxRp'] = self.price_to_precision(symbol, triggerPrice)
2739
2737
  else:
2740
- request['stopPxEp'] = self.to_ep(stopPrice, market)
2738
+ request['stopPxEp'] = self.to_ep(triggerPrice, market)
2741
2739
  params = self.omit(params, ['triggerPrice', 'stopPx', 'stopPrice'])
2742
2740
  response = None
2743
2741
  if isUSDTSettled:
@@ -3464,13 +3462,15 @@ class phemex(Exchange, ImplicitAPI):
3464
3462
 
3465
3463
  :param str[] [symbols]: list of unified market symbols
3466
3464
  :param dict [params]: extra parameters specific to the exchange API endpoint
3465
+ :param str [params.code]: the currency code to fetch positions for, USD, BTC or USDT, USD is the default
3467
3466
  :param str [params.method]: *USDT contracts only* 'privateGetGAccountsAccountPositions' or 'privateGetAccountsPositions' default is 'privateGetGAccountsAccountPositions'
3468
3467
  :returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
3469
3468
  """
3470
3469
  await self.load_markets()
3471
3470
  symbols = self.market_symbols(symbols)
3472
3471
  subType = None
3473
- code = self.safe_string(params, 'currency')
3472
+ code = self.safe_string_2(params, 'currency', 'code', 'USD')
3473
+ params = self.omit(params, ['currency', 'code'])
3474
3474
  settle = None
3475
3475
  market = None
3476
3476
  firstSymbol = self.safe_string(symbols, 0)
@@ -3479,15 +3479,15 @@ class phemex(Exchange, ImplicitAPI):
3479
3479
  settle = market['settle']
3480
3480
  code = market['settle']
3481
3481
  else:
3482
- settle, params = self.handle_option_and_params(params, 'fetchPositions', 'settle', 'USD')
3482
+ settle, params = self.handle_option_and_params(params, 'fetchPositions', 'settle', code)
3483
3483
  subType, params = self.handle_sub_type_and_params('fetchPositions', market, params)
3484
3484
  isUSDTSettled = settle == 'USDT'
3485
3485
  if isUSDTSettled:
3486
3486
  code = 'USDT'
3487
+ elif settle == 'BTC':
3488
+ code = 'BTC'
3487
3489
  elif code is None:
3488
3490
  code = 'USD' if (subType == 'linear') else 'BTC'
3489
- else:
3490
- params = self.omit(params, 'code')
3491
3491
  currency = self.currency(code)
3492
3492
  request: dict = {
3493
3493
  'currency': currency['id'],
@@ -1143,7 +1143,6 @@ class poloniex(Exchange, ImplicitAPI):
1143
1143
  'currency': feeCurrencyCode,
1144
1144
  }
1145
1145
  clientOrderId = self.safe_string(order, 'clientOrderId')
1146
- triggerPrice = self.safe_string_2(order, 'triggerPrice', 'stopPrice')
1147
1146
  return self.safe_order({
1148
1147
  'info': order,
1149
1148
  'id': id,
@@ -1158,8 +1157,7 @@ class poloniex(Exchange, ImplicitAPI):
1158
1157
  'postOnly': None,
1159
1158
  'side': side,
1160
1159
  'price': price,
1161
- 'stopPrice': triggerPrice,
1162
- 'triggerPrice': triggerPrice,
1160
+ 'triggerPrice': self.safe_string_2(order, 'triggerPrice', 'stopPrice'),
1163
1161
  'cost': None,
1164
1162
  'average': self.safe_string(order, 'avgPrice'),
1165
1163
  'amount': amount,