ccxt 4.4.41__py2.py3-none-any.whl → 4.4.42__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 (162) hide show
  1. ccxt/__init__.py +1 -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/ace.py +1 -1
  7. ccxt/alpaca.py +0 -1
  8. ccxt/ascendex.py +0 -1
  9. ccxt/async_support/__init__.py +1 -1
  10. ccxt/async_support/ace.py +1 -1
  11. ccxt/async_support/alpaca.py +0 -1
  12. ccxt/async_support/ascendex.py +0 -1
  13. ccxt/async_support/base/exchange.py +15 -15
  14. ccxt/async_support/bigone.py +0 -1
  15. ccxt/async_support/binance.py +3 -0
  16. ccxt/async_support/bingx.py +2 -0
  17. ccxt/async_support/bitfinex.py +122 -0
  18. ccxt/async_support/blofin.py +16 -7
  19. ccxt/async_support/cex.py +1 -1
  20. ccxt/async_support/coinbase.py +8 -9
  21. ccxt/async_support/coinbaseexchange.py +5 -6
  22. ccxt/async_support/coinbaseinternational.py +7 -8
  23. ccxt/async_support/coincatch.py +0 -1
  24. ccxt/async_support/coincheck.py +0 -1
  25. ccxt/async_support/coinex.py +91 -6
  26. ccxt/async_support/coinlist.py +3 -4
  27. ccxt/async_support/coinmate.py +1 -3
  28. ccxt/async_support/coinmetro.py +4 -5
  29. ccxt/async_support/coinone.py +0 -1
  30. ccxt/async_support/coinsph.py +7 -8
  31. ccxt/async_support/cryptocom.py +3 -0
  32. ccxt/async_support/currencycom.py +3 -4
  33. ccxt/async_support/defx.py +6 -7
  34. ccxt/async_support/deribit.py +1 -3
  35. ccxt/async_support/digifinex.py +0 -1
  36. ccxt/async_support/ellipx.py +0 -2
  37. ccxt/async_support/exmo.py +1 -2
  38. ccxt/async_support/gate.py +1 -2
  39. ccxt/async_support/gemini.py +4 -5
  40. ccxt/async_support/hashkey.py +79 -67
  41. ccxt/async_support/hitbtc.py +47 -5
  42. ccxt/async_support/hollaex.py +4 -6
  43. ccxt/async_support/htx.py +1 -3
  44. ccxt/async_support/huobijp.py +0 -1
  45. ccxt/async_support/idex.py +8 -8
  46. ccxt/async_support/independentreserve.py +0 -1
  47. ccxt/async_support/indodax.py +0 -1
  48. ccxt/async_support/kraken.py +63 -3
  49. ccxt/async_support/krakenfutures.py +75 -3
  50. ccxt/async_support/kucoin.py +1 -3
  51. ccxt/async_support/kucoinfutures.py +10 -9
  52. ccxt/async_support/kuna.py +1 -3
  53. ccxt/async_support/latoken.py +1 -3
  54. ccxt/async_support/lbank.py +0 -1
  55. ccxt/async_support/luno.py +0 -1
  56. ccxt/async_support/lykke.py +0 -1
  57. ccxt/async_support/mercado.py +0 -1
  58. ccxt/async_support/mexc.py +3 -4
  59. ccxt/async_support/ndax.py +1 -1
  60. ccxt/async_support/novadax.py +4 -6
  61. ccxt/async_support/oceanex.py +0 -1
  62. ccxt/async_support/okcoin.py +1 -3
  63. ccxt/async_support/okx.py +1 -3
  64. ccxt/async_support/onetrading.py +1 -3
  65. ccxt/async_support/p2b.py +1 -1
  66. ccxt/async_support/paradex.py +5 -7
  67. ccxt/async_support/phemex.py +8 -10
  68. ccxt/async_support/poloniex.py +1 -3
  69. ccxt/async_support/poloniexfutures.py +6 -6
  70. ccxt/async_support/probit.py +0 -1
  71. ccxt/async_support/timex.py +0 -1
  72. ccxt/async_support/tokocrypto.py +11 -14
  73. ccxt/async_support/tradeogre.py +1 -1
  74. ccxt/async_support/upbit.py +0 -1
  75. ccxt/async_support/wavesexchange.py +4 -5
  76. ccxt/async_support/whitebit.py +8 -9
  77. ccxt/async_support/woo.py +98 -12
  78. ccxt/async_support/woofipro.py +96 -15
  79. ccxt/async_support/xt.py +3 -2
  80. ccxt/async_support/yobit.py +0 -1
  81. ccxt/async_support/zaif.py +0 -1
  82. ccxt/async_support/zonda.py +1 -2
  83. ccxt/base/exchange.py +21 -17
  84. ccxt/bigone.py +0 -1
  85. ccxt/binance.py +3 -0
  86. ccxt/bingx.py +2 -0
  87. ccxt/bitfinex.py +122 -0
  88. ccxt/blofin.py +16 -7
  89. ccxt/cex.py +1 -1
  90. ccxt/coinbase.py +8 -9
  91. ccxt/coinbaseexchange.py +5 -6
  92. ccxt/coinbaseinternational.py +7 -8
  93. ccxt/coincatch.py +0 -1
  94. ccxt/coincheck.py +0 -1
  95. ccxt/coinex.py +91 -6
  96. ccxt/coinlist.py +3 -4
  97. ccxt/coinmate.py +1 -3
  98. ccxt/coinmetro.py +4 -5
  99. ccxt/coinone.py +0 -1
  100. ccxt/coinsph.py +7 -8
  101. ccxt/cryptocom.py +3 -0
  102. ccxt/currencycom.py +3 -4
  103. ccxt/defx.py +6 -7
  104. ccxt/deribit.py +1 -3
  105. ccxt/digifinex.py +0 -1
  106. ccxt/ellipx.py +0 -2
  107. ccxt/exmo.py +1 -2
  108. ccxt/gate.py +1 -2
  109. ccxt/gemini.py +4 -5
  110. ccxt/hashkey.py +79 -67
  111. ccxt/hitbtc.py +47 -5
  112. ccxt/hollaex.py +4 -6
  113. ccxt/htx.py +1 -3
  114. ccxt/huobijp.py +0 -1
  115. ccxt/idex.py +8 -8
  116. ccxt/independentreserve.py +0 -1
  117. ccxt/indodax.py +0 -1
  118. ccxt/kraken.py +63 -3
  119. ccxt/krakenfutures.py +75 -3
  120. ccxt/kucoin.py +1 -3
  121. ccxt/kucoinfutures.py +10 -9
  122. ccxt/kuna.py +1 -3
  123. ccxt/latoken.py +1 -3
  124. ccxt/lbank.py +0 -1
  125. ccxt/luno.py +0 -1
  126. ccxt/lykke.py +0 -1
  127. ccxt/mercado.py +0 -1
  128. ccxt/mexc.py +3 -4
  129. ccxt/ndax.py +1 -1
  130. ccxt/novadax.py +4 -6
  131. ccxt/oceanex.py +0 -1
  132. ccxt/okcoin.py +1 -3
  133. ccxt/okx.py +1 -3
  134. ccxt/onetrading.py +1 -3
  135. ccxt/p2b.py +1 -1
  136. ccxt/paradex.py +5 -7
  137. ccxt/phemex.py +8 -10
  138. ccxt/poloniex.py +1 -3
  139. ccxt/poloniexfutures.py +6 -6
  140. ccxt/pro/__init__.py +1 -1
  141. ccxt/probit.py +0 -1
  142. ccxt/timex.py +0 -1
  143. ccxt/tokocrypto.py +11 -14
  144. ccxt/tradeogre.py +1 -1
  145. ccxt/upbit.py +0 -1
  146. ccxt/wavesexchange.py +4 -5
  147. ccxt/whitebit.py +8 -9
  148. ccxt/woo.py +98 -12
  149. ccxt/woofipro.py +96 -15
  150. ccxt/xt.py +3 -2
  151. ccxt/yobit.py +0 -1
  152. ccxt/zaif.py +0 -1
  153. ccxt/zonda.py +1 -2
  154. {ccxt-4.4.41.dist-info → ccxt-4.4.42.dist-info}/METADATA +5 -5
  155. {ccxt-4.4.41.dist-info → ccxt-4.4.42.dist-info}/RECORD +158 -162
  156. ccxt/bitbay.py +0 -17
  157. ccxt/bitfinex2.py +0 -3624
  158. ccxt/hitbtc3.py +0 -16
  159. ccxt/pro/bitfinex2.py +0 -1086
  160. {ccxt-4.4.41.dist-info → ccxt-4.4.42.dist-info}/LICENSE.txt +0 -0
  161. {ccxt-4.4.41.dist-info → ccxt-4.4.42.dist-info}/WHEEL +0 -0
  162. {ccxt-4.4.41.dist-info → ccxt-4.4.42.dist-info}/top_level.txt +0 -0
ccxt/hitbtc.py CHANGED
@@ -92,6 +92,7 @@ class hitbtc(Exchange, ImplicitAPI):
92
92
  'fetchOHLCV': True,
93
93
  'fetchOpenInterest': True,
94
94
  'fetchOpenInterestHistory': False,
95
+ 'fetchOpenInterests': True,
95
96
  'fetchOpenOrder': True,
96
97
  'fetchOpenOrders': True,
97
98
  'fetchOrder': True,
@@ -2254,7 +2255,7 @@ class hitbtc(Exchange, ImplicitAPI):
2254
2255
  elif type == 'market':
2255
2256
  request['type'] = 'stopMarket'
2256
2257
  elif (type == 'stopLimit') or (type == 'stopMarket') or (type == 'takeProfitLimit') or (type == 'takeProfitMarket'):
2257
- raise ExchangeError(self.id + ' createOrder() requires a stopPrice parameter for stop-loss and take-profit orders')
2258
+ raise ExchangeError(self.id + ' createOrder() requires a triggerPrice parameter for stop-loss and take-profit orders')
2258
2259
  params = self.omit(params, ['triggerPrice', 'timeInForce', 'stopPrice', 'stop_price', 'reduceOnly', 'postOnly'])
2259
2260
  if marketType == 'swap':
2260
2261
  # set default margin mode to cross
@@ -2363,7 +2364,6 @@ class hitbtc(Exchange, ImplicitAPI):
2363
2364
  postOnly = self.safe_value(order, 'post_only')
2364
2365
  timeInForce = self.safe_string(order, 'time_in_force')
2365
2366
  rawTrades = self.safe_value(order, 'trades')
2366
- stopPrice = self.safe_string(order, 'stop_price')
2367
2367
  return self.safe_order({
2368
2368
  'info': order,
2369
2369
  'id': id,
@@ -2387,8 +2387,7 @@ class hitbtc(Exchange, ImplicitAPI):
2387
2387
  'average': average,
2388
2388
  'trades': rawTrades,
2389
2389
  'fee': None,
2390
- 'stopPrice': stopPrice,
2391
- 'triggerPrice': stopPrice,
2390
+ 'triggerPrice': self.safe_string(order, 'stop_price'),
2392
2391
  'takeProfitPrice': None,
2393
2392
  'stopLossPrice': None,
2394
2393
  }, market)
@@ -2954,7 +2953,7 @@ class hitbtc(Exchange, ImplicitAPI):
2954
2953
  datetime = self.safe_string(interest, 'timestamp')
2955
2954
  value = self.safe_number(interest, 'open_interest')
2956
2955
  return self.safe_open_interest({
2957
- 'symbol': market['symbol'],
2956
+ 'symbol': self.safe_symbol(None, market),
2958
2957
  'openInterestAmount': None,
2959
2958
  'openInterestValue': value,
2960
2959
  'timestamp': self.parse8601(datetime),
@@ -2962,6 +2961,49 @@ class hitbtc(Exchange, ImplicitAPI):
2962
2961
  'info': interest,
2963
2962
  }, market)
2964
2963
 
2964
+ def fetch_open_interests(self, symbols: Strings = None, params={}):
2965
+ """
2966
+ Retrieves the open interest for a list of symbols
2967
+
2968
+ https://api.hitbtc.com/#futures-info
2969
+
2970
+ :param str[] [symbols]: a list of unified CCXT market symbols
2971
+ :param dict [params]: exchange specific parameters
2972
+ :returns dict[]: a list of `open interest structures <https://docs.ccxt.com/#/?id=open-interest-structure>`
2973
+ """
2974
+ self.load_markets()
2975
+ request: dict = {}
2976
+ symbols = self.market_symbols(symbols)
2977
+ marketIds = None
2978
+ if symbols is not None:
2979
+ marketIds = self.market_ids(symbols)
2980
+ request['symbols'] = ','.join(marketIds)
2981
+ response = self.publicGetPublicFuturesInfo(self.extend(request, params))
2982
+ #
2983
+ # {
2984
+ # "BTCUSDT_PERP": {
2985
+ # "contract_type": "perpetual",
2986
+ # "mark_price": "97291.83",
2987
+ # "index_price": "97298.61",
2988
+ # "funding_rate": "-0.000183473092423284",
2989
+ # "open_interest": "94.1503",
2990
+ # "next_funding_time": "2024-12-20T08:00:00.000Z",
2991
+ # "indicative_funding_rate": "-0.00027495203277752",
2992
+ # "premium_index": "-0.000789474900583786",
2993
+ # "avg_premium_index": "-0.000683473092423284",
2994
+ # "interest_rate": "0.0001",
2995
+ # "timestamp": "2024-12-20T04:57:33.693Z"
2996
+ # }
2997
+ # }
2998
+ #
2999
+ results = []
3000
+ markets = list(response.keys())
3001
+ for i in range(0, len(markets)):
3002
+ marketId = markets[i]
3003
+ marketInner = self.safe_market(marketId)
3004
+ results.append(self.parse_open_interest(response[marketId], marketInner))
3005
+ return self.filter_by_array(results, 'symbol', symbols)
3006
+
2965
3007
  def fetch_open_interest(self, symbol: str, params={}):
2966
3008
  """
2967
3009
  Retrieves the open interest of a derivative trading pair
ccxt/hollaex.py CHANGED
@@ -1098,7 +1098,6 @@ class hollaex(Exchange, ImplicitAPI):
1098
1098
  type = self.safe_string(order, 'type')
1099
1099
  side = self.safe_string(order, 'side')
1100
1100
  price = self.safe_string(order, 'price')
1101
- stopPrice = self.safe_string(order, 'stop')
1102
1101
  amount = self.safe_string(order, 'size')
1103
1102
  filled = self.safe_string(order, 'filled')
1104
1103
  status = self.parse_order_status(self.safe_string(order, 'status'))
@@ -1117,8 +1116,7 @@ class hollaex(Exchange, ImplicitAPI):
1117
1116
  'postOnly': postOnly,
1118
1117
  'side': side,
1119
1118
  'price': price,
1120
- 'stopPrice': stopPrice,
1121
- 'triggerPrice': stopPrice,
1119
+ 'triggerPrice': self.safe_string(order, 'stop'),
1122
1120
  'amount': amount,
1123
1121
  'filled': filled,
1124
1122
  'remaining': None,
@@ -1156,7 +1154,7 @@ class hollaex(Exchange, ImplicitAPI):
1156
1154
  # 'stop': float(self.price_to_precision(symbol, stopPrice)),
1157
1155
  # 'meta': {}, # other options such
1158
1156
  }
1159
- stopPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'stop'])
1157
+ triggerPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'stop'])
1160
1158
  meta = self.safe_value(params, 'meta', {})
1161
1159
  exchangeSpecificParam = self.safe_bool(meta, 'post_only', False)
1162
1160
  isMarketOrder = type == 'market'
@@ -1164,8 +1162,8 @@ class hollaex(Exchange, ImplicitAPI):
1164
1162
  if not isMarketOrder:
1165
1163
  convertedPrice = float(self.price_to_precision(symbol, price))
1166
1164
  request['price'] = self.normalize_number_if_needed(convertedPrice)
1167
- if stopPrice is not None:
1168
- request['stop'] = self.normalize_number_if_needed(float(self.price_to_precision(symbol, stopPrice)))
1165
+ if triggerPrice is not None:
1166
+ request['stop'] = self.normalize_number_if_needed(float(self.price_to_precision(symbol, triggerPrice)))
1169
1167
  if postOnly:
1170
1168
  request['meta'] = {'post_only': True}
1171
1169
  params = self.omit(params, ['postOnly', 'timeInForce', 'stopPrice', 'triggerPrice', 'stop'])
ccxt/htx.py CHANGED
@@ -4969,7 +4969,6 @@ class htx(Exchange, ImplicitAPI):
4969
4969
  'cost': feeCost,
4970
4970
  'currency': feeCurrency,
4971
4971
  }
4972
- stopPrice = self.safe_string_2(order, 'stop-price', 'trigger_price')
4973
4972
  average = self.safe_string(order, 'trade_avg_price')
4974
4973
  trades = self.safe_value(order, 'trades')
4975
4974
  reduceOnlyInteger = self.safe_integer(order, 'reduce_only')
@@ -4989,8 +4988,7 @@ class htx(Exchange, ImplicitAPI):
4989
4988
  'postOnly': None,
4990
4989
  'side': side,
4991
4990
  'price': price,
4992
- 'stopPrice': stopPrice,
4993
- 'triggerPrice': stopPrice,
4991
+ 'triggerPrice': self.safe_string_2(order, 'stop-price', 'trigger_price'),
4994
4992
  'average': average,
4995
4993
  'cost': cost,
4996
4994
  'amount': amount,
ccxt/huobijp.py CHANGED
@@ -1295,7 +1295,6 @@ class huobijp(Exchange, ImplicitAPI):
1295
1295
  'postOnly': None,
1296
1296
  'side': side,
1297
1297
  'price': price,
1298
- 'stopPrice': None,
1299
1298
  'triggerPrice': None,
1300
1299
  'average': None,
1301
1300
  'cost': cost,
ccxt/idex.py CHANGED
@@ -1098,7 +1098,6 @@ class idex(Exchange, ImplicitAPI):
1098
1098
  'postOnly': None,
1099
1099
  'side': side,
1100
1100
  'price': price,
1101
- 'stopPrice': None,
1102
1101
  'triggerPrice': None,
1103
1102
  'amount': amount,
1104
1103
  'cost': None,
@@ -1163,11 +1162,12 @@ class idex(Exchange, ImplicitAPI):
1163
1162
  'takeProfit': 5,
1164
1163
  'takeProfitLimit': 6,
1165
1164
  }
1166
- stopPriceString = None
1167
- if (type == 'stopLossLimit') or (type == 'takeProfitLimit') or ('stopPrice' in params):
1168
- if not ('stopPrice' in params):
1169
- raise BadRequest(self.id + ' createOrder() stopPrice is a required parameter for ' + type + 'orders')
1170
- stopPriceString = self.price_to_precision(symbol, params['stopPrice'])
1165
+ triggerPrice = self.safe_string(params, 'triggerPrice', 'stopPrice')
1166
+ triggerPriceString = None
1167
+ if (type == 'stopLossLimit') or (type == 'takeProfitLimit'):
1168
+ if triggerPrice is None:
1169
+ raise BadRequest(self.id + ' createOrder() triggerPrice is a required parameter for ' + type + 'orders')
1170
+ triggerPriceString = self.price_to_precision(symbol, triggerPrice)
1171
1171
  limitTypeEnums: dict = {
1172
1172
  'limit': 1,
1173
1173
  'limitMaker': 2,
@@ -1245,7 +1245,7 @@ class idex(Exchange, ImplicitAPI):
1245
1245
  encodedPrice = self.encode(priceString)
1246
1246
  byteArray.append(encodedPrice)
1247
1247
  if type in stopLossTypeEnums:
1248
- encodedPrice = self.encode(stopPriceString or priceString)
1248
+ encodedPrice = self.encode(triggerPriceString or priceString)
1249
1249
  byteArray.append(encodedPrice)
1250
1250
  clientOrderId = self.safe_string(params, 'clientOrderId')
1251
1251
  if clientOrderId is not None:
@@ -1275,7 +1275,7 @@ class idex(Exchange, ImplicitAPI):
1275
1275
  if limitOrder:
1276
1276
  request['parameters']['price'] = priceString
1277
1277
  if type in stopLossTypeEnums:
1278
- request['parameters']['stopPrice'] = stopPriceString or priceString
1278
+ request['parameters']['stopPrice'] = triggerPriceString or priceString
1279
1279
  if amountEnum == 0:
1280
1280
  request['parameters']['quantity'] = amountString
1281
1281
  else:
@@ -436,7 +436,6 @@ class independentreserve(Exchange, ImplicitAPI):
436
436
  'postOnly': None,
437
437
  'side': side,
438
438
  'price': self.safe_string(order, 'Price'),
439
- 'stopPrice': None,
440
439
  'triggerPrice': None,
441
440
  'cost': self.safe_string(order, 'Value'),
442
441
  'average': self.safe_string(order, 'AvgPrice'),
ccxt/indodax.py CHANGED
@@ -713,7 +713,6 @@ class indodax(Exchange, ImplicitAPI):
713
713
  'postOnly': None,
714
714
  'side': side,
715
715
  'price': price,
716
- 'stopPrice': None,
717
716
  'triggerPrice': None,
718
717
  'cost': cost,
719
718
  'average': None,
ccxt/kraken.py CHANGED
@@ -445,6 +445,67 @@ class kraken(Exchange, ImplicitAPI):
445
445
  'Celestia': 'TIA',
446
446
  },
447
447
  },
448
+ 'features': {
449
+ 'spot': {
450
+ 'sandbox': False,
451
+ 'createOrder': {
452
+ 'marginMode': False,
453
+ 'triggerPrice': False, # todo
454
+ 'triggerPriceType': None,
455
+ 'triggerDirection': False,
456
+ 'stopLossPrice': True,
457
+ 'takeProfitPrice': True,
458
+ 'attachedStopLossTakeProfit': None,
459
+ 'timeInForce': {
460
+ 'IOC': True,
461
+ 'FOK': True,
462
+ 'PO': True,
463
+ 'GTD': False,
464
+ },
465
+ 'hedged': False,
466
+ 'trailing': True,
467
+ },
468
+ 'createOrders': None,
469
+ 'fetchMyTrades': {
470
+ 'marginMode': False,
471
+ 'limit': None,
472
+ 'daysBack': None,
473
+ 'untilDays': None,
474
+ },
475
+ 'fetchOrder': {
476
+ 'marginMode': False,
477
+ 'trigger': False,
478
+ 'trailing': False,
479
+ },
480
+ 'fetchOpenOrders': {
481
+ 'marginMode': False,
482
+ 'limit': None,
483
+ 'trigger': False,
484
+ 'trailing': False,
485
+ },
486
+ 'fetchOrders': None,
487
+ 'fetchClosedOrders': {
488
+ 'marginMode': False,
489
+ 'limit': None,
490
+ 'daysBackClosed': None,
491
+ 'daysBackCanceled': None,
492
+ 'untilDays': 100000,
493
+ 'trigger': False,
494
+ 'trailing': False,
495
+ },
496
+ 'fetchOHLCV': {
497
+ 'limit': 720,
498
+ },
499
+ },
500
+ 'swap': {
501
+ 'linear': None,
502
+ 'inverse': None,
503
+ },
504
+ 'future': {
505
+ 'linear': None,
506
+ 'inverse': None,
507
+ },
508
+ },
448
509
  'precisionMode': TICK_SIZE,
449
510
  'exceptions': {
450
511
  'exact': {
@@ -1008,7 +1069,7 @@ class kraken(Exchange, ImplicitAPI):
1008
1069
  """
1009
1070
  fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1010
1071
 
1011
- https://docs.kraken.com/rest/#tag/Spot-Market-Data/operation/getOHLCData
1072
+ https://docs.kraken.com/api/docs/rest-api/get-ohlc-data
1012
1073
 
1013
1074
  :param str symbol: unified symbol of the market to fetch OHLCV data for
1014
1075
  :param str timeframe: the length of time each candle represents
@@ -1775,7 +1836,6 @@ class kraken(Exchange, ImplicitAPI):
1775
1836
  'postOnly': isPostOnly,
1776
1837
  'side': side,
1777
1838
  'price': price,
1778
- 'stopPrice': triggerPrice,
1779
1839
  'triggerPrice': triggerPrice,
1780
1840
  'takeProfitPrice': takeProfitPrice,
1781
1841
  'stopLossPrice': stopLossPrice,
@@ -2123,7 +2183,7 @@ class kraken(Exchange, ImplicitAPI):
2123
2183
  """
2124
2184
  fetch all trades made by the user
2125
2185
 
2126
- https://docs.kraken.com/rest/#tag/Account-Data/operation/getTradeHistory
2186
+ https://docs.kraken.com/api/docs/rest-api/get-trade-history
2127
2187
 
2128
2188
  :param str symbol: unified market symbol
2129
2189
  :param int [since]: the earliest time in ms to fetch trades for
ccxt/krakenfutures.py CHANGED
@@ -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 = self.privateGetFills(params)
1838
1910
  #
1839
1911
  # {
ccxt/kucoin.py CHANGED
@@ -3042,7 +3042,6 @@ class kucoin(Exchange, ImplicitAPI):
3042
3042
  status = 'canceled'
3043
3043
  if responseStatus == 'fail':
3044
3044
  status = 'rejected'
3045
- stopPrice = self.safe_number(order, 'stopPrice')
3046
3045
  return self.safe_order({
3047
3046
  'info': order,
3048
3047
  'id': self.safe_string_n(order, ['id', 'orderId', 'newOrderId', 'cancelledOrderId']),
@@ -3054,8 +3053,7 @@ class kucoin(Exchange, ImplicitAPI):
3054
3053
  'side': self.safe_string(order, 'side'),
3055
3054
  'amount': self.safe_string(order, 'size'),
3056
3055
  'price': self.safe_string(order, 'price'), # price is zero for market order, omitZero is called in safeOrder2
3057
- 'stopPrice': stopPrice,
3058
- 'triggerPrice': stopPrice,
3056
+ 'triggerPrice': self.safe_number(order, 'stopPrice'),
3059
3057
  'cost': self.safe_string(order, 'dealFunds'),
3060
3058
  'filled': self.safe_string(order, 'dealSize'),
3061
3059
  'remaining': None,
ccxt/kucoinfutures.py CHANGED
@@ -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,
ccxt/kuna.py CHANGED
@@ -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,
ccxt/latoken.py CHANGED
@@ -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,
ccxt/lbank.py CHANGED
@@ -1609,7 +1609,6 @@ class lbank(Exchange, ImplicitAPI):
1609
1609
  'postOnly': postOnly,
1610
1610
  'side': side,
1611
1611
  'price': price,
1612
- 'stopPrice': None,
1613
1612
  'triggerPrice': None,
1614
1613
  'cost': costString,
1615
1614
  'amount': amountString,
ccxt/luno.py CHANGED
@@ -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,
ccxt/lykke.py CHANGED
@@ -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,
ccxt/mercado.py CHANGED
@@ -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,
ccxt/mexc.py CHANGED
@@ -2441,11 +2441,11 @@ class mexc(Exchange, ImplicitAPI):
2441
2441
  clientOrderId = self.safe_string_2(params, 'clientOrderId', 'externalOid')
2442
2442
  if clientOrderId is not None:
2443
2443
  request['externalOid'] = clientOrderId
2444
- stopPrice = self.safe_number_2(params, 'triggerPrice', 'stopPrice')
2444
+ triggerPrice = self.safe_number_2(params, 'triggerPrice', 'stopPrice')
2445
2445
  params = self.omit(params, ['clientOrderId', 'externalOid', 'postOnly', 'stopPrice', 'triggerPrice', 'hedged'])
2446
2446
  response = None
2447
- if stopPrice:
2448
- request['triggerPrice'] = self.price_to_precision(symbol, stopPrice)
2447
+ if triggerPrice:
2448
+ request['triggerPrice'] = self.price_to_precision(symbol, triggerPrice)
2449
2449
  request['triggerType'] = self.safe_integer(params, 'triggerType', 1)
2450
2450
  request['executeCycle'] = self.safe_integer(params, 'executeCycle', 1)
2451
2451
  request['trend'] = self.safe_integer(params, 'trend', 1)
@@ -3426,7 +3426,6 @@ class mexc(Exchange, ImplicitAPI):
3426
3426
  'timeInForce': self.parse_order_time_in_force(self.safe_string(order, 'timeInForce')),
3427
3427
  'side': self.parse_order_side(self.safe_string(order, 'side')),
3428
3428
  'price': self.safe_number(order, 'price'),
3429
- 'stopPrice': self.safe_number_2(order, 'stopPrice', 'triggerPrice'),
3430
3429
  'triggerPrice': self.safe_number_2(order, 'stopPrice', 'triggerPrice'),
3431
3430
  'average': self.safe_number(order, 'dealAvgPrice'),
3432
3431
  'amount': self.safe_number_2(order, 'origQty', 'vol'),
ccxt/ndax.py CHANGED
@@ -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'),