ccxt 4.4.43__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 +1 -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/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +57 -45
- ccxt/async_support/bingx.py +5 -0
- 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 +5 -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 +5 -0
- ccxt/async_support/hashkey.py +9 -9
- ccxt/async_support/htx.py +101 -3
- ccxt/async_support/hyperliquid.py +5 -0
- 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/ndax.py +1 -1
- ccxt/async_support/oceanex.py +1 -1
- ccxt/async_support/okx.py +5 -6
- ccxt/async_support/whitebit.py +4 -2
- ccxt/async_support/woo.py +5 -3
- ccxt/async_support/woofipro.py +5 -2
- ccxt/base/exchange.py +1 -1
- ccxt/binance.py +57 -45
- ccxt/bingx.py +5 -0
- ccxt/bitfinex.py +6 -2
- ccxt/bitget.py +3 -1
- ccxt/bitmart.py +4 -7
- ccxt/bitmex.py +3 -5
- ccxt/bitstamp.py +5 -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 +5 -0
- ccxt/hashkey.py +9 -9
- ccxt/htx.py +101 -3
- ccxt/hyperliquid.py +5 -0
- 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/ndax.py +1 -1
- ccxt/oceanex.py +1 -1
- ccxt/okx.py +5 -6
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitcoincom.py +4 -1
- ccxt/pro/bitopro.py +1 -1
- ccxt/whitebit.py +4 -2
- ccxt/woo.py +5 -3
- ccxt/woofipro.py +5 -2
- {ccxt-4.4.43.dist-info → ccxt-4.4.44.dist-info}/METADATA +4 -4
- {ccxt-4.4.43.dist-info → ccxt-4.4.44.dist-info}/RECORD +78 -78
- {ccxt-4.4.43.dist-info → ccxt-4.4.44.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.43.dist-info → ccxt-4.4.44.dist-info}/WHEEL +0 -0
- {ccxt-4.4.43.dist-info → ccxt-4.4.44.dist-info}/top_level.txt +0 -0
@@ -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/async_support/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/async_support/coinex.py
CHANGED
@@ -533,11 +533,11 @@ class coinex(Exchange, ImplicitAPI):
|
|
533
533
|
},
|
534
534
|
'hedged': False,
|
535
535
|
'trailing': False,
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
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,
|
ccxt/async_support/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/async_support/defx.py
CHANGED
@@ -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.
|
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
|
932
|
+
if buyerMaker:
|
933
933
|
side = 'sell'
|
934
934
|
else:
|
935
935
|
side = 'buy'
|
ccxt/async_support/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/async_support/gate.py
CHANGED
@@ -724,7 +724,7 @@ class gate(Exchange, ImplicitAPI):
|
|
724
724
|
},
|
725
725
|
},
|
726
726
|
'features': {
|
727
|
-
'
|
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
|
-
#
|
747
|
-
'
|
748
|
-
'
|
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
|
@@ -781,6 +783,9 @@ class gate(Exchange, ImplicitAPI):
|
|
781
783
|
'limit': 1000,
|
782
784
|
},
|
783
785
|
},
|
786
|
+
'spot': {
|
787
|
+
'extends': 'default',
|
788
|
+
},
|
784
789
|
'forDerivatives': {
|
785
790
|
'extends': 'spot',
|
786
791
|
'createOrder': {
|
ccxt/async_support/gemini.py
CHANGED
@@ -330,6 +330,11 @@ class gemini(Exchange, ImplicitAPI):
|
|
330
330
|
},
|
331
331
|
'hedged': False,
|
332
332
|
'trailing': False,
|
333
|
+
'leverage': False,
|
334
|
+
'marketBuyByCost': True,
|
335
|
+
'marketBuyRequiresPrice': False,
|
336
|
+
'selfTradePrevention': False,
|
337
|
+
'iceberg': False,
|
333
338
|
},
|
334
339
|
'createOrders': None,
|
335
340
|
'fetchMyTrades': {
|
ccxt/async_support/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 await self.create_order(symbol, 'market', 'buy', cost, None, self.extend(req, params))
|
2398
2398
|
|
2399
2399
|
async def create_spot_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}) -> Order:
|
2400
2400
|
"""
|
ccxt/async_support/htx.py
CHANGED
@@ -115,6 +115,7 @@ class htx(Exchange, ImplicitAPI):
|
|
115
115
|
'fetchOHLCV': True,
|
116
116
|
'fetchOpenInterest': True,
|
117
117
|
'fetchOpenInterestHistory': True,
|
118
|
+
'fetchOpenInterests': True,
|
118
119
|
'fetchOpenOrder': None,
|
119
120
|
'fetchOpenOrders': True,
|
120
121
|
'fetchOrder': True,
|
@@ -1270,9 +1271,11 @@ class htx(Exchange, ImplicitAPI):
|
|
1270
1271
|
},
|
1271
1272
|
'hedged': False,
|
1272
1273
|
'trailing': False,
|
1273
|
-
# exchange-specific features
|
1274
1274
|
'iceberg': False,
|
1275
|
-
'selfTradePrevention': True,
|
1275
|
+
'selfTradePrevention': True, # todo implement
|
1276
|
+
'leverage': True, # todo implement
|
1277
|
+
'marketBuyByCost': True,
|
1278
|
+
'marketBuyRequiresPrice': True,
|
1276
1279
|
},
|
1277
1280
|
'createOrders': {
|
1278
1281
|
'max': 10,
|
@@ -8004,6 +8007,100 @@ class htx(Exchange, ImplicitAPI):
|
|
8004
8007
|
tick = self.safe_list(data, 'tick')
|
8005
8008
|
return self.parse_open_interests_history(tick, market, since, limit)
|
8006
8009
|
|
8010
|
+
async def fetch_open_interests(self, symbols: Strings = None, params={}):
|
8011
|
+
"""
|
8012
|
+
Retrieves the open interest for a list of symbols
|
8013
|
+
|
8014
|
+
https://huobiapi.github.io/docs/dm/v1/en/#get-contract-open-interest-information
|
8015
|
+
https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-swap-open-interest-information
|
8016
|
+
https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-swap-open-interest-information
|
8017
|
+
|
8018
|
+
:param str[] [symbols]: a list of unified CCXT market symbols
|
8019
|
+
:param dict [params]: exchange specific parameters
|
8020
|
+
:returns dict[]: a list of `open interest structures <https://docs.ccxt.com/#/?id=open-interest-structure>`
|
8021
|
+
"""
|
8022
|
+
await self.load_markets()
|
8023
|
+
symbols = self.market_symbols(symbols)
|
8024
|
+
market = None
|
8025
|
+
if symbols is not None:
|
8026
|
+
symbolsLength = len(symbols)
|
8027
|
+
if symbolsLength > 0:
|
8028
|
+
first = self.safe_string(symbols, 0)
|
8029
|
+
market = self.market(first)
|
8030
|
+
request: dict = {}
|
8031
|
+
subType = None
|
8032
|
+
subType, params = self.handle_sub_type_and_params('fetchPositions', market, params, 'linear')
|
8033
|
+
marketType = None
|
8034
|
+
marketType, params = self.handle_market_type_and_params('fetchPositions', market, params)
|
8035
|
+
response = None
|
8036
|
+
if marketType == 'future':
|
8037
|
+
response = await self.contractPublicGetApiV1ContractOpenInterest(self.extend(request, params))
|
8038
|
+
#
|
8039
|
+
# {
|
8040
|
+
# "status": "ok",
|
8041
|
+
# "data": [
|
8042
|
+
# {
|
8043
|
+
# "volume": 118850.000000000000000000,
|
8044
|
+
# "amount": 635.502025211544374189,
|
8045
|
+
# "symbol": "BTC",
|
8046
|
+
# "contract_type": "self_week",
|
8047
|
+
# "contract_code": "BTC220930",
|
8048
|
+
# "trade_amount": 1470.9400749347598691119206024033947897351,
|
8049
|
+
# "trade_volume": 286286,
|
8050
|
+
# "trade_turnover": 28628600.000000000000000000
|
8051
|
+
# }
|
8052
|
+
# ],
|
8053
|
+
# "ts": 1664337928805
|
8054
|
+
# }
|
8055
|
+
#
|
8056
|
+
elif subType == 'inverse':
|
8057
|
+
response = await self.contractPublicGetSwapApiV1SwapOpenInterest(self.extend(request, params))
|
8058
|
+
#
|
8059
|
+
# {
|
8060
|
+
# "status": "ok",
|
8061
|
+
# "data": [
|
8062
|
+
# {
|
8063
|
+
# "volume": 518018.000000000000000000,
|
8064
|
+
# "amount": 2769.675777407074725180,
|
8065
|
+
# "symbol": "BTC",
|
8066
|
+
# "contract_code": "BTC-USD",
|
8067
|
+
# "trade_amount": 9544.4032080046491323463688602729806842458,
|
8068
|
+
# "trade_volume": 1848448,
|
8069
|
+
# "trade_turnover": 184844800.000000000000000000
|
8070
|
+
# }
|
8071
|
+
# ],
|
8072
|
+
# "ts": 1664337226028
|
8073
|
+
# }
|
8074
|
+
#
|
8075
|
+
else:
|
8076
|
+
request['contract_type'] = 'swap'
|
8077
|
+
response = await self.contractPublicGetLinearSwapApiV1SwapOpenInterest(self.extend(request, params))
|
8078
|
+
#
|
8079
|
+
# {
|
8080
|
+
# "status": "ok",
|
8081
|
+
# "data": [
|
8082
|
+
# {
|
8083
|
+
# "volume": 7192610.000000000000000000,
|
8084
|
+
# "amount": 7192.610000000000000000,
|
8085
|
+
# "symbol": "BTC",
|
8086
|
+
# "value": 134654290.332000000000000000,
|
8087
|
+
# "contract_code": "BTC-USDT",
|
8088
|
+
# "trade_amount": 70692.804,
|
8089
|
+
# "trade_volume": 70692804,
|
8090
|
+
# "trade_turnover": 1379302592.9518,
|
8091
|
+
# "business_type": "swap",
|
8092
|
+
# "pair": "BTC-USDT",
|
8093
|
+
# "contract_type": "swap",
|
8094
|
+
# "trade_partition": "USDT"
|
8095
|
+
# }
|
8096
|
+
# ],
|
8097
|
+
# "ts": 1664336503144
|
8098
|
+
# }
|
8099
|
+
#
|
8100
|
+
data = self.safe_list(response, 'data', [])
|
8101
|
+
result = self.parse_open_interests(data)
|
8102
|
+
return self.filter_by_array(result, 'symbol', symbols)
|
8103
|
+
|
8007
8104
|
async def fetch_open_interest(self, symbol: str, params={}):
|
8008
8105
|
"""
|
8009
8106
|
Retrieves the open interest of a currency
|
@@ -8162,8 +8259,9 @@ class htx(Exchange, ImplicitAPI):
|
|
8162
8259
|
timestamp = self.safe_integer(interest, 'ts')
|
8163
8260
|
amount = self.safe_number(interest, 'volume')
|
8164
8261
|
value = self.safe_number(interest, 'value')
|
8262
|
+
marketId = self.safe_string(interest, 'contract_code')
|
8165
8263
|
return self.safe_open_interest({
|
8166
|
-
'symbol': self.
|
8264
|
+
'symbol': self.safe_symbol(marketId, market),
|
8167
8265
|
'baseVolume': amount, # deprecated
|
8168
8266
|
'quoteVolume': value, # deprecated
|
8169
8267
|
'openInterestAmount': amount,
|
@@ -247,6 +247,11 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
247
247
|
},
|
248
248
|
'hedged': False,
|
249
249
|
'trailing': False,
|
250
|
+
'leverage': False,
|
251
|
+
'marketBuyByCost': False,
|
252
|
+
'marketBuyRequiresPrice': False,
|
253
|
+
'selfTradePrevention': False,
|
254
|
+
'iceberg': False,
|
250
255
|
},
|
251
256
|
'createOrders': {
|
252
257
|
'max': 1000,
|
ccxt/async_support/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
|
await self.load_markets()
|
1485
1490
|
# only buy orders are supported by the endpoint
|
1486
|
-
|
1487
|
-
|
1491
|
+
req = {
|
1492
|
+
'cost': cost,
|
1493
|
+
}
|
1494
|
+
return await self.create_order(symbol, 'market', side, 1, None, self.extend(req, params))
|
1488
1495
|
|
1489
1496
|
async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
1490
1497
|
"""
|
@@ -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/async_support/kucoin.py
CHANGED
@@ -1026,11 +1026,11 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1026
1026
|
},
|
1027
1027
|
'hedged': False,
|
1028
1028
|
'trailing': False,
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1029
|
+
'leverage': False,
|
1030
|
+
'marketBuyByCost': True,
|
1031
|
+
'marketBuyRequiresPrice': False,
|
1032
|
+
'selfTradePrevention': True, # todo implement
|
1033
|
+
'iceberg': True, # todo implement
|
1034
1034
|
},
|
1035
1035
|
'createOrders': {
|
1036
1036
|
'max': 5,
|
@@ -2286,8 +2286,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2286
2286
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2287
2287
|
"""
|
2288
2288
|
await self.load_markets()
|
2289
|
-
|
2290
|
-
|
2289
|
+
req = {
|
2290
|
+
'cost': cost,
|
2291
|
+
}
|
2292
|
+
return await self.create_order(symbol, 'market', side, 0, None, self.extend(req, params))
|
2291
2293
|
|
2292
2294
|
async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
2293
2295
|
"""
|
@@ -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/async_support/mexc.py
CHANGED
@@ -710,10 +710,12 @@ class mexc(Exchange, ImplicitAPI):
|
|
710
710
|
'PO': True,
|
711
711
|
'GTD': False,
|
712
712
|
},
|
713
|
-
'hedged':
|
714
|
-
# exchange-supported features
|
715
|
-
'selfTradePrevention': False,
|
713
|
+
'hedged': True, # todo implement
|
716
714
|
'trailing': False,
|
715
|
+
'leverage': True, # todo implement
|
716
|
+
'marketBuyByCost': True,
|
717
|
+
'marketBuyRequiresPrice': False,
|
718
|
+
'selfTradePrevention': False,
|
717
719
|
'iceberg': False,
|
718
720
|
},
|
719
721
|
'createOrders': {
|
@@ -769,14 +771,14 @@ class mexc(Exchange, ImplicitAPI):
|
|
769
771
|
'mark': True,
|
770
772
|
'index': True,
|
771
773
|
},
|
772
|
-
'triggerDirection': True,
|
774
|
+
'triggerDirection': True, # todo
|
773
775
|
'stopLossPrice': False, # todo
|
774
|
-
'takeProfitPrice': False,
|
776
|
+
'takeProfitPrice': False, # todo
|
775
777
|
'hedged': True,
|
778
|
+
'leverage': True, # todo
|
779
|
+
'marketBuyByCost': False,
|
776
780
|
},
|
777
|
-
'createOrders':
|
778
|
-
'max': 50,
|
779
|
-
},
|
781
|
+
'createOrders': None, # todo: needs implementation https://mexcdevelop.github.io/apidocs/contract_v1_en/#order-under-maintenance:~:text=Order%20the%20contract%20in%20batch
|
780
782
|
'fetchMyTrades': {
|
781
783
|
'marginMode': False,
|
782
784
|
'limit': 100,
|
@@ -2187,8 +2189,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
2187
2189
|
market = self.market(symbol)
|
2188
2190
|
if not market['spot']:
|
2189
2191
|
raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
|
2190
|
-
|
2191
|
-
|
2192
|
+
req = {
|
2193
|
+
'cost': cost,
|
2194
|
+
}
|
2195
|
+
return await self.create_order(symbol, 'market', 'buy', 0, None, self.extend(req, params))
|
2192
2196
|
|
2193
2197
|
async def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
2194
2198
|
"""
|
@@ -2205,8 +2209,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
2205
2209
|
market = self.market(symbol)
|
2206
2210
|
if not market['spot']:
|
2207
2211
|
raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
|
2208
|
-
|
2209
|
-
|
2212
|
+
req = {
|
2213
|
+
'cost': cost,
|
2214
|
+
}
|
2215
|
+
return await self.create_order(symbol, 'market', 'sell', 0, None, self.extend(req, params))
|
2210
2216
|
|
2211
2217
|
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
2212
2218
|
"""
|
ccxt/async_support/ndax.py
CHANGED
ccxt/async_support/oceanex.py
CHANGED
ccxt/async_support/okx.py
CHANGED
@@ -1207,7 +1207,6 @@ class okx(Exchange, ImplicitAPI):
|
|
1207
1207
|
'brokerId': 'e847386590ce4dBC',
|
1208
1208
|
},
|
1209
1209
|
'features': {
|
1210
|
-
# https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-place-order
|
1211
1210
|
'default': {
|
1212
1211
|
'sandbox': True,
|
1213
1212
|
'createOrder': {
|
@@ -1236,12 +1235,12 @@ class okx(Exchange, ImplicitAPI):
|
|
1236
1235
|
'GTD': False,
|
1237
1236
|
},
|
1238
1237
|
'hedged': True,
|
1239
|
-
# even though the below params not unified yet, it's useful metadata for users to know that exchange supports them
|
1240
|
-
'selfTradePrevention': True,
|
1241
1238
|
'trailing': True,
|
1242
|
-
'
|
1243
|
-
'
|
1244
|
-
'
|
1239
|
+
'iceberg': True, # todo implement
|
1240
|
+
'leverage': False,
|
1241
|
+
'selfTradePrevention': True, # todo implement
|
1242
|
+
'marketBuyByCost': True,
|
1243
|
+
'marketBuyRequiresPrice': False,
|
1245
1244
|
},
|
1246
1245
|
'createOrders': {
|
1247
1246
|
'max': 20,
|
ccxt/async_support/whitebit.py
CHANGED
@@ -1217,9 +1217,11 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1217
1217
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1218
1218
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1219
1219
|
"""
|
1220
|
-
|
1220
|
+
req = {
|
1221
|
+
'cost': cost,
|
1222
|
+
}
|
1221
1223
|
# only buy side is supported
|
1222
|
-
return await self.create_order(symbol, 'market', side, 0, None, params)
|
1224
|
+
return await self.create_order(symbol, 'market', side, 0, None, self.extend(req, params))
|
1223
1225
|
|
1224
1226
|
async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}) -> Order:
|
1225
1227
|
"""
|
ccxt/async_support/woo.py
CHANGED
@@ -344,9 +344,11 @@ class woo(Exchange, ImplicitAPI):
|
|
344
344
|
},
|
345
345
|
'hedged': False,
|
346
346
|
'trailing': True,
|
347
|
-
|
348
|
-
|
349
|
-
|
347
|
+
'leverage': False,
|
348
|
+
'marketBuyByCost': True,
|
349
|
+
'marketBuyRequiresPrice': False,
|
350
|
+
'selfTradePrevention': False,
|
351
|
+
'iceberg': True, # todo implement
|
350
352
|
},
|
351
353
|
'createOrders': None,
|
352
354
|
'fetchMyTrades': {
|
ccxt/async_support/woofipro.py
CHANGED
@@ -327,8 +327,11 @@ class woofipro(Exchange, ImplicitAPI):
|
|
327
327
|
},
|
328
328
|
'hedged': False,
|
329
329
|
'trailing': True,
|
330
|
-
#
|
331
|
-
|
330
|
+
'leverage': True, # todo implement
|
331
|
+
'marketBuyByCost': False,
|
332
|
+
'marketBuyRequiresPrice': False,
|
333
|
+
'selfTradePrevention': False,
|
334
|
+
'iceberg': True, # todo implement
|
332
335
|
},
|
333
336
|
'createOrders': {
|
334
337
|
'max': 10,
|