ccxt 4.3.61__py2.py3-none-any.whl → 4.3.63__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 +2 -1
- ccxt/abstract/binance.py +5 -5
- ccxt/abstract/binancecoinm.py +5 -5
- ccxt/abstract/binanceus.py +5 -5
- ccxt/abstract/binanceusdm.py +5 -5
- ccxt/abstract/cryptocom.py +11 -0
- ccxt/abstract/woo.py +3 -0
- ccxt/ace.py +33 -15
- ccxt/async_support/__init__.py +2 -1
- ccxt/async_support/ace.py +33 -15
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/base/ws/fast_client.py +2 -2
- ccxt/async_support/binance.py +43 -38
- ccxt/async_support/bingx.py +492 -184
- ccxt/async_support/bybit.py +1 -1
- ccxt/async_support/coinbaseinternational.py +1 -1
- ccxt/async_support/cryptocom.py +17 -2
- ccxt/async_support/mercado.py +5 -1
- ccxt/async_support/tradeogre.py +1 -1
- ccxt/async_support/woo.py +296 -81
- ccxt/async_support/xt.py +4 -4
- ccxt/base/errors.py +8 -1
- ccxt/base/exchange.py +8 -2
- ccxt/binance.py +43 -38
- ccxt/bingx.py +492 -184
- ccxt/bybit.py +1 -1
- ccxt/coinbaseinternational.py +1 -1
- ccxt/cryptocom.py +17 -2
- ccxt/mercado.py +5 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +3 -3
- ccxt/pro/binance.py +58 -39
- ccxt/pro/bingx.py +2 -2
- ccxt/pro/bitfinex2.py +8 -6
- ccxt/pro/bitget.py +6 -3
- ccxt/pro/bitmex.py +1 -1
- ccxt/pro/bitopro.py +1 -1
- ccxt/pro/bitvavo.py +1 -1
- ccxt/pro/bybit.py +46 -23
- ccxt/pro/coinbaseexchange.py +2 -2
- ccxt/pro/coincheck.py +1 -1
- ccxt/pro/coinone.py +1 -1
- ccxt/pro/cryptocom.py +8 -3
- ccxt/pro/deribit.py +1 -1
- ccxt/pro/gate.py +8 -5
- ccxt/pro/hollaex.py +1 -1
- ccxt/pro/htx.py +6 -2
- ccxt/pro/hyperliquid.py +3 -3
- ccxt/pro/independentreserve.py +6 -4
- ccxt/pro/kraken.py +80 -7
- ccxt/pro/kucoin.py +1 -1
- ccxt/pro/mexc.py +1 -1
- ccxt/pro/okx.py +5 -5
- ccxt/pro/oxfun.py +1 -1
- ccxt/pro/phemex.py +1 -1
- ccxt/pro/poloniexfutures.py +5 -2
- ccxt/pro/upbit.py +1 -1
- ccxt/pro/vertex.py +2 -2
- ccxt/pro/whitebit.py +1 -1
- ccxt/pro/woo.py +1 -1
- ccxt/pro/woofipro.py +1 -1
- ccxt/tradeogre.py +1 -1
- ccxt/woo.py +296 -81
- ccxt/xt.py +4 -4
- {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/METADATA +4 -4
- {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/RECORD +69 -69
- {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/WHEEL +0 -0
- {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/top_level.txt +0 -0
ccxt/async_support/binance.py
CHANGED
@@ -837,7 +837,7 @@ class binance(Exchange, ImplicitAPI):
|
|
837
837
|
'forceOrders': {'cost': 20, 'noSymbol': 50},
|
838
838
|
'allOrders': 5,
|
839
839
|
'openOrder': 1,
|
840
|
-
'openOrders': 1,
|
840
|
+
'openOrders': {'cost': 1, 'noSymbol': 40},
|
841
841
|
'order': 1,
|
842
842
|
'account': 5,
|
843
843
|
'balance': 5,
|
@@ -1029,18 +1029,18 @@ class binance(Exchange, ImplicitAPI):
|
|
1029
1029
|
'ping': 1,
|
1030
1030
|
'um/order': 1, # 1
|
1031
1031
|
'um/openOrder': 1, # 1
|
1032
|
-
'um/openOrders': 1,
|
1032
|
+
'um/openOrders': {'cost': 1, 'noSymbol': 40},
|
1033
1033
|
'um/allOrders': 5, # 5
|
1034
1034
|
'cm/order': 1, # 1
|
1035
1035
|
'cm/openOrder': 1, # 1
|
1036
|
-
'cm/openOrders': 1,
|
1036
|
+
'cm/openOrders': {'cost': 1, 'noSymbol': 40},
|
1037
1037
|
'cm/allOrders': 20, # 20
|
1038
1038
|
'um/conditional/openOrder': 1,
|
1039
|
-
'um/conditional/openOrders': 40,
|
1039
|
+
'um/conditional/openOrders': {'cost': 1, 'noSymbol': 40},
|
1040
1040
|
'um/conditional/orderHistory': 1,
|
1041
1041
|
'um/conditional/allOrders': 40,
|
1042
1042
|
'cm/conditional/openOrder': 1,
|
1043
|
-
'cm/conditional/openOrders': 40,
|
1043
|
+
'cm/conditional/openOrders': {'cost': 1, 'noSymbol': 40},
|
1044
1044
|
'cm/conditional/orderHistory': 1,
|
1045
1045
|
'cm/conditional/allOrders': 40,
|
1046
1046
|
'margin/order': 5,
|
@@ -6202,10 +6202,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6202
6202
|
marketType = market['type'] if ('type' in market) else defaultType
|
6203
6203
|
type = self.safe_string(params, 'type', marketType)
|
6204
6204
|
elif self.options['warnOnFetchOpenOrdersWithoutSymbol']:
|
6205
|
-
|
6206
|
-
numSymbols = len(symbols)
|
6207
|
-
fetchOpenOrdersRateLimit = self.parse_to_int(numSymbols / 2)
|
6208
|
-
raise ExchangeError(self.id + ' fetchOpenOrders() WARNING: fetching open orders without specifying a symbol is rate-limited to one call per ' + str(fetchOpenOrdersRateLimit) + ' seconds. Do not call self method frequently to avoid ban. Set ' + self.id + '.options["warnOnFetchOpenOrdersWithoutSymbol"] = False to suppress self warning message.')
|
6205
|
+
raise ExchangeError(self.id + ' fetchOpenOrders() WARNING: fetching open orders without specifying a symbol has stricter rate limits(10 times more for spot, 40 times more for other markets) compared to requesting with symbol argument. To acknowledge self warning, set ' + self.id + '.options["warnOnFetchOpenOrdersWithoutSymbol"] = False to suppress self warning message.')
|
6209
6206
|
else:
|
6210
6207
|
defaultType = self.safe_string_2(self.options, 'fetchOpenOrders', 'defaultType', 'spot')
|
6211
6208
|
type = self.safe_string(params, 'type', defaultType)
|
@@ -9104,34 +9101,38 @@ class binance(Exchange, ImplicitAPI):
|
|
9104
9101
|
if marginMode == 'cross':
|
9105
9102
|
# calculate collateral
|
9106
9103
|
precision = self.safe_dict(market, 'precision', {})
|
9107
|
-
|
9108
|
-
|
9109
|
-
|
9110
|
-
|
9111
|
-
if
|
9112
|
-
|
9113
|
-
|
9114
|
-
|
9115
|
-
|
9116
|
-
|
9117
|
-
|
9118
|
-
|
9119
|
-
|
9120
|
-
|
9121
|
-
|
9122
|
-
|
9123
|
-
|
9124
|
-
|
9125
|
-
if side == 'short':
|
9126
|
-
onePlusMaintenanceMarginPercentageString = Precise.string_sub('1', maintenanceMarginPercentageString)
|
9104
|
+
basePrecisionValue = self.safe_string(precision, 'base')
|
9105
|
+
quotePrecisionValue = self.safe_string_2(precision, 'quote', 'price')
|
9106
|
+
precisionIsUndefined = (basePrecisionValue is None) and (quotePrecisionValue is None)
|
9107
|
+
if not precisionIsUndefined:
|
9108
|
+
if linear:
|
9109
|
+
# walletBalance = (liquidationPrice * (±1 + mmp) ± entryPrice) * contracts
|
9110
|
+
onePlusMaintenanceMarginPercentageString = None
|
9111
|
+
entryPriceSignString = entryPriceString
|
9112
|
+
if side == 'short':
|
9113
|
+
onePlusMaintenanceMarginPercentageString = Precise.string_add('1', maintenanceMarginPercentageString)
|
9114
|
+
entryPriceSignString = Precise.string_mul('-1', entryPriceSignString)
|
9115
|
+
else:
|
9116
|
+
onePlusMaintenanceMarginPercentageString = Precise.string_add('-1', maintenanceMarginPercentageString)
|
9117
|
+
inner = Precise.string_mul(liquidationPriceString, onePlusMaintenanceMarginPercentageString)
|
9118
|
+
leftSide = Precise.string_add(inner, entryPriceSignString)
|
9119
|
+
quotePrecision = self.precision_from_string(self.safe_string_2(precision, 'quote', 'price'))
|
9120
|
+
if quotePrecision is not None:
|
9121
|
+
collateralString = Precise.string_div(Precise.string_mul(leftSide, contractsAbs), '1', quotePrecision)
|
9127
9122
|
else:
|
9128
|
-
|
9129
|
-
|
9130
|
-
|
9131
|
-
|
9132
|
-
|
9133
|
-
|
9134
|
-
|
9123
|
+
# walletBalance = (contracts * contractSize) * (±1/entryPrice - (±1 - mmp) / liquidationPrice)
|
9124
|
+
onePlusMaintenanceMarginPercentageString = None
|
9125
|
+
entryPriceSignString = entryPriceString
|
9126
|
+
if side == 'short':
|
9127
|
+
onePlusMaintenanceMarginPercentageString = Precise.string_sub('1', maintenanceMarginPercentageString)
|
9128
|
+
else:
|
9129
|
+
onePlusMaintenanceMarginPercentageString = Precise.string_sub('-1', maintenanceMarginPercentageString)
|
9130
|
+
entryPriceSignString = Precise.string_mul('-1', entryPriceSignString)
|
9131
|
+
leftSide = Precise.string_mul(contractsAbs, contractSizeString)
|
9132
|
+
rightSide = Precise.string_sub(Precise.string_div('1', entryPriceSignString), Precise.string_div(onePlusMaintenanceMarginPercentageString, liquidationPriceString))
|
9133
|
+
basePrecision = self.precision_from_string(self.safe_string(precision, 'base'))
|
9134
|
+
if basePrecision is not None:
|
9135
|
+
collateralString = Precise.string_div(Precise.string_mul(leftSide, rightSide), '1', basePrecision)
|
9135
9136
|
else:
|
9136
9137
|
collateralString = self.safe_string(position, 'isolatedMargin')
|
9137
9138
|
collateralString = '0' if (collateralString is None) else collateralString
|
@@ -9696,9 +9697,10 @@ class binance(Exchange, ImplicitAPI):
|
|
9696
9697
|
#
|
9697
9698
|
result = []
|
9698
9699
|
for i in range(0, len(response)):
|
9699
|
-
|
9700
|
-
entryPrice = self.safe_string(
|
9700
|
+
rawPosition = response[i]
|
9701
|
+
entryPrice = self.safe_string(rawPosition, 'entryPrice')
|
9701
9702
|
if (entryPrice != '0') and (entryPrice != '0.0') and (entryPrice != '0.00000000'):
|
9703
|
+
parsed = self.parse_position_risk(response[i])
|
9702
9704
|
result.append(parsed)
|
9703
9705
|
symbols = self.market_symbols(symbols)
|
9704
9706
|
return self.filter_by_array_positions(result, 'symbol', symbols, False)
|
@@ -11201,6 +11203,8 @@ class binance(Exchange, ImplicitAPI):
|
|
11201
11203
|
request: dict = {}
|
11202
11204
|
if market['option']:
|
11203
11205
|
request['underlyingAsset'] = market['baseId']
|
11206
|
+
if market['expiry'] is None:
|
11207
|
+
raise NotSupported(self.id + ' fetchOpenInterest does not support ' + symbol)
|
11204
11208
|
request['expiration'] = self.yymmdd(market['expiry'])
|
11205
11209
|
else:
|
11206
11210
|
request['symbol'] = market['id']
|
@@ -11242,6 +11246,7 @@ class binance(Exchange, ImplicitAPI):
|
|
11242
11246
|
# ]
|
11243
11247
|
#
|
11244
11248
|
if market['option']:
|
11249
|
+
symbol = market['symbol']
|
11245
11250
|
result = self.parse_open_interests(response, market)
|
11246
11251
|
for i in range(0, len(result)):
|
11247
11252
|
item = result[i]
|