ccxt 4.4.41__py2.py3-none-any.whl → 4.4.43__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 +3 -0
- ccxt/abstract/binancecoinm.py +3 -0
- ccxt/abstract/binanceus.py +3 -0
- ccxt/abstract/binanceusdm.py +3 -0
- ccxt/abstract/bingx.py +4 -0
- ccxt/abstract/bitstamp.py +1 -0
- ccxt/abstract/myokx.py +340 -0
- ccxt/ace.py +1 -1
- ccxt/alpaca.py +0 -1
- ccxt/ascendex.py +0 -1
- ccxt/async_support/__init__.py +3 -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 +15 -15
- ccxt/async_support/bigone.py +0 -1
- ccxt/async_support/binance.py +3 -0
- ccxt/async_support/bingx.py +27 -7
- ccxt/async_support/bitfinex.py +122 -0
- ccxt/async_support/bitstamp.py +54 -0
- ccxt/async_support/blofin.py +16 -7
- 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 +1 -2
- ccxt/async_support/gate.py +1 -2
- ccxt/async_support/gemini.py +63 -6
- 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 +1 -3
- ccxt/async_support/huobijp.py +0 -1
- ccxt/async_support/hyperliquid.py +1 -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 +63 -3
- ccxt/async_support/krakenfutures.py +75 -3
- ccxt/async_support/kucoin.py +1 -3
- 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 +3 -4
- ccxt/async_support/myokx.py +35 -0
- 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 +1 -3
- 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 +14 -14
- 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/vertex.py +63 -4
- ccxt/async_support/wavesexchange.py +4 -5
- ccxt/async_support/whitebit.py +8 -9
- ccxt/async_support/woo.py +100 -14
- ccxt/async_support/woofipro.py +96 -15
- ccxt/async_support/xt.py +3 -2
- 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 +21 -17
- ccxt/bigone.py +0 -1
- ccxt/binance.py +3 -0
- ccxt/bingx.py +27 -7
- ccxt/bitfinex.py +122 -0
- ccxt/bitstamp.py +54 -0
- ccxt/blofin.py +16 -7
- 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 +1 -2
- ccxt/gate.py +1 -2
- ccxt/gemini.py +63 -6
- ccxt/hashkey.py +79 -67
- ccxt/hitbtc.py +47 -5
- ccxt/hollaex.py +4 -6
- ccxt/htx.py +1 -3
- ccxt/huobijp.py +0 -1
- ccxt/hyperliquid.py +1 -1
- ccxt/idex.py +8 -8
- ccxt/independentreserve.py +0 -1
- ccxt/indodax.py +0 -1
- ccxt/kraken.py +63 -3
- ccxt/krakenfutures.py +75 -3
- ccxt/kucoin.py +1 -3
- 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 +3 -4
- ccxt/myokx.py +35 -0
- ccxt/ndax.py +1 -1
- ccxt/novadax.py +4 -6
- ccxt/oceanex.py +0 -1
- ccxt/okcoin.py +1 -3
- ccxt/okx.py +1 -3
- ccxt/onetrading.py +1 -3
- ccxt/p2b.py +1 -1
- ccxt/paradex.py +5 -7
- ccxt/phemex.py +14 -14
- ccxt/poloniex.py +1 -3
- ccxt/poloniexfutures.py +6 -6
- ccxt/pro/__init__.py +3 -1
- ccxt/pro/myokx.py +23 -0
- 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/vertex.py +63 -4
- ccxt/wavesexchange.py +4 -5
- ccxt/whitebit.py +8 -9
- ccxt/woo.py +100 -14
- ccxt/woofipro.py +96 -15
- ccxt/xt.py +3 -2
- ccxt/yobit.py +0 -1
- ccxt/zaif.py +0 -1
- ccxt/zonda.py +1 -2
- {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/METADATA +37 -35
- {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/RECORD +170 -173
- ccxt/async_support/bitbay.py +0 -17
- ccxt/async_support/bitfinex2.py +0 -3625
- ccxt/async_support/hitbtc3.py +0 -16
- ccxt/bitbay.py +0 -17
- ccxt/bitfinex2.py +0 -3624
- ccxt/hitbtc3.py +0 -16
- ccxt/pro/bitfinex2.py +0 -1086
- {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/WHEEL +0 -0
- {ccxt-4.4.41.dist-info → ccxt-4.4.43.dist-info}/top_level.txt +0 -0
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:
|
@@ -3464,13 +3462,15 @@ class phemex(Exchange, ImplicitAPI):
|
|
3464
3462
|
|
3465
3463
|
:param str[] [symbols]: list of unified market symbols
|
3466
3464
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3465
|
+
:param str [params.code]: the currency code to fetch positions for, USD, BTC or USDT, USD is the default
|
3467
3466
|
:param str [params.method]: *USDT contracts only* 'privateGetGAccountsAccountPositions' or 'privateGetAccountsPositions' default is 'privateGetGAccountsAccountPositions'
|
3468
3467
|
:returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
3469
3468
|
"""
|
3470
3469
|
self.load_markets()
|
3471
3470
|
symbols = self.market_symbols(symbols)
|
3472
3471
|
subType = None
|
3473
|
-
code = self.
|
3472
|
+
code = self.safe_string_2(params, 'currency', 'code', 'USD')
|
3473
|
+
params = self.omit(params, ['currency', 'code'])
|
3474
3474
|
settle = None
|
3475
3475
|
market = None
|
3476
3476
|
firstSymbol = self.safe_string(symbols, 0)
|
@@ -3479,15 +3479,15 @@ class phemex(Exchange, ImplicitAPI):
|
|
3479
3479
|
settle = market['settle']
|
3480
3480
|
code = market['settle']
|
3481
3481
|
else:
|
3482
|
-
settle, params = self.handle_option_and_params(params, 'fetchPositions', 'settle',
|
3482
|
+
settle, params = self.handle_option_and_params(params, 'fetchPositions', 'settle', code)
|
3483
3483
|
subType, params = self.handle_sub_type_and_params('fetchPositions', market, params)
|
3484
3484
|
isUSDTSettled = settle == 'USDT'
|
3485
3485
|
if isUSDTSettled:
|
3486
3486
|
code = 'USDT'
|
3487
|
+
elif settle == 'BTC':
|
3488
|
+
code = 'BTC'
|
3487
3489
|
elif code is None:
|
3488
3490
|
code = 'USD' if (subType == 'linear') else 'BTC'
|
3489
|
-
else:
|
3490
|
-
params = self.omit(params, 'code')
|
3491
3491
|
currency = self.currency(code)
|
3492
3492
|
request: dict = {
|
3493
3493
|
'currency': currency['id'],
|
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
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# ----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.4.
|
7
|
+
__version__ = '4.4.43'
|
8
8
|
|
9
9
|
# ----------------------------------------------------------------------------
|
10
10
|
|
@@ -68,6 +68,7 @@ from ccxt.pro.kucoinfutures import kucoinfutures # noqa
|
|
68
68
|
from ccxt.pro.lbank import lbank # noqa: F401
|
69
69
|
from ccxt.pro.luno import luno # noqa: F401
|
70
70
|
from ccxt.pro.mexc import mexc # noqa: F401
|
71
|
+
from ccxt.pro.myokx import myokx # noqa: F401
|
71
72
|
from ccxt.pro.ndax import ndax # noqa: F401
|
72
73
|
from ccxt.pro.okcoin import okcoin # noqa: F401
|
73
74
|
from ccxt.pro.okx import okx # noqa: F401
|
@@ -144,6 +145,7 @@ exchanges = [
|
|
144
145
|
'lbank',
|
145
146
|
'luno',
|
146
147
|
'mexc',
|
148
|
+
'myokx',
|
147
149
|
'ndax',
|
148
150
|
'okcoin',
|
149
151
|
'okx',
|
ccxt/pro/myokx.py
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
4
|
+
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
|
+
|
6
|
+
from ccxt.pro.okx import okx
|
7
|
+
|
8
|
+
|
9
|
+
class myokx(okx):
|
10
|
+
|
11
|
+
def describe(self):
|
12
|
+
return self.deep_extend(super(myokx, self).describe(), {
|
13
|
+
'id': 'myokx',
|
14
|
+
'name': 'MyOKX',
|
15
|
+
'urls': {
|
16
|
+
'api': {
|
17
|
+
'ws': 'wss://wseea.okx.com:8443/ws/v5',
|
18
|
+
},
|
19
|
+
'test': {
|
20
|
+
'ws': 'wss://wseeapap.okx.com:8443/ws/v5',
|
21
|
+
},
|
22
|
+
},
|
23
|
+
})
|
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
ccxt/vertex.py
CHANGED
@@ -93,6 +93,7 @@ class vertex(Exchange, ImplicitAPI):
|
|
93
93
|
'fetchOHLCV': True,
|
94
94
|
'fetchOpenInterest': True,
|
95
95
|
'fetchOpenInterestHistory': False,
|
96
|
+
'fetchOpenInterests': True,
|
96
97
|
'fetchOpenOrders': True,
|
97
98
|
'fetchOrder': True,
|
98
99
|
'fetchOrderBook': True,
|
@@ -1329,16 +1330,74 @@ class vertex(Exchange, ImplicitAPI):
|
|
1329
1330
|
# }
|
1330
1331
|
# }
|
1331
1332
|
#
|
1332
|
-
|
1333
|
+
marketId = self.safe_string(interest, 'ticker_id')
|
1333
1334
|
return self.safe_open_interest({
|
1334
|
-
'symbol': market
|
1335
|
-
'openInterestAmount':
|
1336
|
-
'openInterestValue':
|
1335
|
+
'symbol': self.safe_symbol(marketId, market),
|
1336
|
+
'openInterestAmount': self.safe_number(interest, 'open_interest'),
|
1337
|
+
'openInterestValue': self.safe_number(interest, 'open_interest_usd'),
|
1337
1338
|
'timestamp': None,
|
1338
1339
|
'datetime': None,
|
1339
1340
|
'info': interest,
|
1340
1341
|
}, market)
|
1341
1342
|
|
1343
|
+
def fetch_open_interests(self, symbols: Strings = None, params={}):
|
1344
|
+
"""
|
1345
|
+
Retrieves the open interest for a list of symbols
|
1346
|
+
|
1347
|
+
https://docs.vertexprotocol.com/developer-resources/api/v2/contracts
|
1348
|
+
|
1349
|
+
:param str[] [symbols]: a list of unified CCXT market symbols
|
1350
|
+
:param dict [params]: exchange specific parameters
|
1351
|
+
:returns dict[]: a list of `open interest structures <https://docs.ccxt.com/#/?id=open-interest-structure>`
|
1352
|
+
"""
|
1353
|
+
self.load_markets()
|
1354
|
+
symbols = self.market_symbols(symbols)
|
1355
|
+
response = self.v2ArchiveGetContracts(params)
|
1356
|
+
#
|
1357
|
+
# {
|
1358
|
+
# "ADA-PERP_USDC": {
|
1359
|
+
# "ticker_id": "ADA-PERP_USDC",
|
1360
|
+
# "base_currency": "ADA-PERP",
|
1361
|
+
# "quote_currency": "USDC",
|
1362
|
+
# "last_price": 0.85506,
|
1363
|
+
# "base_volume": 1241320.0,
|
1364
|
+
# "quote_volume": 1122670.9080057142,
|
1365
|
+
# "product_type": "perpetual",
|
1366
|
+
# "contract_price": 0.8558601432685385,
|
1367
|
+
# "contract_price_currency": "USD",
|
1368
|
+
# "open_interest": 104040.0,
|
1369
|
+
# "open_interest_usd": 89043.68930565874,
|
1370
|
+
# "index_price": 0.8561952606869176,
|
1371
|
+
# "mark_price": 0.856293781088936,
|
1372
|
+
# "funding_rate": 0.000116153806226841,
|
1373
|
+
# "next_funding_rate_timestamp": 1734685200,
|
1374
|
+
# "price_change_percent_24h": -12.274325340321374
|
1375
|
+
# },
|
1376
|
+
# }
|
1377
|
+
#
|
1378
|
+
parsedSymbols = []
|
1379
|
+
results = []
|
1380
|
+
markets = list(response.keys())
|
1381
|
+
if symbols is None:
|
1382
|
+
symbols = []
|
1383
|
+
for y in range(0, len(markets)):
|
1384
|
+
tickerId = markets[y]
|
1385
|
+
parsedTickerId = tickerId.split('-')
|
1386
|
+
currentSymbol = parsedTickerId[0] + '/USDC:USDC'
|
1387
|
+
if not self.in_array(currentSymbol, symbols):
|
1388
|
+
symbols.append(currentSymbol)
|
1389
|
+
for i in range(0, len(markets)):
|
1390
|
+
marketId = markets[i]
|
1391
|
+
marketInner = self.safe_market(marketId)
|
1392
|
+
openInterest = self.safe_dict(response, marketId, {})
|
1393
|
+
for j in range(0, len(symbols)):
|
1394
|
+
market = self.market(symbols[j])
|
1395
|
+
tickerId = market['base'] + '_USDC'
|
1396
|
+
if marketInner['marketId'] == tickerId:
|
1397
|
+
parsedSymbols.append(market['symbol'])
|
1398
|
+
results.append(self.parse_open_interest(openInterest, market))
|
1399
|
+
return self.filter_by_array(results, 'symbol', parsedSymbols)
|
1400
|
+
|
1342
1401
|
def fetch_open_interest(self, symbol: str, params={}):
|
1343
1402
|
"""
|
1344
1403
|
Retrieves the open interest of a derivative trading pair
|
ccxt/wavesexchange.py
CHANGED
@@ -1243,7 +1243,7 @@ class wavesexchange(Exchange, ImplicitAPI):
|
|
1243
1243
|
:param float amount: how much of currency you want to trade in units of base currency
|
1244
1244
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1245
1245
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1246
|
-
:param float [params.
|
1246
|
+
:param float [params.triggerPrice]: The price at which a stop order is triggered at
|
1247
1247
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1248
1248
|
"""
|
1249
1249
|
self.check_required_dependencies()
|
@@ -1254,8 +1254,8 @@ class wavesexchange(Exchange, ImplicitAPI):
|
|
1254
1254
|
amountAsset = self.get_asset_id(market['baseId'])
|
1255
1255
|
priceAsset = self.get_asset_id(market['quoteId'])
|
1256
1256
|
isMarketOrder = (type == 'market')
|
1257
|
-
|
1258
|
-
isStopOrder = (
|
1257
|
+
triggerPrice = self.safe_float_2(params, 'triggerPrice', 'stopPrice')
|
1258
|
+
isStopOrder = (triggerPrice is not None)
|
1259
1259
|
if (isMarketOrder) and (price is None):
|
1260
1260
|
raise InvalidOrder(self.id + ' createOrder() requires a price argument for ' + type + ' orders to determine the max price for buy and the min price for sell')
|
1261
1261
|
timestamp = self.milliseconds()
|
@@ -1351,7 +1351,7 @@ class wavesexchange(Exchange, ImplicitAPI):
|
|
1351
1351
|
'c': {
|
1352
1352
|
't': 'sp',
|
1353
1353
|
'v': {
|
1354
|
-
'p': self.to_real_symbol_price(symbol,
|
1354
|
+
'p': self.to_real_symbol_price(symbol, triggerPrice),
|
1355
1355
|
},
|
1356
1356
|
},
|
1357
1357
|
}
|
@@ -1725,7 +1725,6 @@ class wavesexchange(Exchange, ImplicitAPI):
|
|
1725
1725
|
'postOnly': None,
|
1726
1726
|
'side': side,
|
1727
1727
|
'price': price,
|
1728
|
-
'stopPrice': triggerPrice,
|
1729
1728
|
'triggerPrice': triggerPrice,
|
1730
1729
|
'amount': amount,
|
1731
1730
|
'cost': None,
|
ccxt/whitebit.py
CHANGED
@@ -1275,8 +1275,8 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1275
1275
|
marketType = self.safe_string(market, 'type')
|
1276
1276
|
isLimitOrder = type == 'limit'
|
1277
1277
|
isMarketOrder = type == 'market'
|
1278
|
-
|
1279
|
-
isStopOrder = (
|
1278
|
+
triggerPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'activation_price'])
|
1279
|
+
isStopOrder = (triggerPrice is not None)
|
1280
1280
|
postOnly = self.is_post_only(isMarketOrder, False, params)
|
1281
1281
|
marginMode, query = self.handle_margin_mode_and_params('createOrder', params)
|
1282
1282
|
if postOnly:
|
@@ -1287,7 +1287,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1287
1287
|
useCollateralEndpoint = marginMode is not None or marketType == 'swap'
|
1288
1288
|
response = None
|
1289
1289
|
if isStopOrder:
|
1290
|
-
request['activation_price'] = self.price_to_precision(symbol,
|
1290
|
+
request['activation_price'] = self.price_to_precision(symbol, triggerPrice)
|
1291
1291
|
if isLimitOrder:
|
1292
1292
|
# stop limit order
|
1293
1293
|
request['price'] = self.price_to_precision(symbol, price)
|
@@ -1347,11 +1347,11 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1347
1347
|
# Update clientOrderId of the order
|
1348
1348
|
request['clientOrderId'] = clientOrderId
|
1349
1349
|
isLimitOrder = type == 'limit'
|
1350
|
-
|
1351
|
-
isStopOrder = (
|
1350
|
+
triggerPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'activation_price'])
|
1351
|
+
isStopOrder = (triggerPrice is not None)
|
1352
1352
|
params = self.omit(params, ['clOrdId', 'clientOrderId', 'triggerPrice', 'stopPrice'])
|
1353
1353
|
if isStopOrder:
|
1354
|
-
request['activation_price'] = self.price_to_precision(symbol,
|
1354
|
+
request['activation_price'] = self.price_to_precision(symbol, triggerPrice)
|
1355
1355
|
if isLimitOrder:
|
1356
1356
|
# stop limit order
|
1357
1357
|
request['amount'] = self.amount_to_precision(symbol, amount)
|
@@ -1714,7 +1714,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1714
1714
|
if clientOrderId == '':
|
1715
1715
|
clientOrderId = None
|
1716
1716
|
price = self.safe_string(order, 'price')
|
1717
|
-
|
1717
|
+
triggerPrice = self.safe_number(order, 'activation_price')
|
1718
1718
|
orderId = self.safe_string_2(order, 'orderId', 'id')
|
1719
1719
|
type = self.safe_string(order, 'type')
|
1720
1720
|
orderType = self.parse_order_type(type)
|
@@ -1747,8 +1747,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1747
1747
|
'side': side,
|
1748
1748
|
'price': price,
|
1749
1749
|
'type': orderType,
|
1750
|
-
'
|
1751
|
-
'triggerPrice': stopPrice,
|
1750
|
+
'triggerPrice': triggerPrice,
|
1752
1751
|
'amount': amount,
|
1753
1752
|
'filled': filled,
|
1754
1753
|
'remaining': remaining,
|