ccxt 4.4.43__py2.py3-none-any.whl → 4.4.45__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 (91) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/binance.py +1 -0
  3. ccxt/abstract/binancecoinm.py +1 -0
  4. ccxt/abstract/binanceus.py +1 -0
  5. ccxt/abstract/binanceusdm.py +1 -0
  6. ccxt/abstract/blofin.py +22 -0
  7. ccxt/async_support/__init__.py +1 -1
  8. ccxt/async_support/base/exchange.py +1 -1
  9. ccxt/async_support/binance.py +235 -107
  10. ccxt/async_support/bingx.py +20 -9
  11. ccxt/async_support/bitfinex.py +7 -3
  12. ccxt/async_support/bitget.py +6 -4
  13. ccxt/async_support/bitmart.py +7 -10
  14. ccxt/async_support/bitmex.py +4 -6
  15. ccxt/async_support/bitstamp.py +5 -0
  16. ccxt/async_support/blofin.py +22 -0
  17. ccxt/async_support/bybit.py +12 -27
  18. ccxt/async_support/coinbase.py +14 -10
  19. ccxt/async_support/coinbaseinternational.py +13 -9
  20. ccxt/async_support/coincatch.py +2 -2
  21. ccxt/async_support/coinex.py +6 -6
  22. ccxt/async_support/cryptocom.py +5 -3
  23. ccxt/async_support/defx.py +2 -2
  24. ccxt/async_support/delta.py +1 -1
  25. ccxt/async_support/exmo.py +16 -8
  26. ccxt/async_support/gate.py +10 -5
  27. ccxt/async_support/gemini.py +5 -0
  28. ccxt/async_support/hashkey.py +15 -10
  29. ccxt/async_support/htx.py +103 -5
  30. ccxt/async_support/hyperliquid.py +6 -1
  31. ccxt/async_support/kraken.py +10 -3
  32. ccxt/async_support/krakenfutures.py +6 -1
  33. ccxt/async_support/kucoin.py +10 -8
  34. ccxt/async_support/kucoinfutures.py +7 -8
  35. ccxt/async_support/lykke.py +1 -1
  36. ccxt/async_support/mexc.py +20 -14
  37. ccxt/async_support/myokx.py +8 -0
  38. ccxt/async_support/ndax.py +1 -1
  39. ccxt/async_support/oceanex.py +1 -1
  40. ccxt/async_support/okx.py +9 -10
  41. ccxt/async_support/onetrading.py +2 -1
  42. ccxt/async_support/whitebit.py +35 -10
  43. ccxt/async_support/woo.py +6 -4
  44. ccxt/async_support/woofipro.py +7 -4
  45. ccxt/base/exchange.py +1 -1
  46. ccxt/binance.py +235 -107
  47. ccxt/bingx.py +20 -9
  48. ccxt/bitfinex.py +7 -3
  49. ccxt/bitget.py +6 -4
  50. ccxt/bitmart.py +7 -10
  51. ccxt/bitmex.py +4 -6
  52. ccxt/bitstamp.py +5 -0
  53. ccxt/blofin.py +22 -0
  54. ccxt/bybit.py +12 -27
  55. ccxt/coinbase.py +14 -10
  56. ccxt/coinbaseinternational.py +13 -9
  57. ccxt/coincatch.py +2 -2
  58. ccxt/coinex.py +6 -6
  59. ccxt/cryptocom.py +5 -3
  60. ccxt/defx.py +2 -2
  61. ccxt/delta.py +1 -1
  62. ccxt/exmo.py +16 -8
  63. ccxt/gate.py +10 -5
  64. ccxt/gemini.py +5 -0
  65. ccxt/hashkey.py +15 -10
  66. ccxt/htx.py +103 -5
  67. ccxt/hyperliquid.py +6 -1
  68. ccxt/kraken.py +10 -3
  69. ccxt/krakenfutures.py +6 -1
  70. ccxt/kucoin.py +10 -8
  71. ccxt/kucoinfutures.py +7 -8
  72. ccxt/lykke.py +1 -1
  73. ccxt/mexc.py +20 -14
  74. ccxt/myokx.py +8 -0
  75. ccxt/ndax.py +1 -1
  76. ccxt/oceanex.py +1 -1
  77. ccxt/okx.py +9 -10
  78. ccxt/onetrading.py +2 -1
  79. ccxt/pro/__init__.py +1 -1
  80. ccxt/pro/binance.py +2 -1
  81. ccxt/pro/bitcoincom.py +4 -1
  82. ccxt/pro/bitopro.py +1 -1
  83. ccxt/pro/myokx.py +5 -0
  84. ccxt/whitebit.py +35 -10
  85. ccxt/woo.py +6 -4
  86. ccxt/woofipro.py +7 -4
  87. {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/METADATA +4 -4
  88. {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/RECORD +91 -91
  89. {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/LICENSE.txt +0 -0
  90. {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/WHEEL +0 -0
  91. {ccxt-4.4.43.dist-info → ccxt-4.4.45.dist-info}/top_level.txt +0 -0
@@ -566,7 +566,7 @@ class bingx(Exchange, ImplicitAPI):
566
566
  'mark': True,
567
567
  'index': True,
568
568
  },
569
- 'limitPrice': True,
569
+ 'price': True,
570
570
  },
571
571
  'timeInForce': {
572
572
  'IOC': True,
@@ -576,6 +576,11 @@ class bingx(Exchange, ImplicitAPI):
576
576
  },
577
577
  'hedged': True,
578
578
  'trailing': True,
579
+ 'leverage': False,
580
+ 'marketBuyRequiresPrice': False,
581
+ 'marketBuyByCost': True,
582
+ 'selfTradePrevention': False,
583
+ 'iceberg': False,
579
584
  },
580
585
  'createOrders': {
581
586
  'max': 5,
@@ -608,7 +613,7 @@ class bingx(Exchange, ImplicitAPI):
608
613
  'fetchClosedOrders': {
609
614
  'marginMode': False,
610
615
  'limit': 1000,
611
- 'daysBackClosed': None,
616
+ 'daysBack': None,
612
617
  'daysBackCanceled': None,
613
618
  'untilDays': 7,
614
619
  'trigger': False,
@@ -632,7 +637,7 @@ class bingx(Exchange, ImplicitAPI):
632
637
  'fetchClosedOrders': {
633
638
  'marginMode': False,
634
639
  'limit': 1000,
635
- 'daysBackClosed': None,
640
+ 'daysBack': None,
636
641
  'daysBackCanceled': None,
637
642
  'untilDays': 7,
638
643
  'trigger': False,
@@ -2647,8 +2652,10 @@ class bingx(Exchange, ImplicitAPI):
2647
2652
  :param dict [params]: extra parameters specific to the exchange API endpoint
2648
2653
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
2649
2654
  """
2650
- params['quoteOrderQty'] = cost
2651
- return await self.create_order(symbol, 'market', side, cost, None, params)
2655
+ req = {
2656
+ 'quoteOrderQty': cost,
2657
+ }
2658
+ return await self.create_order(symbol, 'market', side, cost, None, self.extend(req, params))
2652
2659
 
2653
2660
  async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
2654
2661
  """
@@ -2658,8 +2665,10 @@ class bingx(Exchange, ImplicitAPI):
2658
2665
  :param dict [params]: extra parameters specific to the exchange API endpoint
2659
2666
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
2660
2667
  """
2661
- params['quoteOrderQty'] = cost
2662
- return await self.create_order(symbol, 'market', 'buy', cost, None, params)
2668
+ req = {
2669
+ 'quoteOrderQty': cost,
2670
+ }
2671
+ return await self.create_order(symbol, 'market', 'buy', cost, None, self.extend(req, params))
2663
2672
 
2664
2673
  async def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
2665
2674
  """
@@ -2669,8 +2678,10 @@ class bingx(Exchange, ImplicitAPI):
2669
2678
  :param dict [params]: extra parameters specific to the exchange API endpoint
2670
2679
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
2671
2680
  """
2672
- params['quoteOrderQty'] = cost
2673
- return await self.create_order(symbol, 'market', 'sell', cost, None, params)
2681
+ req = {
2682
+ 'quoteOrderQty': cost,
2683
+ }
2684
+ return await self.create_order(symbol, 'market', 'sell', cost, None, self.extend(req, params))
2674
2685
 
2675
2686
  def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
2676
2687
  """
@@ -439,8 +439,12 @@ class bitfinex(Exchange, ImplicitAPI):
439
439
  'GTD': False,
440
440
  },
441
441
  'hedged': False,
442
- 'trailing': True, # todo: unify
443
- # todo: leverage unify
442
+ 'trailing': True, # todo: implement
443
+ 'leverage': True, # todo: implement
444
+ 'marketBuyRequiresPrice': False,
445
+ 'marketBuyByCost': True,
446
+ 'selfTradePrevention': False,
447
+ 'iceberg': False,
444
448
  },
445
449
  'createOrders': {
446
450
  'max': 75,
@@ -466,7 +470,7 @@ class bitfinex(Exchange, ImplicitAPI):
466
470
  'fetchClosedOrders': {
467
471
  'marginMode': False,
468
472
  'limit': None,
469
- 'daysBackClosed': None,
473
+ 'daysBack': None,
470
474
  'daysBackCanceled': None,
471
475
  'untilDays': 100000,
472
476
  'trigger': False,
@@ -1483,7 +1483,7 @@ class bitget(Exchange, ImplicitAPI):
1483
1483
  'mark': False,
1484
1484
  'index': False,
1485
1485
  },
1486
- 'limitPrice': True,
1486
+ 'price': True,
1487
1487
  },
1488
1488
  'timeInForce': {
1489
1489
  'IOC': True,
@@ -1525,7 +1525,7 @@ class bitget(Exchange, ImplicitAPI):
1525
1525
  'fetchClosedOrders': {
1526
1526
  'marginMode': True,
1527
1527
  'limit': 100,
1528
- 'daysBackClosed': None,
1528
+ 'daysBack': None,
1529
1529
  'daysBackCanceled': None,
1530
1530
  'untilDays': 90,
1531
1531
  'trigger': True,
@@ -1553,7 +1553,7 @@ class bitget(Exchange, ImplicitAPI):
1553
1553
  'mark': True,
1554
1554
  'index': True,
1555
1555
  },
1556
- 'limitPrice': False,
1556
+ 'price': False,
1557
1557
  },
1558
1558
  'timeInForce': {
1559
1559
  'IOC': True,
@@ -6614,8 +6614,10 @@ class bitget(Exchange, ImplicitAPI):
6614
6614
  # },
6615
6615
  # ]
6616
6616
  # }
6617
+ symbols = self.market_symbols(symbols)
6617
6618
  data = self.safe_list(response, 'data', [])
6618
- return self.parse_funding_rates(data, market)
6619
+ result = self.parse_funding_rates(data, market)
6620
+ return self.filter_by_array(result, 'symbol', symbols)
6619
6621
 
6620
6622
  def parse_funding_rate(self, contract, market: Market = None) -> FundingRate:
6621
6623
  #
@@ -726,14 +726,11 @@ class bitmart(Exchange, ImplicitAPI):
726
726
  },
727
727
  'hedged': False,
728
728
  'trailing': False,
729
- 'marketBuyRequiresPrice': True,
729
+ 'marketBuyRequiresPrice': False, # todo: https://developer-pro.bitmart.com/en/spot/#new-order-v2-signed
730
730
  'marketBuyByCost': True,
731
- # exchange-supported features
732
- # 'leverage': True,
733
- # 'selfTradePrevention': False,
734
- # 'twap': False,
735
- # 'iceberg': False,
736
- # 'oco': False,
731
+ 'leverage': True, # todo: implement
732
+ 'selfTradePrevention': False,
733
+ 'iceberg': False,
737
734
  },
738
735
  'createOrders': {
739
736
  'max': 10,
@@ -759,7 +756,7 @@ class bitmart(Exchange, ImplicitAPI):
759
756
  'fetchClosedOrders': {
760
757
  'marginMode': True,
761
758
  'limit': 200,
762
- 'daysBackClosed': None,
759
+ 'daysBack': None,
763
760
  'daysBackCanceled': None,
764
761
  'untilDays': None,
765
762
  'trigger': False,
@@ -788,7 +785,7 @@ class bitmart(Exchange, ImplicitAPI):
788
785
  'mark': True,
789
786
  'index': False,
790
787
  },
791
- 'limitPrice': False,
788
+ 'price': False,
792
789
  },
793
790
  'timeInForce': {
794
791
  'IOC': True,
@@ -826,7 +823,7 @@ class bitmart(Exchange, ImplicitAPI):
826
823
  'fetchClosedOrders': {
827
824
  'marginMode': True,
828
825
  'limit': 200,
829
- 'daysBackClosed': None,
826
+ 'daysBack': None,
830
827
  'daysBackCanceled': None,
831
828
  'untilDays': None,
832
829
  'trigger': False,
@@ -310,11 +310,9 @@ class bitmex(Exchange, ImplicitAPI):
310
310
  'trailing': True,
311
311
  'marketBuyRequiresPrice': False,
312
312
  'marketBuyByCost': False,
313
- # exchange-supported features
314
- # 'selfTradePrevention': True,
315
- # 'twap': False,
316
- # 'iceberg': False,
317
- # 'oco': False,
313
+ 'leverage': False,
314
+ 'selfTradePrevention': False,
315
+ 'iceberg': True, # todo
318
316
  },
319
317
  'createOrders': None,
320
318
  'fetchMyTrades': {
@@ -345,7 +343,7 @@ class bitmex(Exchange, ImplicitAPI):
345
343
  'fetchClosedOrders': {
346
344
  'marginMode': False,
347
345
  'limit': 500,
348
- 'daysBackClosed': None,
346
+ 'daysBack': None,
349
347
  'daysBackCanceled': None,
350
348
  'untilDays': 1000000,
351
349
  'trigger': False,
@@ -525,6 +525,11 @@ class bitstamp(Exchange, ImplicitAPI):
525
525
  },
526
526
  'hedged': False,
527
527
  'trailing': False,
528
+ 'leverage': False,
529
+ 'marketBuyByCost': False,
530
+ 'marketBuyRequiresPrice': False,
531
+ 'selfTradePrevention': False,
532
+ 'iceberg': False,
528
533
  },
529
534
  'createOrders': None,
530
535
  'fetchMyTrades': {
@@ -204,6 +204,18 @@ class blofin(Exchange, ImplicitAPI):
204
204
  'trade/orders-tpsl-history': 1,
205
205
  'user/query-apikey': 1,
206
206
  'affiliate/basic': 1,
207
+ 'copytrading/instruments': 1,
208
+ 'copytrading/account/balance': 1,
209
+ 'copytrading/account/positions-by-order': 1,
210
+ 'copytrading/account/positions-details-by-order': 1,
211
+ 'copytrading/account/positions-by-contract': 1,
212
+ 'copytrading/account/position-mode': 1,
213
+ 'copytrading/account/leverage-info': 1,
214
+ 'copytrading/trade/orders-pending': 1,
215
+ 'copytrading/trade/pending-tpsl-by-contract': 1,
216
+ 'copytrading/trade/position-history-by-order': 1,
217
+ 'copytrading/trade/orders-history': 1,
218
+ 'copytrading/trade/pending-tpsl-by-order': 1,
207
219
  },
208
220
  'post': {
209
221
  'trade/order': 1,
@@ -215,6 +227,16 @@ class blofin(Exchange, ImplicitAPI):
215
227
  'trade/cancel-tpsl': 1,
216
228
  'trade/close-position': 1,
217
229
  'asset/transfer': 1,
230
+ 'copytrading/account/set-position-mode': 1,
231
+ 'copytrading/account/set-leverage': 1,
232
+ 'copytrading/trade/place-order': 1,
233
+ 'copytrading/trade/cancel-order': 1,
234
+ 'copytrading/trade/place-tpsl-by-contract': 1,
235
+ 'copytrading/trade/cancel-tpsl-by-contract': 1,
236
+ 'copytrading/trade/place-tpsl-by-order': 1,
237
+ 'copytrading/trade/cancel-tpsl-by-order': 1,
238
+ 'copytrading/trade/close-position-by-order': 1,
239
+ 'copytrading/trade/close-position-by-contract': 1,
218
240
  },
219
241
  },
220
242
  },
@@ -1116,7 +1116,7 @@ class bybit(Exchange, ImplicitAPI):
1116
1116
  'mark': True,
1117
1117
  'index': True,
1118
1118
  },
1119
- 'limitPrice': True,
1119
+ 'price': True,
1120
1120
  },
1121
1121
  'timeInForce': {
1122
1122
  'IOC': True,
@@ -1125,12 +1125,12 @@ class bybit(Exchange, ImplicitAPI):
1125
1125
  'GTD': False,
1126
1126
  },
1127
1127
  'hedged': True,
1128
- # exchange-supported features
1129
- 'selfTradePrevention': True,
1128
+ 'selfTradePrevention': True, # todo: implement
1130
1129
  'trailing': True,
1131
- 'twap': False,
1132
1130
  'iceberg': False,
1133
- 'oco': False,
1131
+ 'leverage': False,
1132
+ 'marketBuyRequiresPrice': False,
1133
+ 'marketBuyByCost': True,
1134
1134
  },
1135
1135
  'createOrders': {
1136
1136
  'max': 10,
@@ -1156,7 +1156,7 @@ class bybit(Exchange, ImplicitAPI):
1156
1156
  'fetchClosedOrders': {
1157
1157
  'marginMode': False,
1158
1158
  'limit': 50,
1159
- 'daysBackClosed': 365 * 2, # 2 years
1159
+ 'daysBack': 365 * 2, # 2 years
1160
1160
  'daysBackCanceled': 1,
1161
1161
  'untilDays': 7,
1162
1162
  'trigger': True,
@@ -1169,29 +1169,13 @@ class bybit(Exchange, ImplicitAPI):
1169
1169
  'spot': {
1170
1170
  'extends': 'default',
1171
1171
  'createOrder': {
1172
- 'marginMode': False,
1173
- 'triggerPrice': True,
1174
1172
  'triggerPriceType': None,
1175
1173
  'triggerDirection': False,
1176
- 'stopLossPrice': True,
1177
- 'takeProfitPrice': True,
1178
1174
  'attachedStopLossTakeProfit': {
1179
1175
  'triggerPriceType': None,
1180
- 'limitPrice': True,
1181
- },
1182
- 'timeInForce': {
1183
- 'IOC': True,
1184
- 'FOK': True,
1185
- 'PO': True,
1186
- 'GTD': False,
1176
+ 'price': True,
1187
1177
  },
1188
- 'hedged': True,
1189
- # exchange-supported features
1190
- 'selfTradePrevention': True,
1191
- 'trailing': True,
1192
- 'twap': False,
1193
- 'iceberg': False,
1194
- 'oco': False,
1178
+ 'marketBuyRequiresPrice': True,
1195
1179
  },
1196
1180
  },
1197
1181
  'swap': {
@@ -1270,7 +1254,7 @@ class bybit(Exchange, ImplicitAPI):
1270
1254
  :param dict [params]: extra parameters specific to the exchange API endpoint
1271
1255
  :returns any: [enableUnifiedMargin, enableUnifiedAccount]
1272
1256
  """
1273
- # The API key of user id must own one of permissions will be allowed to call following API endpoints.
1257
+ # The API key of user id must own one of permissions will be allowed to call following API endpoints:
1274
1258
  # SUB UID: "Account Transfer"
1275
1259
  # MASTER UID: "Account Transfer", "Subaccount Transfer", "Withdrawal"
1276
1260
  enableUnifiedMargin = self.safe_bool(self.options, 'enableUnifiedMargin')
@@ -2057,6 +2041,7 @@ class bybit(Exchange, ImplicitAPI):
2057
2041
  'quoteId': quoteId,
2058
2042
  'settleId': settleId,
2059
2043
  'type': 'option',
2044
+ 'subType': 'linear',
2060
2045
  'spot': False,
2061
2046
  'margin': False,
2062
2047
  'swap': False,
@@ -2064,8 +2049,8 @@ class bybit(Exchange, ImplicitAPI):
2064
2049
  'option': True,
2065
2050
  'active': isActive,
2066
2051
  'contract': True,
2067
- 'linear': None,
2068
- 'inverse': None,
2052
+ 'linear': True,
2053
+ 'inverse': False,
2069
2054
  'taker': self.safe_number(market, 'takerFee', self.parse_number('0.0006')),
2070
2055
  'maker': self.safe_number(market, 'makerFee', self.parse_number('0.0001')),
2071
2056
  'contractSize': self.parse_number('1'),
@@ -386,7 +386,7 @@ class coinbase(Exchange, ImplicitAPI):
386
386
  'user_native_currency': 'USD', # needed to get fees for v3
387
387
  },
388
388
  'features': {
389
- 'spot': {
389
+ 'default': {
390
390
  'sandbox': False,
391
391
  'createOrder': {
392
392
  'marginMode': True,
@@ -404,6 +404,11 @@ class coinbase(Exchange, ImplicitAPI):
404
404
  },
405
405
  'hedged': False,
406
406
  'trailing': False,
407
+ 'leverage': True, # todo implement
408
+ 'marketBuyByCost': True,
409
+ 'marketBuyRequiresPrice': True,
410
+ 'selfTradePrevention': False,
411
+ 'iceberg': False,
407
412
  },
408
413
  'createOrders': None,
409
414
  'fetchMyTrades': {
@@ -434,7 +439,7 @@ class coinbase(Exchange, ImplicitAPI):
434
439
  'fetchClosedOrders': {
435
440
  'marginMode': False,
436
441
  'limit': None,
437
- 'daysBackClosed': None,
442
+ 'daysBack': None,
438
443
  'daysBackCanceled': None,
439
444
  'untilDays': 10000,
440
445
  'trigger': False,
@@ -444,21 +449,20 @@ class coinbase(Exchange, ImplicitAPI):
444
449
  'limit': 350,
445
450
  },
446
451
  },
452
+ 'spot': {
453
+ 'extends': 'default',
454
+ },
447
455
  'swap': {
448
456
  'linear': {
449
- 'extends': 'spot',
450
- },
451
- 'inverse': {
452
- 'extends': 'spot',
457
+ 'extends': 'default',
453
458
  },
459
+ 'inverse': None,
454
460
  },
455
461
  'future': {
456
462
  'linear': {
457
- 'extends': 'spot',
458
- },
459
- 'inverse': {
460
- 'extends': 'spot',
463
+ 'extends': 'default',
461
464
  },
465
+ 'inverse': None,
462
466
  },
463
467
  },
464
468
  })
@@ -265,7 +265,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
265
265
  },
266
266
  },
267
267
  'features': {
268
- 'spot': {
268
+ 'default': {
269
269
  'sandbox': True,
270
270
  'createOrder': {
271
271
  'marginMode': False,
@@ -284,6 +284,11 @@ class coinbaseinternational(Exchange, ImplicitAPI):
284
284
  },
285
285
  'hedged': False,
286
286
  'trailing': False,
287
+ 'leverage': False,
288
+ 'marketBuyByCost': False,
289
+ 'marketBuyRequiresPrice': True,
290
+ 'selfTradePrevention': True, # todo: implement
291
+ 'iceberg': False,
287
292
  },
288
293
  'createOrders': None,
289
294
  'fetchMyTrades': {
@@ -309,21 +314,20 @@ class coinbaseinternational(Exchange, ImplicitAPI):
309
314
  'limit': 300,
310
315
  },
311
316
  },
317
+ 'spot': {
318
+ 'extends': 'default',
319
+ },
312
320
  'swap': {
313
321
  'linear': {
314
- 'extends': 'spot',
322
+ 'extends': 'default',
315
323
  },
316
324
  'inverse': {
317
- 'extends': 'spot',
325
+ 'extends': 'default',
318
326
  },
319
327
  },
320
328
  'future': {
321
- 'linear': {
322
- 'extends': 'spot',
323
- },
324
- 'inverse': {
325
- 'extends': 'spot',
326
- },
329
+ 'linear': None,
330
+ 'inverse': None,
327
331
  },
328
332
  },
329
333
  })
@@ -848,8 +848,8 @@ class coincatch(Exchange, ImplicitAPI):
848
848
  settleId = self.safe_string(supportMarginCoins, 0)
849
849
  settle = self.safe_currency_code(settleId)
850
850
  suffix = ':' + settle
851
- isLinear = baseId == settleId # todo check
852
- isInverse = quoteId == settleId # todo check
851
+ isLinear = quoteId == settleId # todo check
852
+ isInverse = baseId == settleId # todo check
853
853
  if isLinear:
854
854
  subType = 'linear'
855
855
  elif isInverse:
@@ -533,11 +533,11 @@ class coinex(Exchange, ImplicitAPI):
533
533
  },
534
534
  'hedged': False,
535
535
  'trailing': False,
536
- # exchange-supported features
537
- # 'marketBuyRequiresPrice': True,
538
- # 'marketBuyByCost': True,
539
- # 'selfTradePrevention': True,
540
- # 'iceberg': True,
536
+ 'leverage': False,
537
+ 'marketBuyByCost': True,
538
+ 'marketBuyRequiresPrice': True,
539
+ 'selfTradePrevention': True, # todo: implement
540
+ 'iceberg': True, # todo implement
541
541
  },
542
542
  'createOrders': {
543
543
  'max': 5,
@@ -563,7 +563,7 @@ class coinex(Exchange, ImplicitAPI):
563
563
  'fetchClosedOrders': {
564
564
  'marginMode': True,
565
565
  'limit': 1000,
566
- 'daysBackClosed': None,
566
+ 'daysBack': None,
567
567
  'daysBackCanceled': None,
568
568
  'untilDays': None,
569
569
  'trigger': True,
@@ -389,10 +389,12 @@ class cryptocom(Exchange, ImplicitAPI):
389
389
  'GTD': False,
390
390
  },
391
391
  'hedged': False,
392
- # exchange-supported features
393
- 'selfTradePrevention': True,
392
+ 'selfTradePrevention': True, # todo: implement
394
393
  'trailing': False,
395
394
  'iceberg': False,
395
+ 'leverage': False,
396
+ 'marketBuyByCost': True,
397
+ 'marketBuyRequiresPrice': True,
396
398
  },
397
399
  'createOrders': {
398
400
  'max': 10,
@@ -425,7 +427,7 @@ class cryptocom(Exchange, ImplicitAPI):
425
427
  'fetchClosedOrders': {
426
428
  'marginMode': False,
427
429
  'limit': 100,
428
- 'daysBackClosed': None,
430
+ 'daysBack': None,
429
431
  'daysBackCanceled': None,
430
432
  'untilDays': 1,
431
433
  'trigger': False,
@@ -926,10 +926,10 @@ class defx(Exchange, ImplicitAPI):
926
926
  id = self.safe_string(trade, 'id')
927
927
  oid = self.safe_string(trade, 'orderId')
928
928
  takerOrMaker = self.safe_string_lower(trade, 'role')
929
- buyerMaker = self.safe_string(trade, 'buyerMaker')
929
+ buyerMaker = self.safe_bool(trade, 'buyerMaker')
930
930
  side = self.safe_string_lower(trade, 'side')
931
931
  if buyerMaker is not None:
932
- if buyerMaker == 'true':
932
+ if buyerMaker:
933
933
  side = 'sell'
934
934
  else:
935
935
  side = 'buy'
@@ -734,7 +734,7 @@ class delta(Exchange, ImplicitAPI):
734
734
  else:
735
735
  # other markets(swap, futures, move, spread, irs) seem to use the step of '1' contract
736
736
  amountPrecision = self.parse_number('1')
737
- linear = (settle == base)
737
+ linear = (settle == quote)
738
738
  optionType = None
739
739
  symbol = base + '/' + quote
740
740
  if swap or future or option:
@@ -846,32 +846,40 @@ class exmo(Exchange, ImplicitAPI):
846
846
  :param int [since]: timestamp in ms of the earliest candle to fetch
847
847
  :param int [limit]: the maximum amount of candles to fetch
848
848
  :param dict [params]: extra parameters specific to the exchange API endpoint
849
+ :param int [params.until]: timestamp in ms of the latest candle to fetch
849
850
  :returns int[][]: A list of candles ordered, open, high, low, close, volume
850
851
  """
851
852
  await self.load_markets()
852
853
  market = self.market(symbol)
854
+ until = self.safe_integer_product(params, 'until', 0.001)
855
+ untilIsDefined = (until is not None)
853
856
  request: dict = {
854
857
  'symbol': market['id'],
855
858
  'resolution': self.safe_string(self.timeframes, timeframe, timeframe),
856
859
  }
857
860
  maxLimit = 3000
858
861
  duration = self.parse_timeframe(timeframe)
859
- now = self.milliseconds()
862
+ now = self.parse_to_int(self.milliseconds() / 1000)
860
863
  if since is None:
864
+ to = min(until, now) if untilIsDefined else now
861
865
  if limit is None:
862
866
  limit = 1000 # cap default at generous amount
863
867
  else:
864
868
  limit = min(limit, maxLimit)
865
- request['from'] = self.parse_to_int(now / 1000) - limit * duration - 1
866
- request['to'] = self.parse_to_int(now / 1000)
869
+ request['from'] = to - (limit * duration) - 1
870
+ request['to'] = to
867
871
  else:
868
872
  request['from'] = self.parse_to_int(since / 1000) - 1
869
- if limit is None:
870
- limit = maxLimit
873
+ if untilIsDefined:
874
+ request['to'] = min(until, now)
871
875
  else:
872
- limit = min(limit, maxLimit)
873
- to = self.sum(since, limit * duration * 1000)
874
- request['to'] = self.parse_to_int(to / 1000)
876
+ if limit is None:
877
+ limit = maxLimit
878
+ else:
879
+ limit = min(limit, maxLimit)
880
+ to = self.sum(since, limit * duration)
881
+ request['to'] = min(to, now)
882
+ params = self.omit(params, 'until')
875
883
  response = await self.publicGetCandlesHistory(self.extend(request, params))
876
884
  #
877
885
  # {
@@ -724,7 +724,7 @@ class gate(Exchange, ImplicitAPI):
724
724
  },
725
725
  },
726
726
  'features': {
727
- 'spot': {
727
+ 'default': {
728
728
  'sandbox': True,
729
729
  'createOrder': {
730
730
  'marginMode': True,
@@ -743,9 +743,11 @@ class gate(Exchange, ImplicitAPI):
743
743
  },
744
744
  'hedged': False,
745
745
  'trailing': False,
746
- # exchange-specific features
747
- 'iceberg': True,
748
- 'selfTradePrevention': True,
746
+ 'iceberg': True, # todo implement
747
+ 'selfTradePrevention': True, # todo implement
748
+ 'leverage': False,
749
+ 'marketBuyByCost': True,
750
+ 'marketBuyRequiresPrice': True,
749
751
  },
750
752
  'createOrders': {
751
753
  'max': 40, # NOTE! max 10 per symbol
@@ -774,13 +776,16 @@ class gate(Exchange, ImplicitAPI):
774
776
  'trailing': False,
775
777
  'limit': 100,
776
778
  'untilDays': 30,
777
- 'daysBackClosed': None,
779
+ 'daysBack': None,
778
780
  'daysBackCanceled': None,
779
781
  },
780
782
  'fetchOHLCV': {
781
783
  'limit': 1000,
782
784
  },
783
785
  },
786
+ 'spot': {
787
+ 'extends': 'default',
788
+ },
784
789
  'forDerivatives': {
785
790
  'extends': 'spot',
786
791
  'createOrder': {