ccxt 4.4.40__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.
- ccxt/__init__.py +1 -1
- ccxt/abstract/binance.py +3 -0
- ccxt/abstract/binancecoinm.py +3 -0
- ccxt/abstract/binanceus.py +3 -0
- ccxt/abstract/binanceusdm.py +3 -0
- ccxt/abstract/bitmart.py +2 -0
- ccxt/abstract/okx.py +5 -0
- ccxt/ace.py +1 -1
- ccxt/alpaca.py +0 -1
- ccxt/ascendex.py +0 -1
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +1 -1
- ccxt/async_support/alpaca.py +0 -1
- ccxt/async_support/ascendex.py +0 -1
- ccxt/async_support/base/exchange.py +24 -17
- ccxt/async_support/bigone.py +0 -1
- ccxt/async_support/binance.py +27 -24
- ccxt/async_support/bingx.py +5 -1
- ccxt/async_support/bitfinex.py +123 -1
- ccxt/async_support/bitget.py +1 -0
- ccxt/async_support/bitmart.py +243 -2
- ccxt/async_support/blofin.py +16 -7
- ccxt/async_support/bybit.py +8 -8
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinbase.py +8 -9
- ccxt/async_support/coinbaseexchange.py +5 -6
- ccxt/async_support/coinbaseinternational.py +7 -8
- ccxt/async_support/coincatch.py +0 -1
- ccxt/async_support/coincheck.py +0 -1
- ccxt/async_support/coinex.py +91 -6
- ccxt/async_support/coinlist.py +3 -4
- ccxt/async_support/coinmate.py +1 -3
- ccxt/async_support/coinmetro.py +4 -5
- ccxt/async_support/coinone.py +0 -1
- ccxt/async_support/coinsph.py +7 -8
- ccxt/async_support/cryptocom.py +3 -0
- ccxt/async_support/currencycom.py +3 -4
- ccxt/async_support/defx.py +6 -7
- ccxt/async_support/deribit.py +1 -3
- ccxt/async_support/digifinex.py +0 -1
- ccxt/async_support/ellipx.py +0 -2
- ccxt/async_support/exmo.py +61 -6
- ccxt/async_support/gate.py +2 -3
- ccxt/async_support/gemini.py +4 -5
- ccxt/async_support/hashkey.py +79 -67
- ccxt/async_support/hitbtc.py +47 -5
- ccxt/async_support/hollaex.py +4 -6
- ccxt/async_support/htx.py +2 -4
- ccxt/async_support/huobijp.py +0 -1
- ccxt/async_support/hyperliquid.py +60 -1
- ccxt/async_support/idex.py +8 -8
- ccxt/async_support/independentreserve.py +0 -1
- ccxt/async_support/indodax.py +0 -1
- ccxt/async_support/kraken.py +186 -28
- ccxt/async_support/krakenfutures.py +75 -3
- ccxt/async_support/kucoin.py +6 -4
- ccxt/async_support/kucoinfutures.py +10 -9
- ccxt/async_support/kuna.py +1 -3
- ccxt/async_support/latoken.py +1 -3
- ccxt/async_support/lbank.py +0 -1
- ccxt/async_support/luno.py +0 -1
- ccxt/async_support/lykke.py +0 -1
- ccxt/async_support/mercado.py +0 -1
- ccxt/async_support/mexc.py +6 -7
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/novadax.py +4 -6
- ccxt/async_support/oceanex.py +0 -1
- ccxt/async_support/okcoin.py +1 -3
- ccxt/async_support/okx.py +7 -4
- ccxt/async_support/onetrading.py +1 -3
- ccxt/async_support/p2b.py +1 -1
- ccxt/async_support/paradex.py +5 -7
- ccxt/async_support/phemex.py +8 -10
- ccxt/async_support/poloniex.py +1 -3
- ccxt/async_support/poloniexfutures.py +6 -6
- ccxt/async_support/probit.py +0 -1
- ccxt/async_support/timex.py +0 -1
- ccxt/async_support/tokocrypto.py +11 -14
- ccxt/async_support/tradeogre.py +1 -1
- ccxt/async_support/upbit.py +0 -1
- ccxt/async_support/wavesexchange.py +4 -5
- ccxt/async_support/whitebit.py +8 -9
- ccxt/async_support/woo.py +98 -12
- ccxt/async_support/woofipro.py +96 -15
- ccxt/async_support/xt.py +6 -3
- ccxt/async_support/yobit.py +0 -1
- ccxt/async_support/zaif.py +0 -1
- ccxt/async_support/zonda.py +1 -2
- ccxt/base/exchange.py +39 -20
- ccxt/base/types.py +10 -0
- ccxt/bigone.py +0 -1
- ccxt/binance.py +27 -24
- ccxt/bingx.py +5 -1
- ccxt/bitfinex.py +123 -1
- ccxt/bitget.py +1 -0
- ccxt/bitmart.py +243 -2
- ccxt/blofin.py +16 -7
- ccxt/bybit.py +8 -8
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +8 -9
- ccxt/coinbaseexchange.py +5 -6
- ccxt/coinbaseinternational.py +7 -8
- ccxt/coincatch.py +0 -1
- ccxt/coincheck.py +0 -1
- ccxt/coinex.py +91 -6
- ccxt/coinlist.py +3 -4
- ccxt/coinmate.py +1 -3
- ccxt/coinmetro.py +4 -5
- ccxt/coinone.py +0 -1
- ccxt/coinsph.py +7 -8
- ccxt/cryptocom.py +3 -0
- ccxt/currencycom.py +3 -4
- ccxt/defx.py +6 -7
- ccxt/deribit.py +1 -3
- ccxt/digifinex.py +0 -1
- ccxt/ellipx.py +0 -2
- ccxt/exmo.py +61 -6
- ccxt/gate.py +2 -3
- ccxt/gemini.py +4 -5
- ccxt/hashkey.py +79 -67
- ccxt/hitbtc.py +47 -5
- ccxt/hollaex.py +4 -6
- ccxt/htx.py +2 -4
- ccxt/huobijp.py +0 -1
- ccxt/hyperliquid.py +60 -1
- ccxt/idex.py +8 -8
- ccxt/independentreserve.py +0 -1
- ccxt/indodax.py +0 -1
- ccxt/kraken.py +186 -28
- ccxt/krakenfutures.py +75 -3
- ccxt/kucoin.py +6 -4
- ccxt/kucoinfutures.py +10 -9
- ccxt/kuna.py +1 -3
- ccxt/latoken.py +1 -3
- ccxt/lbank.py +0 -1
- ccxt/luno.py +0 -1
- ccxt/lykke.py +0 -1
- ccxt/mercado.py +0 -1
- ccxt/mexc.py +6 -7
- ccxt/ndax.py +1 -1
- ccxt/novadax.py +4 -6
- ccxt/oceanex.py +0 -1
- ccxt/okcoin.py +1 -3
- ccxt/okx.py +7 -4
- ccxt/onetrading.py +1 -3
- ccxt/p2b.py +1 -1
- ccxt/paradex.py +5 -7
- ccxt/phemex.py +8 -10
- ccxt/poloniex.py +1 -3
- ccxt/poloniexfutures.py +6 -6
- ccxt/pro/__init__.py +1 -1
- ccxt/probit.py +0 -1
- ccxt/timex.py +0 -1
- ccxt/tokocrypto.py +11 -14
- ccxt/tradeogre.py +1 -1
- ccxt/upbit.py +0 -1
- ccxt/wavesexchange.py +4 -5
- ccxt/whitebit.py +8 -9
- ccxt/woo.py +98 -12
- ccxt/woofipro.py +96 -15
- ccxt/xt.py +6 -3
- ccxt/yobit.py +0 -1
- ccxt/zaif.py +0 -1
- ccxt/zonda.py +1 -2
- {ccxt-4.4.40.dist-info → ccxt-4.4.42.dist-info}/METADATA +5 -5
- {ccxt-4.4.40.dist-info → ccxt-4.4.42.dist-info}/RECORD +169 -173
- ccxt/bitbay.py +0 -17
- ccxt/bitfinex2.py +0 -3624
- ccxt/hitbtc3.py +0 -16
- ccxt/pro/bitfinex2.py +0 -1086
- {ccxt-4.4.40.dist-info → ccxt-4.4.42.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.40.dist-info → ccxt-4.4.42.dist-info}/WHEEL +0 -0
- {ccxt-4.4.40.dist-info → ccxt-4.4.42.dist-info}/top_level.txt +0 -0
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
|
1515
|
-
:param str [params.
|
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',
|
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(
|
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
|
-
'
|
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
|
-
'
|
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
|
-
'
|
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
ccxt/luno.py
CHANGED
ccxt/lykke.py
CHANGED
ccxt/mercado.py
CHANGED
ccxt/mexc.py
CHANGED
@@ -689,7 +689,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
689
689
|
'broker': 'CCXT',
|
690
690
|
},
|
691
691
|
'features': {
|
692
|
-
'
|
692
|
+
'default': {
|
693
693
|
'sandbox': False,
|
694
694
|
'createOrder': {
|
695
695
|
'marginMode': True,
|
@@ -757,10 +757,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
757
757
|
},
|
758
758
|
},
|
759
759
|
'spot': {
|
760
|
-
'extends': '
|
760
|
+
'extends': 'default',
|
761
761
|
},
|
762
762
|
'forDerivs': {
|
763
|
-
'extends': '
|
763
|
+
'extends': 'default',
|
764
764
|
'createOrder': {
|
765
765
|
'triggerPrice': True,
|
766
766
|
'triggerPriceType': {
|
@@ -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
|
-
|
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
|
2448
|
-
request['triggerPrice'] = self.price_to_precision(symbol,
|
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
|
-
'
|
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'),
|
ccxt/novadax.py
CHANGED
@@ -763,8 +763,8 @@ class novadax(Exchange, ImplicitAPI):
|
|
763
763
|
# "stopPrice": self.price_to_precision(symbol, stopPrice),
|
764
764
|
# "accountId": "...", # subaccount id, optional
|
765
765
|
}
|
766
|
-
|
767
|
-
if
|
766
|
+
triggerPrice = self.safe_value_2(params, 'triggerPrice', 'stopPrice')
|
767
|
+
if triggerPrice is None:
|
768
768
|
if (uppercaseType == 'STOP_LIMIT') or (uppercaseType == 'STOP_MARKET'):
|
769
769
|
raise ArgumentsRequired(self.id + ' createOrder() requires a stopPrice parameter for ' + uppercaseType + ' orders')
|
770
770
|
else:
|
@@ -774,7 +774,7 @@ class novadax(Exchange, ImplicitAPI):
|
|
774
774
|
uppercaseType = 'STOP_MARKET'
|
775
775
|
defaultOperator = 'LTE' if (uppercaseSide == 'BUY') else 'GTE'
|
776
776
|
request['operator'] = self.safe_string(params, 'operator', defaultOperator)
|
777
|
-
request['stopPrice'] = self.price_to_precision(symbol,
|
777
|
+
request['stopPrice'] = self.price_to_precision(symbol, triggerPrice)
|
778
778
|
params = self.omit(params, ['triggerPrice', 'stopPrice'])
|
779
779
|
if (uppercaseType == 'LIMIT') or (uppercaseType == 'STOP_LIMIT'):
|
780
780
|
request['price'] = self.price_to_precision(symbol, price)
|
@@ -1092,7 +1092,6 @@ class novadax(Exchange, ImplicitAPI):
|
|
1092
1092
|
}
|
1093
1093
|
marketId = self.safe_string(order, 'symbol')
|
1094
1094
|
symbol = self.safe_symbol(marketId, market, '_')
|
1095
|
-
stopPrice = self.safe_number(order, 'stopPrice')
|
1096
1095
|
return self.safe_order({
|
1097
1096
|
'id': id,
|
1098
1097
|
'clientOrderId': None,
|
@@ -1106,8 +1105,7 @@ class novadax(Exchange, ImplicitAPI):
|
|
1106
1105
|
'postOnly': None,
|
1107
1106
|
'side': side,
|
1108
1107
|
'price': price,
|
1109
|
-
'
|
1110
|
-
'triggerPrice': stopPrice,
|
1108
|
+
'triggerPrice': self.safe_number(order, 'stopPrice'),
|
1111
1109
|
'amount': amount,
|
1112
1110
|
'cost': cost,
|
1113
1111
|
'average': average,
|
ccxt/oceanex.py
CHANGED
ccxt/okcoin.py
CHANGED
@@ -1845,7 +1845,6 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1845
1845
|
clientOrderId = None # fix empty clientOrderId string
|
1846
1846
|
stopLossPrice = self.safe_number_2(order, 'slTriggerPx', 'slOrdPx')
|
1847
1847
|
takeProfitPrice = self.safe_number_2(order, 'tpTriggerPx', 'tpOrdPx')
|
1848
|
-
stopPrice = self.safe_number_n(order, ['triggerPx', 'moveTriggerPx'])
|
1849
1848
|
reduceOnlyRaw = self.safe_string(order, 'reduceOnly')
|
1850
1849
|
reduceOnly = False
|
1851
1850
|
if reduceOnly is not None:
|
@@ -1866,8 +1865,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1866
1865
|
'price': price,
|
1867
1866
|
'stopLossPrice': stopLossPrice,
|
1868
1867
|
'takeProfitPrice': takeProfitPrice,
|
1869
|
-
'
|
1870
|
-
'triggerPrice': stopPrice,
|
1868
|
+
'triggerPrice': self.safe_number_n(order, ['triggerPx', 'moveTriggerPx']),
|
1871
1869
|
'average': average,
|
1872
1870
|
'cost': cost,
|
1873
1871
|
'amount': amount,
|
ccxt/okx.py
CHANGED
@@ -285,6 +285,7 @@ class okx(Exchange, ImplicitAPI):
|
|
285
285
|
'tradingBot/public/rsi-back-testing': 1,
|
286
286
|
'asset/exchange-list': 5 / 3,
|
287
287
|
'finance/staking-defi/eth/apy-history': 5 / 3,
|
288
|
+
'finance/staking-defi/sol/apy-history': 5 / 3,
|
288
289
|
'finance/savings/lending-rate-summary': 5 / 3,
|
289
290
|
'finance/savings/lending-rate-history': 5 / 3,
|
290
291
|
'finance/fixed-loan/lending-offers': 10 / 3,
|
@@ -423,6 +424,8 @@ class okx(Exchange, ImplicitAPI):
|
|
423
424
|
'finance/staking-defi/eth/balance': 5 / 3,
|
424
425
|
'finance/staking-defi/eth/purchase-redeem-history': 5 / 3,
|
425
426
|
'finance/staking-defi/eth/product-info': 3,
|
427
|
+
'finance/staking-defi/sol/balance': 5 / 3,
|
428
|
+
'finance/staking-defi/sol/purchase-redeem-history': 5 / 3,
|
426
429
|
# copytrading
|
427
430
|
'copytrading/current-subpositions': 1,
|
428
431
|
'copytrading/subpositions-history': 1,
|
@@ -557,6 +560,8 @@ class okx(Exchange, ImplicitAPI):
|
|
557
560
|
# eth staking
|
558
561
|
'finance/staking-defi/eth/purchase': 5,
|
559
562
|
'finance/staking-defi/eth/redeem': 5,
|
563
|
+
'finance/staking-defi/sol/purchase': 5,
|
564
|
+
'finance/staking-defi/sol/redeem': 5,
|
560
565
|
# copytrading
|
561
566
|
'copytrading/algo-order': 1,
|
562
567
|
'copytrading/close-subposition': 1,
|
@@ -3662,7 +3667,6 @@ class okx(Exchange, ImplicitAPI):
|
|
3662
3667
|
clientOrderId = None # fix empty clientOrderId string
|
3663
3668
|
stopLossPrice = self.safe_number_2(order, 'slTriggerPx', 'slOrdPx')
|
3664
3669
|
takeProfitPrice = self.safe_number_2(order, 'tpTriggerPx', 'tpOrdPx')
|
3665
|
-
stopPrice = self.safe_number_n(order, ['triggerPx', 'moveTriggerPx'])
|
3666
3670
|
reduceOnlyRaw = self.safe_string(order, 'reduceOnly')
|
3667
3671
|
reduceOnly = False
|
3668
3672
|
if reduceOnly is not None:
|
@@ -3683,8 +3687,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3683
3687
|
'price': price,
|
3684
3688
|
'stopLossPrice': stopLossPrice,
|
3685
3689
|
'takeProfitPrice': takeProfitPrice,
|
3686
|
-
'
|
3687
|
-
'triggerPrice': stopPrice,
|
3690
|
+
'triggerPrice': self.safe_number_n(order, ['triggerPx', 'moveTriggerPx']),
|
3688
3691
|
'average': average,
|
3689
3692
|
'cost': cost,
|
3690
3693
|
'amount': amount,
|
@@ -7033,7 +7036,7 @@ class okx(Exchange, ImplicitAPI):
|
|
7033
7036
|
# }
|
7034
7037
|
#
|
7035
7038
|
data = self.safe_list(response, 'data', [])
|
7036
|
-
return self.
|
7039
|
+
return self.parse_open_interests_history(data, None, since, limit)
|
7037
7040
|
|
7038
7041
|
def parse_open_interest(self, interest, market: Market = None):
|
7039
7042
|
#
|
ccxt/onetrading.py
CHANGED
@@ -1083,7 +1083,6 @@ class onetrading(Exchange, ImplicitAPI):
|
|
1083
1083
|
side = self.safe_string_lower(rawOrder, 'side')
|
1084
1084
|
type = self.safe_string_lower(rawOrder, 'type')
|
1085
1085
|
timeInForce = self.parse_time_in_force(self.safe_string(rawOrder, 'time_in_force'))
|
1086
|
-
stopPrice = self.safe_number(rawOrder, 'trigger_price')
|
1087
1086
|
postOnly = self.safe_value(rawOrder, 'is_post_only')
|
1088
1087
|
rawTrades = self.safe_value(order, 'trades', [])
|
1089
1088
|
return self.safe_order({
|
@@ -1099,8 +1098,7 @@ class onetrading(Exchange, ImplicitAPI):
|
|
1099
1098
|
'postOnly': postOnly,
|
1100
1099
|
'side': side,
|
1101
1100
|
'price': price,
|
1102
|
-
'
|
1103
|
-
'triggerPrice': stopPrice,
|
1101
|
+
'triggerPrice': self.safe_number(rawOrder, 'trigger_price'),
|
1104
1102
|
'amount': amount,
|
1105
1103
|
'cost': None,
|
1106
1104
|
'average': None,
|
ccxt/p2b.py
CHANGED
@@ -1174,7 +1174,7 @@ class p2b(Exchange, ImplicitAPI):
|
|
1174
1174
|
'postOnly': None,
|
1175
1175
|
'side': self.safe_string(order, 'side'),
|
1176
1176
|
'price': self.safe_string(order, 'price'),
|
1177
|
-
'
|
1177
|
+
'triggerPrice': None,
|
1178
1178
|
'amount': self.safe_string(order, 'amount'),
|
1179
1179
|
'cost': None,
|
1180
1180
|
'average': None,
|
ccxt/paradex.py
CHANGED
@@ -1093,7 +1093,6 @@ class paradex(Exchange, ImplicitAPI):
|
|
1093
1093
|
side = self.safe_string_lower(order, 'side')
|
1094
1094
|
average = self.omit_zero(self.safe_string(order, 'avg_fill_price'))
|
1095
1095
|
remaining = self.omit_zero(self.safe_string(order, 'remaining_size'))
|
1096
|
-
stopPrice = self.safe_string(order, 'trigger_price')
|
1097
1096
|
lastUpdateTimestamp = self.safe_integer(order, 'last_updated_at')
|
1098
1097
|
return self.safe_order({
|
1099
1098
|
'id': orderId,
|
@@ -1110,8 +1109,7 @@ class paradex(Exchange, ImplicitAPI):
|
|
1110
1109
|
'reduceOnly': None,
|
1111
1110
|
'side': side,
|
1112
1111
|
'price': price,
|
1113
|
-
'
|
1114
|
-
'triggerPrice': stopPrice,
|
1112
|
+
'triggerPrice': self.safe_string(order, 'trigger_price'),
|
1115
1113
|
'takeProfitPrice': None,
|
1116
1114
|
'stopLossPrice': None,
|
1117
1115
|
'average': average,
|
@@ -1174,7 +1172,7 @@ class paradex(Exchange, ImplicitAPI):
|
|
1174
1172
|
:param float amount: how much of currency you want to trade in units of base currency
|
1175
1173
|
:param float [price]: the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
1176
1174
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1177
|
-
:param float [params.stopPrice]:
|
1175
|
+
:param float [params.stopPrice]: alias for triggerPrice
|
1178
1176
|
:param float [params.triggerPrice]: The price a trigger order is triggered at
|
1179
1177
|
:param str [params.timeInForce]: "GTC", "IOC", or "POST_ONLY"
|
1180
1178
|
:param bool [params.postOnly]: True or False
|
@@ -1194,7 +1192,7 @@ class paradex(Exchange, ImplicitAPI):
|
|
1194
1192
|
'type': orderType, # LIMIT/MARKET/STOP_LIMIT/STOP_MARKET
|
1195
1193
|
'size': self.amount_to_precision(symbol, amount),
|
1196
1194
|
}
|
1197
|
-
|
1195
|
+
triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
|
1198
1196
|
isMarket = orderType == 'MARKET'
|
1199
1197
|
timeInForce = self.safe_string_upper(params, 'timeInForce')
|
1200
1198
|
postOnly = self.is_post_only(isMarket, None, params)
|
@@ -1212,12 +1210,12 @@ class paradex(Exchange, ImplicitAPI):
|
|
1212
1210
|
clientOrderId = self.safe_string_n(params, ['clOrdID', 'clientOrderId', 'client_order_id'])
|
1213
1211
|
if clientOrderId is not None:
|
1214
1212
|
request['client_id'] = clientOrderId
|
1215
|
-
if
|
1213
|
+
if triggerPrice is not None:
|
1216
1214
|
if isMarket:
|
1217
1215
|
request['type'] = 'STOP_MARKET'
|
1218
1216
|
else:
|
1219
1217
|
request['type'] = 'STOP_LIMIT'
|
1220
|
-
request['trigger_price'] = self.price_to_precision(symbol,
|
1218
|
+
request['trigger_price'] = self.price_to_precision(symbol, triggerPrice)
|
1221
1219
|
params = self.omit(params, ['reduceOnly', 'reduce_only', 'clOrdID', 'clientOrderId', 'client_order_id', 'postOnly', 'timeInForce', 'stopPrice', 'triggerPrice'])
|
1222
1220
|
account = self.retrieve_account()
|
1223
1221
|
now = self.nonce()
|
ccxt/phemex.py
CHANGED
@@ -2198,7 +2198,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2198
2198
|
'currency': self.safe_currency_code(self.safe_string(order, 'feeCurrency')),
|
2199
2199
|
}
|
2200
2200
|
timeInForce = self.parse_time_in_force(self.safe_string(order, 'timeInForce'))
|
2201
|
-
|
2201
|
+
triggerPrice = self.parse_number(self.omit_zero(self.from_ep(self.safe_string(order, 'stopPxEp'))))
|
2202
2202
|
postOnly = (timeInForce == 'PO')
|
2203
2203
|
return self.safe_order({
|
2204
2204
|
'info': order,
|
@@ -2213,8 +2213,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2213
2213
|
'postOnly': postOnly,
|
2214
2214
|
'side': side,
|
2215
2215
|
'price': price,
|
2216
|
-
'
|
2217
|
-
'triggerPrice': stopPrice,
|
2216
|
+
'triggerPrice': triggerPrice,
|
2218
2217
|
'amount': amount,
|
2219
2218
|
'cost': cost,
|
2220
2219
|
'average': average,
|
@@ -2358,7 +2357,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2358
2357
|
if lastTradeTimestamp == 0:
|
2359
2358
|
lastTradeTimestamp = None
|
2360
2359
|
timeInForce = self.parse_time_in_force(self.safe_string(order, 'timeInForce'))
|
2361
|
-
|
2360
|
+
triggerPrice = self.omit_zero(self.safe_string_2(order, 'stopPx', 'stopPxRp'))
|
2362
2361
|
postOnly = (timeInForce == 'PO')
|
2363
2362
|
reduceOnly = self.safe_value(order, 'reduceOnly')
|
2364
2363
|
execInst = self.safe_string(order, 'execInst')
|
@@ -2393,8 +2392,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2393
2392
|
'reduceOnly': reduceOnly,
|
2394
2393
|
'side': side,
|
2395
2394
|
'price': price,
|
2396
|
-
'
|
2397
|
-
'triggerPrice': stopPrice,
|
2395
|
+
'triggerPrice': triggerPrice,
|
2398
2396
|
'takeProfitPrice': takeProfit,
|
2399
2397
|
'stopLossPrice': stopLoss,
|
2400
2398
|
'amount': amount,
|
@@ -2732,12 +2730,12 @@ class phemex(Exchange, ImplicitAPI):
|
|
2732
2730
|
request['orderQtyRq'] = self.amount_to_precision(market['symbol'], amount)
|
2733
2731
|
else:
|
2734
2732
|
request['baseQtyEV'] = self.to_ev(amount, market)
|
2735
|
-
|
2736
|
-
if
|
2733
|
+
triggerPrice = self.safe_string_n(params, ['triggerPrice', 'stopPx', 'stopPrice'])
|
2734
|
+
if triggerPrice is not None:
|
2737
2735
|
if isUSDTSettled:
|
2738
|
-
request['stopPxRp'] = self.price_to_precision(symbol,
|
2736
|
+
request['stopPxRp'] = self.price_to_precision(symbol, triggerPrice)
|
2739
2737
|
else:
|
2740
|
-
request['stopPxEp'] = self.to_ep(
|
2738
|
+
request['stopPxEp'] = self.to_ep(triggerPrice, market)
|
2741
2739
|
params = self.omit(params, ['triggerPrice', 'stopPx', 'stopPrice'])
|
2742
2740
|
response = None
|
2743
2741
|
if isUSDTSettled:
|
ccxt/poloniex.py
CHANGED
@@ -1143,7 +1143,6 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1143
1143
|
'currency': feeCurrencyCode,
|
1144
1144
|
}
|
1145
1145
|
clientOrderId = self.safe_string(order, 'clientOrderId')
|
1146
|
-
triggerPrice = self.safe_string_2(order, 'triggerPrice', 'stopPrice')
|
1147
1146
|
return self.safe_order({
|
1148
1147
|
'info': order,
|
1149
1148
|
'id': id,
|
@@ -1158,8 +1157,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1158
1157
|
'postOnly': None,
|
1159
1158
|
'side': side,
|
1160
1159
|
'price': price,
|
1161
|
-
'
|
1162
|
-
'triggerPrice': triggerPrice,
|
1160
|
+
'triggerPrice': self.safe_string_2(order, 'triggerPrice', 'stopPrice'),
|
1163
1161
|
'cost': None,
|
1164
1162
|
'average': self.safe_string(order, 'avgPrice'),
|
1165
1163
|
'amount': amount,
|
ccxt/poloniexfutures.py
CHANGED
@@ -857,12 +857,12 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
857
857
|
'size': preciseAmount,
|
858
858
|
'leverage': 1,
|
859
859
|
}
|
860
|
-
|
861
|
-
if
|
860
|
+
triggerPrice = self.safe_value_2(params, 'triggerPrice', 'stopPrice')
|
861
|
+
if triggerPrice:
|
862
862
|
request['stop'] = 'up' if (side == 'buy') else 'down'
|
863
863
|
stopPriceType = self.safe_string(params, 'stopPriceType', 'TP')
|
864
864
|
request['stopPriceType'] = stopPriceType
|
865
|
-
request['stopPrice'] = self.price_to_precision(symbol,
|
865
|
+
request['stopPrice'] = self.price_to_precision(symbol, triggerPrice)
|
866
866
|
timeInForce = self.safe_string_upper(params, 'timeInForce')
|
867
867
|
if type == 'limit':
|
868
868
|
if price is None:
|
@@ -911,7 +911,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
911
911
|
'trades': None,
|
912
912
|
'timeInForce': None,
|
913
913
|
'postOnly': None,
|
914
|
-
'
|
914
|
+
'triggerPrice': None,
|
915
915
|
'info': response,
|
916
916
|
}, market)
|
917
917
|
|
@@ -1230,7 +1230,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1230
1230
|
'trades': None,
|
1231
1231
|
'timeInForce': None,
|
1232
1232
|
'postOnly': None,
|
1233
|
-
'
|
1233
|
+
'triggerPrice': None,
|
1234
1234
|
'info': response,
|
1235
1235
|
}))
|
1236
1236
|
return result
|
@@ -1549,7 +1549,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1549
1549
|
'side': self.safe_string(order, 'side'),
|
1550
1550
|
'amount': self.safe_string(order, 'size'),
|
1551
1551
|
'price': self.safe_string(order, 'price'),
|
1552
|
-
'
|
1552
|
+
'triggerPrice': self.safe_string(order, 'stopPrice'),
|
1553
1553
|
'cost': self.safe_string(order, 'dealValue'),
|
1554
1554
|
'filled': filled,
|
1555
1555
|
'remaining': None,
|
ccxt/pro/__init__.py
CHANGED
ccxt/probit.py
CHANGED
ccxt/timex.py
CHANGED
ccxt/tokocrypto.py
CHANGED
@@ -1536,8 +1536,6 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1536
1536
|
# GTX means "Good Till Crossing" and is an equivalent way of saying Post Only
|
1537
1537
|
timeInForce = 'PO'
|
1538
1538
|
postOnly = (type == 'limit_maker') or (timeInForce == 'PO')
|
1539
|
-
stopPriceString = self.safe_string(order, 'stopPrice')
|
1540
|
-
stopPrice = self.parse_number(self.omit_zero(stopPriceString))
|
1541
1539
|
return self.safe_order({
|
1542
1540
|
'info': order,
|
1543
1541
|
'id': id,
|
@@ -1552,8 +1550,7 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1552
1550
|
'reduceOnly': self.safe_value(order, 'reduceOnly'),
|
1553
1551
|
'side': side,
|
1554
1552
|
'price': price,
|
1555
|
-
'
|
1556
|
-
'triggerPrice': stopPrice,
|
1553
|
+
'triggerPrice': self.parse_number(self.omit_zero(self.safe_string(order, 'stopPrice'))),
|
1557
1554
|
'amount': amount,
|
1558
1555
|
'cost': cost,
|
1559
1556
|
'average': average,
|
@@ -1600,8 +1597,8 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1600
1597
|
params = self.omit(params, ['clientId', 'clientOrderId'])
|
1601
1598
|
initialUppercaseType = type.upper()
|
1602
1599
|
uppercaseType = initialUppercaseType
|
1603
|
-
|
1604
|
-
if
|
1600
|
+
triggerPrice = self.safe_value_2(params, 'triggerPrice', 'stopPrice')
|
1601
|
+
if triggerPrice is not None:
|
1605
1602
|
params = self.omit(params, ['triggerPrice', 'stopPrice'])
|
1606
1603
|
if uppercaseType == 'MARKET':
|
1607
1604
|
uppercaseType = 'STOP_LOSS'
|
@@ -1610,7 +1607,7 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1610
1607
|
validOrderTypes = self.safe_value(market['info'], 'orderTypes')
|
1611
1608
|
if not self.in_array(uppercaseType, validOrderTypes):
|
1612
1609
|
if initialUppercaseType != uppercaseType:
|
1613
|
-
raise InvalidOrder(self.id + '
|
1610
|
+
raise InvalidOrder(self.id + ' triggerPrice parameter is not allowed for ' + symbol + ' ' + type + ' orders')
|
1614
1611
|
else:
|
1615
1612
|
raise InvalidOrder(self.id + ' ' + type + ' is not a valid order type for the ' + symbol + ' market')
|
1616
1613
|
reverseOrderTypeMapping: dict = {
|
@@ -1640,7 +1637,7 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1640
1637
|
request['clientId'] = clientOrderId
|
1641
1638
|
# additional required fields depending on the order type
|
1642
1639
|
priceIsRequired = False
|
1643
|
-
|
1640
|
+
triggerPriceIsRequired = False
|
1644
1641
|
quantityIsRequired = False
|
1645
1642
|
#
|
1646
1643
|
# spot/margin
|
@@ -1679,13 +1676,13 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1679
1676
|
priceIsRequired = True
|
1680
1677
|
quantityIsRequired = True
|
1681
1678
|
elif (uppercaseType == 'STOP_LOSS') or (uppercaseType == 'TAKE_PROFIT'):
|
1682
|
-
|
1679
|
+
triggerPriceIsRequired = True
|
1683
1680
|
quantityIsRequired = True
|
1684
1681
|
if market['linear'] or market['inverse']:
|
1685
1682
|
priceIsRequired = True
|
1686
1683
|
elif (uppercaseType == 'STOP_LOSS_LIMIT') or (uppercaseType == 'TAKE_PROFIT_LIMIT'):
|
1687
1684
|
quantityIsRequired = True
|
1688
|
-
|
1685
|
+
triggerPriceIsRequired = True
|
1689
1686
|
priceIsRequired = True
|
1690
1687
|
elif uppercaseType == 'LIMIT_MAKER':
|
1691
1688
|
priceIsRequired = True
|
@@ -1696,11 +1693,11 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1696
1693
|
if price is None:
|
1697
1694
|
raise InvalidOrder(self.id + ' createOrder() requires a price argument for a ' + type + ' order')
|
1698
1695
|
request['price'] = self.price_to_precision(symbol, price)
|
1699
|
-
if
|
1700
|
-
if
|
1701
|
-
raise InvalidOrder(self.id + ' createOrder() requires a
|
1696
|
+
if triggerPriceIsRequired:
|
1697
|
+
if triggerPrice is None:
|
1698
|
+
raise InvalidOrder(self.id + ' createOrder() requires a triggerPrice extra param for a ' + type + ' order')
|
1702
1699
|
else:
|
1703
|
-
request['stopPrice'] = self.price_to_precision(symbol,
|
1700
|
+
request['stopPrice'] = self.price_to_precision(symbol, triggerPrice)
|
1704
1701
|
response = self.privatePostOpenV1Orders(self.extend(request, params))
|
1705
1702
|
#
|
1706
1703
|
# {
|
ccxt/tradeogre.py
CHANGED
@@ -561,7 +561,7 @@ class tradeogre(Exchange, ImplicitAPI):
|
|
561
561
|
'postOnly': None,
|
562
562
|
'side': self.safe_string(order, 'type'),
|
563
563
|
'price': self.safe_string(order, 'price'),
|
564
|
-
'
|
564
|
+
'triggerPrice': None,
|
565
565
|
'amount': self.safe_string(order, 'quantity'),
|
566
566
|
'cost': None,
|
567
567
|
'average': None,
|
ccxt/upbit.py
CHANGED