ccxt 4.4.42__py2.py3-none-any.whl → 4.4.44__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.
- ccxt/__init__.py +3 -1
- ccxt/abstract/binance.py +1 -0
- ccxt/abstract/binancecoinm.py +1 -0
- ccxt/abstract/binanceus.py +1 -0
- ccxt/abstract/binanceusdm.py +1 -0
- ccxt/abstract/bingx.py +4 -0
- ccxt/abstract/bitstamp.py +1 -0
- ccxt/abstract/myokx.py +340 -0
- ccxt/async_support/__init__.py +3 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +57 -45
- ccxt/async_support/bingx.py +30 -7
- ccxt/async_support/bitfinex.py +6 -2
- ccxt/async_support/bitget.py +3 -1
- ccxt/async_support/bitmart.py +4 -7
- ccxt/async_support/bitmex.py +3 -5
- ccxt/async_support/bitstamp.py +59 -0
- ccxt/async_support/bybit.py +8 -23
- ccxt/async_support/coinbase.py +13 -9
- ccxt/async_support/coinbaseinternational.py +13 -9
- ccxt/async_support/coincatch.py +2 -2
- ccxt/async_support/coinex.py +5 -5
- ccxt/async_support/cryptocom.py +4 -2
- ccxt/async_support/defx.py +2 -2
- ccxt/async_support/delta.py +1 -1
- ccxt/async_support/gate.py +9 -4
- ccxt/async_support/gemini.py +65 -2
- ccxt/async_support/hashkey.py +9 -9
- ccxt/async_support/htx.py +101 -3
- ccxt/async_support/hyperliquid.py +6 -1
- ccxt/async_support/kraken.py +9 -2
- ccxt/async_support/krakenfutures.py +5 -0
- ccxt/async_support/kucoin.py +9 -7
- ccxt/async_support/kucoinfutures.py +5 -5
- ccxt/async_support/mexc.py +18 -12
- ccxt/async_support/myokx.py +35 -0
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/oceanex.py +1 -1
- ccxt/async_support/okx.py +5 -6
- ccxt/async_support/phemex.py +6 -4
- ccxt/async_support/vertex.py +63 -4
- ccxt/async_support/whitebit.py +4 -2
- ccxt/async_support/woo.py +8 -6
- ccxt/async_support/woofipro.py +5 -2
- ccxt/base/exchange.py +1 -1
- ccxt/binance.py +57 -45
- ccxt/bingx.py +30 -7
- ccxt/bitfinex.py +6 -2
- ccxt/bitget.py +3 -1
- ccxt/bitmart.py +4 -7
- ccxt/bitmex.py +3 -5
- ccxt/bitstamp.py +59 -0
- ccxt/bybit.py +8 -23
- ccxt/coinbase.py +13 -9
- ccxt/coinbaseinternational.py +13 -9
- ccxt/coincatch.py +2 -2
- ccxt/coinex.py +5 -5
- ccxt/cryptocom.py +4 -2
- ccxt/defx.py +2 -2
- ccxt/delta.py +1 -1
- ccxt/gate.py +9 -4
- ccxt/gemini.py +65 -2
- ccxt/hashkey.py +9 -9
- ccxt/htx.py +101 -3
- ccxt/hyperliquid.py +6 -1
- ccxt/kraken.py +9 -2
- ccxt/krakenfutures.py +5 -0
- ccxt/kucoin.py +9 -7
- ccxt/kucoinfutures.py +5 -5
- ccxt/mexc.py +18 -12
- ccxt/myokx.py +35 -0
- ccxt/ndax.py +1 -1
- ccxt/oceanex.py +1 -1
- ccxt/okx.py +5 -6
- ccxt/phemex.py +6 -4
- ccxt/pro/__init__.py +3 -1
- ccxt/pro/bitcoincom.py +4 -1
- ccxt/pro/bitopro.py +1 -1
- ccxt/pro/myokx.py +23 -0
- ccxt/vertex.py +63 -4
- ccxt/whitebit.py +4 -2
- ccxt/woo.py +8 -6
- ccxt/woofipro.py +5 -2
- {ccxt-4.4.42.dist-info → ccxt-4.4.44.dist-info}/METADATA +36 -34
- {ccxt-4.4.42.dist-info → ccxt-4.4.44.dist-info}/RECORD +88 -87
- ccxt/async_support/bitbay.py +0 -17
- ccxt/async_support/bitfinex2.py +0 -3625
- ccxt/async_support/hitbtc3.py +0 -16
- {ccxt-4.4.42.dist-info → ccxt-4.4.44.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.42.dist-info → ccxt-4.4.44.dist-info}/WHEEL +0 -0
- {ccxt-4.4.42.dist-info → ccxt-4.4.44.dist-info}/top_level.txt +0 -0
ccxt/coinbase.py
CHANGED
@@ -385,7 +385,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
385
385
|
'user_native_currency': 'USD', # needed to get fees for v3
|
386
386
|
},
|
387
387
|
'features': {
|
388
|
-
'
|
388
|
+
'default': {
|
389
389
|
'sandbox': False,
|
390
390
|
'createOrder': {
|
391
391
|
'marginMode': True,
|
@@ -403,6 +403,11 @@ class coinbase(Exchange, ImplicitAPI):
|
|
403
403
|
},
|
404
404
|
'hedged': False,
|
405
405
|
'trailing': False,
|
406
|
+
'leverage': True, # todo implement
|
407
|
+
'marketBuyByCost': True,
|
408
|
+
'marketBuyRequiresPrice': True,
|
409
|
+
'selfTradePrevention': False,
|
410
|
+
'iceberg': False,
|
406
411
|
},
|
407
412
|
'createOrders': None,
|
408
413
|
'fetchMyTrades': {
|
@@ -443,21 +448,20 @@ class coinbase(Exchange, ImplicitAPI):
|
|
443
448
|
'limit': 350,
|
444
449
|
},
|
445
450
|
},
|
451
|
+
'spot': {
|
452
|
+
'extends': 'default',
|
453
|
+
},
|
446
454
|
'swap': {
|
447
455
|
'linear': {
|
448
|
-
'extends': '
|
449
|
-
},
|
450
|
-
'inverse': {
|
451
|
-
'extends': 'spot',
|
456
|
+
'extends': 'default',
|
452
457
|
},
|
458
|
+
'inverse': None,
|
453
459
|
},
|
454
460
|
'future': {
|
455
461
|
'linear': {
|
456
|
-
'extends': '
|
457
|
-
},
|
458
|
-
'inverse': {
|
459
|
-
'extends': 'spot',
|
462
|
+
'extends': 'default',
|
460
463
|
},
|
464
|
+
'inverse': None,
|
461
465
|
},
|
462
466
|
},
|
463
467
|
})
|
ccxt/coinbaseinternational.py
CHANGED
@@ -265,7 +265,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
265
265
|
},
|
266
266
|
},
|
267
267
|
'features': {
|
268
|
-
'
|
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': '
|
322
|
+
'extends': 'default',
|
315
323
|
},
|
316
324
|
'inverse': {
|
317
|
-
'extends': '
|
325
|
+
'extends': 'default',
|
318
326
|
},
|
319
327
|
},
|
320
328
|
'future': {
|
321
|
-
'linear':
|
322
|
-
|
323
|
-
},
|
324
|
-
'inverse': {
|
325
|
-
'extends': 'spot',
|
326
|
-
},
|
329
|
+
'linear': None,
|
330
|
+
'inverse': None,
|
327
331
|
},
|
328
332
|
},
|
329
333
|
})
|
ccxt/coincatch.py
CHANGED
@@ -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 =
|
852
|
-
isInverse =
|
851
|
+
isLinear = quoteId == settleId # todo check
|
852
|
+
isInverse = baseId == settleId # todo check
|
853
853
|
if isLinear:
|
854
854
|
subType = 'linear'
|
855
855
|
elif isInverse:
|
ccxt/coinex.py
CHANGED
@@ -532,11 +532,11 @@ class coinex(Exchange, ImplicitAPI):
|
|
532
532
|
},
|
533
533
|
'hedged': False,
|
534
534
|
'trailing': False,
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
535
|
+
'leverage': False,
|
536
|
+
'marketBuyByCost': True,
|
537
|
+
'marketBuyRequiresPrice': True,
|
538
|
+
'selfTradePrevention': True, # todo: implement
|
539
|
+
'iceberg': True, # todo implement
|
540
540
|
},
|
541
541
|
'createOrders': {
|
542
542
|
'max': 5,
|
ccxt/cryptocom.py
CHANGED
@@ -389,10 +389,12 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
389
389
|
'GTD': False,
|
390
390
|
},
|
391
391
|
'hedged': False,
|
392
|
-
#
|
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,
|
ccxt/defx.py
CHANGED
@@ -925,10 +925,10 @@ class defx(Exchange, ImplicitAPI):
|
|
925
925
|
id = self.safe_string(trade, 'id')
|
926
926
|
oid = self.safe_string(trade, 'orderId')
|
927
927
|
takerOrMaker = self.safe_string_lower(trade, 'role')
|
928
|
-
buyerMaker = self.
|
928
|
+
buyerMaker = self.safe_bool(trade, 'buyerMaker')
|
929
929
|
side = self.safe_string_lower(trade, 'side')
|
930
930
|
if buyerMaker is not None:
|
931
|
-
if buyerMaker
|
931
|
+
if buyerMaker:
|
932
932
|
side = 'sell'
|
933
933
|
else:
|
934
934
|
side = 'buy'
|
ccxt/delta.py
CHANGED
@@ -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 ==
|
737
|
+
linear = (settle == quote)
|
738
738
|
optionType = None
|
739
739
|
symbol = base + '/' + quote
|
740
740
|
if swap or future or option:
|
ccxt/gate.py
CHANGED
@@ -723,7 +723,7 @@ class gate(Exchange, ImplicitAPI):
|
|
723
723
|
},
|
724
724
|
},
|
725
725
|
'features': {
|
726
|
-
'
|
726
|
+
'default': {
|
727
727
|
'sandbox': True,
|
728
728
|
'createOrder': {
|
729
729
|
'marginMode': True,
|
@@ -742,9 +742,11 @@ class gate(Exchange, ImplicitAPI):
|
|
742
742
|
},
|
743
743
|
'hedged': False,
|
744
744
|
'trailing': False,
|
745
|
-
#
|
746
|
-
'
|
747
|
-
'
|
745
|
+
'iceberg': True, # todo implement
|
746
|
+
'selfTradePrevention': True, # todo implement
|
747
|
+
'leverage': False,
|
748
|
+
'marketBuyByCost': True,
|
749
|
+
'marketBuyRequiresPrice': True,
|
748
750
|
},
|
749
751
|
'createOrders': {
|
750
752
|
'max': 40, # NOTE! max 10 per symbol
|
@@ -780,6 +782,9 @@ class gate(Exchange, ImplicitAPI):
|
|
780
782
|
'limit': 1000,
|
781
783
|
},
|
782
784
|
},
|
785
|
+
'spot': {
|
786
|
+
'extends': 'default',
|
787
|
+
},
|
783
788
|
'forDerivatives': {
|
784
789
|
'extends': 'spot',
|
785
790
|
'createOrder': {
|
ccxt/gemini.py
CHANGED
@@ -310,6 +310,69 @@ class gemini(Exchange, ImplicitAPI):
|
|
310
310
|
},
|
311
311
|
},
|
312
312
|
},
|
313
|
+
'features': {
|
314
|
+
'default': {
|
315
|
+
'sandbox': True,
|
316
|
+
'createOrder': {
|
317
|
+
'marginMode': False,
|
318
|
+
'triggerPrice': True,
|
319
|
+
'triggerPriceType': None,
|
320
|
+
'triggerDirection': False,
|
321
|
+
'stopLossPrice': False, # todo
|
322
|
+
'takeProfitPrice': False, # todo
|
323
|
+
'attachedStopLossTakeProfit': None,
|
324
|
+
'timeInForce': {
|
325
|
+
'IOC': True,
|
326
|
+
'FOK': True,
|
327
|
+
'PO': True,
|
328
|
+
'GTD': False,
|
329
|
+
},
|
330
|
+
'hedged': False,
|
331
|
+
'trailing': False,
|
332
|
+
'leverage': False,
|
333
|
+
'marketBuyByCost': True,
|
334
|
+
'marketBuyRequiresPrice': False,
|
335
|
+
'selfTradePrevention': False,
|
336
|
+
'iceberg': False,
|
337
|
+
},
|
338
|
+
'createOrders': None,
|
339
|
+
'fetchMyTrades': {
|
340
|
+
'marginMode': False,
|
341
|
+
'limit': 500,
|
342
|
+
'daysBack': None,
|
343
|
+
'untilDays': None,
|
344
|
+
},
|
345
|
+
'fetchOrder': {
|
346
|
+
'marginMode': False,
|
347
|
+
'trigger': False,
|
348
|
+
'trailing': False,
|
349
|
+
},
|
350
|
+
'fetchOpenOrders': {
|
351
|
+
'marginMode': False,
|
352
|
+
'limit': None,
|
353
|
+
'trigger': False,
|
354
|
+
'trailing': False,
|
355
|
+
},
|
356
|
+
'fetchOrders': None,
|
357
|
+
'fetchClosedOrders': None, # todo: implement
|
358
|
+
'fetchOHLCV': {
|
359
|
+
'limit': None,
|
360
|
+
},
|
361
|
+
},
|
362
|
+
'spot': {
|
363
|
+
'extends': 'default',
|
364
|
+
},
|
365
|
+
'swap': {
|
366
|
+
'linear': {
|
367
|
+
'extends': 'default',
|
368
|
+
},
|
369
|
+
'inverse': None,
|
370
|
+
},
|
371
|
+
'future': {
|
372
|
+
'linear': None,
|
373
|
+
'inverse': None,
|
374
|
+
},
|
375
|
+
},
|
313
376
|
})
|
314
377
|
|
315
378
|
def fetch_currencies(self, params={}) -> Currencies:
|
@@ -1430,8 +1493,8 @@ class gemini(Exchange, ImplicitAPI):
|
|
1430
1493
|
}
|
1431
1494
|
type = self.safe_string(params, 'type', type)
|
1432
1495
|
params = self.omit(params, 'type')
|
1433
|
-
triggerPrice = self.safe_string_n(params, ['stop_price', 'stopPrice'])
|
1434
|
-
params = self.omit(params, ['stop_price', 'stopPrice', 'type'])
|
1496
|
+
triggerPrice = self.safe_string_n(params, ['triggerPrice', 'stop_price', 'stopPrice'])
|
1497
|
+
params = self.omit(params, ['triggerPrice', 'stop_price', 'stopPrice', 'type'])
|
1435
1498
|
if type == 'stopLimit':
|
1436
1499
|
raise ArgumentsRequired(self.id + ' createOrder() requires a triggerPrice parameter or a stop_price parameter for ' + type + ' orders')
|
1437
1500
|
if triggerPrice is not None:
|
ccxt/hashkey.py
CHANGED
@@ -380,13 +380,11 @@ class hashkey(Exchange, ImplicitAPI):
|
|
380
380
|
},
|
381
381
|
'hedged': False,
|
382
382
|
'trailing': False,
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
# 'iceberg': False,
|
389
|
-
# 'oco': False,
|
383
|
+
'leverage': False,
|
384
|
+
'marketBuyByCost': True,
|
385
|
+
'marketBuyRequiresPrice': True, # todo fix
|
386
|
+
'selfTradePrevention': True, # todo implement
|
387
|
+
'iceberg': False,
|
390
388
|
},
|
391
389
|
'createOrders': {
|
392
390
|
'max': 20,
|
@@ -2393,8 +2391,10 @@ class hashkey(Exchange, ImplicitAPI):
|
|
2393
2391
|
market = self.market(symbol)
|
2394
2392
|
if not market['spot']:
|
2395
2393
|
raise NotSupported(self.id + ' createMarketBuyOrderWithCost() is supported for spot markets only')
|
2396
|
-
|
2397
|
-
|
2394
|
+
req = {
|
2395
|
+
'cost': cost,
|
2396
|
+
}
|
2397
|
+
return self.create_order(symbol, 'market', 'buy', cost, None, self.extend(req, params))
|
2398
2398
|
|
2399
2399
|
def create_spot_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}) -> Order:
|
2400
2400
|
"""
|
ccxt/htx.py
CHANGED
@@ -114,6 +114,7 @@ class htx(Exchange, ImplicitAPI):
|
|
114
114
|
'fetchOHLCV': True,
|
115
115
|
'fetchOpenInterest': True,
|
116
116
|
'fetchOpenInterestHistory': True,
|
117
|
+
'fetchOpenInterests': True,
|
117
118
|
'fetchOpenOrder': None,
|
118
119
|
'fetchOpenOrders': True,
|
119
120
|
'fetchOrder': True,
|
@@ -1269,9 +1270,11 @@ class htx(Exchange, ImplicitAPI):
|
|
1269
1270
|
},
|
1270
1271
|
'hedged': False,
|
1271
1272
|
'trailing': False,
|
1272
|
-
# exchange-specific features
|
1273
1273
|
'iceberg': False,
|
1274
|
-
'selfTradePrevention': True,
|
1274
|
+
'selfTradePrevention': True, # todo implement
|
1275
|
+
'leverage': True, # todo implement
|
1276
|
+
'marketBuyByCost': True,
|
1277
|
+
'marketBuyRequiresPrice': True,
|
1275
1278
|
},
|
1276
1279
|
'createOrders': {
|
1277
1280
|
'max': 10,
|
@@ -8003,6 +8006,100 @@ class htx(Exchange, ImplicitAPI):
|
|
8003
8006
|
tick = self.safe_list(data, 'tick')
|
8004
8007
|
return self.parse_open_interests_history(tick, market, since, limit)
|
8005
8008
|
|
8009
|
+
def fetch_open_interests(self, symbols: Strings = None, params={}):
|
8010
|
+
"""
|
8011
|
+
Retrieves the open interest for a list of symbols
|
8012
|
+
|
8013
|
+
https://huobiapi.github.io/docs/dm/v1/en/#get-contract-open-interest-information
|
8014
|
+
https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-swap-open-interest-information
|
8015
|
+
https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-swap-open-interest-information
|
8016
|
+
|
8017
|
+
:param str[] [symbols]: a list of unified CCXT market symbols
|
8018
|
+
:param dict [params]: exchange specific parameters
|
8019
|
+
:returns dict[]: a list of `open interest structures <https://docs.ccxt.com/#/?id=open-interest-structure>`
|
8020
|
+
"""
|
8021
|
+
self.load_markets()
|
8022
|
+
symbols = self.market_symbols(symbols)
|
8023
|
+
market = None
|
8024
|
+
if symbols is not None:
|
8025
|
+
symbolsLength = len(symbols)
|
8026
|
+
if symbolsLength > 0:
|
8027
|
+
first = self.safe_string(symbols, 0)
|
8028
|
+
market = self.market(first)
|
8029
|
+
request: dict = {}
|
8030
|
+
subType = None
|
8031
|
+
subType, params = self.handle_sub_type_and_params('fetchPositions', market, params, 'linear')
|
8032
|
+
marketType = None
|
8033
|
+
marketType, params = self.handle_market_type_and_params('fetchPositions', market, params)
|
8034
|
+
response = None
|
8035
|
+
if marketType == 'future':
|
8036
|
+
response = self.contractPublicGetApiV1ContractOpenInterest(self.extend(request, params))
|
8037
|
+
#
|
8038
|
+
# {
|
8039
|
+
# "status": "ok",
|
8040
|
+
# "data": [
|
8041
|
+
# {
|
8042
|
+
# "volume": 118850.000000000000000000,
|
8043
|
+
# "amount": 635.502025211544374189,
|
8044
|
+
# "symbol": "BTC",
|
8045
|
+
# "contract_type": "self_week",
|
8046
|
+
# "contract_code": "BTC220930",
|
8047
|
+
# "trade_amount": 1470.9400749347598691119206024033947897351,
|
8048
|
+
# "trade_volume": 286286,
|
8049
|
+
# "trade_turnover": 28628600.000000000000000000
|
8050
|
+
# }
|
8051
|
+
# ],
|
8052
|
+
# "ts": 1664337928805
|
8053
|
+
# }
|
8054
|
+
#
|
8055
|
+
elif subType == 'inverse':
|
8056
|
+
response = self.contractPublicGetSwapApiV1SwapOpenInterest(self.extend(request, params))
|
8057
|
+
#
|
8058
|
+
# {
|
8059
|
+
# "status": "ok",
|
8060
|
+
# "data": [
|
8061
|
+
# {
|
8062
|
+
# "volume": 518018.000000000000000000,
|
8063
|
+
# "amount": 2769.675777407074725180,
|
8064
|
+
# "symbol": "BTC",
|
8065
|
+
# "contract_code": "BTC-USD",
|
8066
|
+
# "trade_amount": 9544.4032080046491323463688602729806842458,
|
8067
|
+
# "trade_volume": 1848448,
|
8068
|
+
# "trade_turnover": 184844800.000000000000000000
|
8069
|
+
# }
|
8070
|
+
# ],
|
8071
|
+
# "ts": 1664337226028
|
8072
|
+
# }
|
8073
|
+
#
|
8074
|
+
else:
|
8075
|
+
request['contract_type'] = 'swap'
|
8076
|
+
response = self.contractPublicGetLinearSwapApiV1SwapOpenInterest(self.extend(request, params))
|
8077
|
+
#
|
8078
|
+
# {
|
8079
|
+
# "status": "ok",
|
8080
|
+
# "data": [
|
8081
|
+
# {
|
8082
|
+
# "volume": 7192610.000000000000000000,
|
8083
|
+
# "amount": 7192.610000000000000000,
|
8084
|
+
# "symbol": "BTC",
|
8085
|
+
# "value": 134654290.332000000000000000,
|
8086
|
+
# "contract_code": "BTC-USDT",
|
8087
|
+
# "trade_amount": 70692.804,
|
8088
|
+
# "trade_volume": 70692804,
|
8089
|
+
# "trade_turnover": 1379302592.9518,
|
8090
|
+
# "business_type": "swap",
|
8091
|
+
# "pair": "BTC-USDT",
|
8092
|
+
# "contract_type": "swap",
|
8093
|
+
# "trade_partition": "USDT"
|
8094
|
+
# }
|
8095
|
+
# ],
|
8096
|
+
# "ts": 1664336503144
|
8097
|
+
# }
|
8098
|
+
#
|
8099
|
+
data = self.safe_list(response, 'data', [])
|
8100
|
+
result = self.parse_open_interests(data)
|
8101
|
+
return self.filter_by_array(result, 'symbol', symbols)
|
8102
|
+
|
8006
8103
|
def fetch_open_interest(self, symbol: str, params={}):
|
8007
8104
|
"""
|
8008
8105
|
Retrieves the open interest of a currency
|
@@ -8161,8 +8258,9 @@ class htx(Exchange, ImplicitAPI):
|
|
8161
8258
|
timestamp = self.safe_integer(interest, 'ts')
|
8162
8259
|
amount = self.safe_number(interest, 'volume')
|
8163
8260
|
value = self.safe_number(interest, 'value')
|
8261
|
+
marketId = self.safe_string(interest, 'contract_code')
|
8164
8262
|
return self.safe_open_interest({
|
8165
|
-
'symbol': self.
|
8263
|
+
'symbol': self.safe_symbol(marketId, market),
|
8166
8264
|
'baseVolume': amount, # deprecated
|
8167
8265
|
'quoteVolume': value, # deprecated
|
8168
8266
|
'openInterestAmount': amount,
|
ccxt/hyperliquid.py
CHANGED
@@ -31,7 +31,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
31
31
|
'countries': [],
|
32
32
|
'version': 'v1',
|
33
33
|
'rateLimit': 50, # 1200 requests per minute, 20 request per second
|
34
|
-
'certified':
|
34
|
+
'certified': True,
|
35
35
|
'pro': True,
|
36
36
|
'dex': True,
|
37
37
|
'has': {
|
@@ -246,6 +246,11 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
246
246
|
},
|
247
247
|
'hedged': False,
|
248
248
|
'trailing': False,
|
249
|
+
'leverage': False,
|
250
|
+
'marketBuyByCost': False,
|
251
|
+
'marketBuyRequiresPrice': False,
|
252
|
+
'selfTradePrevention': False,
|
253
|
+
'iceberg': False,
|
249
254
|
},
|
250
255
|
'createOrders': {
|
251
256
|
'max': 1000,
|
ccxt/kraken.py
CHANGED
@@ -464,6 +464,11 @@ class kraken(Exchange, ImplicitAPI):
|
|
464
464
|
},
|
465
465
|
'hedged': False,
|
466
466
|
'trailing': True,
|
467
|
+
'leverage': False,
|
468
|
+
'marketBuyByCost': True,
|
469
|
+
'marketBuyRequiresPrice': False,
|
470
|
+
'selfTradePrevention': True, # todo implement
|
471
|
+
'iceberg': True, # todo implement
|
467
472
|
},
|
468
473
|
'createOrders': None,
|
469
474
|
'fetchMyTrades': {
|
@@ -1483,8 +1488,10 @@ class kraken(Exchange, ImplicitAPI):
|
|
1483
1488
|
"""
|
1484
1489
|
self.load_markets()
|
1485
1490
|
# only buy orders are supported by the endpoint
|
1486
|
-
|
1487
|
-
|
1491
|
+
req = {
|
1492
|
+
'cost': cost,
|
1493
|
+
}
|
1494
|
+
return self.create_order(symbol, 'market', side, 1, None, self.extend(req, params))
|
1488
1495
|
|
1489
1496
|
def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
1490
1497
|
"""
|
ccxt/krakenfutures.py
CHANGED
@@ -299,6 +299,11 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
299
299
|
},
|
300
300
|
'hedged': False,
|
301
301
|
'trailing': False,
|
302
|
+
'leverage': False,
|
303
|
+
'marketBuyByCost': False,
|
304
|
+
'marketBuyRequiresPrice': False,
|
305
|
+
'selfTradePrevention': False,
|
306
|
+
'iceberg': False,
|
302
307
|
},
|
303
308
|
'createOrders': {
|
304
309
|
'max': 100,
|
ccxt/kucoin.py
CHANGED
@@ -1025,11 +1025,11 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1025
1025
|
},
|
1026
1026
|
'hedged': False,
|
1027
1027
|
'trailing': False,
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1028
|
+
'leverage': False,
|
1029
|
+
'marketBuyByCost': True,
|
1030
|
+
'marketBuyRequiresPrice': False,
|
1031
|
+
'selfTradePrevention': True, # todo implement
|
1032
|
+
'iceberg': True, # todo implement
|
1033
1033
|
},
|
1034
1034
|
'createOrders': {
|
1035
1035
|
'max': 5,
|
@@ -2285,8 +2285,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2285
2285
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2286
2286
|
"""
|
2287
2287
|
self.load_markets()
|
2288
|
-
|
2289
|
-
|
2288
|
+
req = {
|
2289
|
+
'cost': cost,
|
2290
|
+
}
|
2291
|
+
return self.create_order(symbol, 'market', side, 0, None, self.extend(req, params))
|
2290
2292
|
|
2291
2293
|
def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
2292
2294
|
"""
|
ccxt/kucoinfutures.py
CHANGED
@@ -398,11 +398,11 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
398
398
|
},
|
399
399
|
'hedged': False,
|
400
400
|
'trailing': False,
|
401
|
-
#
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
401
|
+
'leverage': True, # todo implement
|
402
|
+
'marketBuyByCost': True,
|
403
|
+
'marketBuyRequiresPrice': False,
|
404
|
+
'selfTradePrevention': True, # todo implement
|
405
|
+
'iceberg': True,
|
406
406
|
},
|
407
407
|
'createOrders': {
|
408
408
|
'max': 20,
|
ccxt/mexc.py
CHANGED
@@ -709,10 +709,12 @@ class mexc(Exchange, ImplicitAPI):
|
|
709
709
|
'PO': True,
|
710
710
|
'GTD': False,
|
711
711
|
},
|
712
|
-
'hedged':
|
713
|
-
# exchange-supported features
|
714
|
-
'selfTradePrevention': False,
|
712
|
+
'hedged': True, # todo implement
|
715
713
|
'trailing': False,
|
714
|
+
'leverage': True, # todo implement
|
715
|
+
'marketBuyByCost': True,
|
716
|
+
'marketBuyRequiresPrice': False,
|
717
|
+
'selfTradePrevention': False,
|
716
718
|
'iceberg': False,
|
717
719
|
},
|
718
720
|
'createOrders': {
|
@@ -768,14 +770,14 @@ class mexc(Exchange, ImplicitAPI):
|
|
768
770
|
'mark': True,
|
769
771
|
'index': True,
|
770
772
|
},
|
771
|
-
'triggerDirection': True,
|
773
|
+
'triggerDirection': True, # todo
|
772
774
|
'stopLossPrice': False, # todo
|
773
|
-
'takeProfitPrice': False,
|
775
|
+
'takeProfitPrice': False, # todo
|
774
776
|
'hedged': True,
|
777
|
+
'leverage': True, # todo
|
778
|
+
'marketBuyByCost': False,
|
775
779
|
},
|
776
|
-
'createOrders':
|
777
|
-
'max': 50,
|
778
|
-
},
|
780
|
+
'createOrders': None, # todo: needs implementation https://mexcdevelop.github.io/apidocs/contract_v1_en/#order-under-maintenance:~:text=Order%20the%20contract%20in%20batch
|
779
781
|
'fetchMyTrades': {
|
780
782
|
'marginMode': False,
|
781
783
|
'limit': 100,
|
@@ -2186,8 +2188,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
2186
2188
|
market = self.market(symbol)
|
2187
2189
|
if not market['spot']:
|
2188
2190
|
raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
|
2189
|
-
|
2190
|
-
|
2191
|
+
req = {
|
2192
|
+
'cost': cost,
|
2193
|
+
}
|
2194
|
+
return self.create_order(symbol, 'market', 'buy', 0, None, self.extend(req, params))
|
2191
2195
|
|
2192
2196
|
def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
2193
2197
|
"""
|
@@ -2204,8 +2208,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
2204
2208
|
market = self.market(symbol)
|
2205
2209
|
if not market['spot']:
|
2206
2210
|
raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
|
2207
|
-
|
2208
|
-
|
2211
|
+
req = {
|
2212
|
+
'cost': cost,
|
2213
|
+
}
|
2214
|
+
return self.create_order(symbol, 'market', 'sell', 0, None, self.extend(req, params))
|
2209
2215
|
|
2210
2216
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
2211
2217
|
"""
|