ccxt 4.4.30__py2.py3-none-any.whl → 4.4.32__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/ace.py +36 -12
- ccxt/alpaca.py +62 -22
- ccxt/ascendex.py +65 -30
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +36 -12
- ccxt/async_support/alpaca.py +62 -22
- ccxt/async_support/ascendex.py +65 -30
- ccxt/async_support/base/exchange.py +3 -3
- ccxt/async_support/base/ws/aiohttp_client.py +25 -3
- ccxt/async_support/bigone.py +71 -27
- ccxt/async_support/binance.py +555 -323
- ccxt/async_support/bingx.py +208 -108
- ccxt/async_support/bit2c.py +34 -12
- ccxt/async_support/bitbank.py +42 -14
- ccxt/async_support/bitbns.py +17 -9
- ccxt/async_support/bitfinex.py +68 -24
- ccxt/async_support/bitfinex2.py +116 -44
- ccxt/async_support/bitflyer.py +54 -18
- ccxt/async_support/bitget.py +277 -145
- ccxt/async_support/bithumb.py +39 -14
- ccxt/async_support/bitmart.py +145 -79
- ccxt/async_support/bitmex.py +90 -30
- ccxt/async_support/bitopro.py +66 -22
- ccxt/async_support/bitrue.py +109 -57
- ccxt/async_support/bitso.py +55 -19
- ccxt/async_support/bitstamp.py +84 -36
- ccxt/async_support/bitteam.py +51 -17
- ccxt/async_support/bitvavo.py +57 -22
- ccxt/async_support/bl3p.py +26 -10
- ccxt/async_support/blockchaincom.py +63 -21
- ccxt/async_support/blofin.py +95 -38
- ccxt/async_support/btcalpha.py +48 -16
- ccxt/async_support/btcbox.py +27 -9
- ccxt/async_support/btcmarkets.py +57 -19
- ccxt/async_support/btcturk.py +36 -12
- ccxt/async_support/bybit.py +251 -95
- ccxt/async_support/cex.py +65 -22
- ccxt/async_support/coinbase.py +138 -56
- ccxt/async_support/coinbaseexchange.py +76 -28
- ccxt/async_support/coinbaseinternational.py +75 -27
- ccxt/async_support/coincatch.py +191 -97
- ccxt/async_support/coincheck.py +33 -11
- ccxt/async_support/coinex.py +212 -101
- ccxt/async_support/coinlist.py +87 -30
- ccxt/async_support/coinmate.py +55 -24
- ccxt/async_support/coinmetro.py +52 -18
- ccxt/async_support/coinone.py +27 -10
- ccxt/async_support/coinsph.py +73 -27
- ccxt/async_support/coinspot.py +25 -9
- ccxt/async_support/cryptocom.py +103 -38
- ccxt/async_support/currencycom.py +70 -23
- ccxt/async_support/delta.py +90 -30
- ccxt/async_support/deribit.py +131 -50
- ccxt/async_support/digifinex.py +114 -51
- ccxt/async_support/exmo.py +104 -45
- ccxt/async_support/gate.py +313 -157
- ccxt/async_support/gemini.py +57 -20
- ccxt/async_support/hashkey.py +151 -66
- ccxt/async_support/hitbtc.py +157 -74
- ccxt/async_support/hollaex.py +76 -25
- ccxt/async_support/htx.py +297 -240
- ccxt/async_support/huobijp.py +1 -0
- ccxt/async_support/hyperliquid.py +94 -38
- ccxt/async_support/idex.py +73 -24
- ccxt/async_support/independentreserve.py +12 -5
- ccxt/async_support/indodax.py +54 -17
- ccxt/async_support/kraken.py +108 -36
- ccxt/async_support/krakenfutures.py +88 -34
- ccxt/async_support/kucoin.py +214 -110
- ccxt/async_support/kucoinfutures.py +209 -64
- ccxt/async_support/kuna.py +80 -39
- ccxt/async_support/latoken.py +70 -33
- ccxt/async_support/lbank.py +89 -38
- ccxt/async_support/luno.py +54 -19
- ccxt/async_support/lykke.py +54 -19
- ccxt/async_support/mercado.py +1 -0
- ccxt/async_support/mexc.py +226 -108
- ccxt/async_support/ndax.py +58 -19
- ccxt/async_support/novadax.py +67 -22
- ccxt/async_support/oceanex.py +58 -19
- ccxt/async_support/okcoin.py +81 -38
- ccxt/async_support/okx.py +270 -109
- ccxt/async_support/onetrading.py +3 -1
- ccxt/async_support/oxfun.py +95 -36
- ccxt/async_support/p2b.py +49 -23
- ccxt/async_support/paradex.py +75 -27
- ccxt/async_support/paymium.py +31 -11
- ccxt/async_support/phemex.py +108 -56
- ccxt/async_support/poloniex.py +80 -30
- ccxt/async_support/poloniexfutures.py +72 -30
- ccxt/async_support/probit.py +64 -22
- ccxt/async_support/timex.py +58 -19
- ccxt/async_support/tokocrypto.py +63 -22
- ccxt/async_support/tradeogre.py +7 -2
- ccxt/async_support/upbit.py +72 -25
- ccxt/async_support/vertex.py +74 -28
- ccxt/async_support/wavesexchange.py +32 -8
- ccxt/async_support/wazirx.py +51 -17
- ccxt/async_support/whitebit.py +105 -41
- ccxt/async_support/woo.py +162 -65
- ccxt/async_support/woofipro.py +119 -50
- ccxt/async_support/xt.py +150 -73
- ccxt/async_support/yobit.py +49 -16
- ccxt/async_support/zaif.py +30 -10
- ccxt/async_support/zonda.py +46 -16
- ccxt/base/exchange.py +47 -35
- ccxt/base/types.py +1 -0
- ccxt/bigone.py +71 -27
- ccxt/binance.py +555 -323
- ccxt/bingx.py +208 -108
- ccxt/bit2c.py +34 -12
- ccxt/bitbank.py +42 -14
- ccxt/bitbns.py +17 -9
- ccxt/bitfinex.py +68 -24
- ccxt/bitfinex2.py +116 -44
- ccxt/bitflyer.py +54 -18
- ccxt/bitget.py +277 -145
- ccxt/bithumb.py +39 -14
- ccxt/bitmart.py +145 -79
- ccxt/bitmex.py +90 -30
- ccxt/bitopro.py +66 -22
- ccxt/bitrue.py +109 -57
- ccxt/bitso.py +55 -19
- ccxt/bitstamp.py +84 -36
- ccxt/bitteam.py +51 -17
- ccxt/bitvavo.py +57 -22
- ccxt/bl3p.py +26 -10
- ccxt/blockchaincom.py +63 -21
- ccxt/blofin.py +95 -38
- ccxt/btcalpha.py +48 -16
- ccxt/btcbox.py +27 -9
- ccxt/btcmarkets.py +57 -19
- ccxt/btcturk.py +36 -12
- ccxt/bybit.py +251 -95
- ccxt/cex.py +65 -22
- ccxt/coinbase.py +138 -56
- ccxt/coinbaseexchange.py +76 -28
- ccxt/coinbaseinternational.py +75 -27
- ccxt/coincatch.py +191 -97
- ccxt/coincheck.py +33 -11
- ccxt/coinex.py +212 -101
- ccxt/coinlist.py +87 -30
- ccxt/coinmate.py +55 -24
- ccxt/coinmetro.py +52 -18
- ccxt/coinone.py +27 -10
- ccxt/coinsph.py +73 -27
- ccxt/coinspot.py +25 -9
- ccxt/cryptocom.py +103 -38
- ccxt/currencycom.py +70 -23
- ccxt/delta.py +90 -30
- ccxt/deribit.py +131 -50
- ccxt/digifinex.py +114 -51
- ccxt/exmo.py +104 -45
- ccxt/gate.py +313 -157
- ccxt/gemini.py +57 -20
- ccxt/hashkey.py +151 -66
- ccxt/hitbtc.py +157 -74
- ccxt/hollaex.py +76 -25
- ccxt/htx.py +297 -240
- ccxt/huobijp.py +1 -0
- ccxt/hyperliquid.py +94 -38
- ccxt/idex.py +73 -24
- ccxt/independentreserve.py +12 -5
- ccxt/indodax.py +54 -17
- ccxt/kraken.py +108 -36
- ccxt/krakenfutures.py +88 -34
- ccxt/kucoin.py +214 -110
- ccxt/kucoinfutures.py +209 -64
- ccxt/kuna.py +80 -39
- ccxt/latoken.py +70 -33
- ccxt/lbank.py +89 -38
- ccxt/luno.py +54 -19
- ccxt/lykke.py +54 -19
- ccxt/mercado.py +1 -0
- ccxt/mexc.py +226 -108
- ccxt/ndax.py +58 -19
- ccxt/novadax.py +67 -22
- ccxt/oceanex.py +58 -19
- ccxt/okcoin.py +81 -38
- ccxt/okx.py +270 -109
- ccxt/onetrading.py +3 -1
- ccxt/oxfun.py +95 -36
- ccxt/p2b.py +49 -23
- ccxt/paradex.py +75 -27
- ccxt/paymium.py +31 -11
- ccxt/phemex.py +108 -56
- ccxt/poloniex.py +80 -30
- ccxt/poloniexfutures.py +72 -30
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +15 -5
- ccxt/pro/ascendex.py +18 -6
- ccxt/pro/binance.py +204 -123
- ccxt/pro/bingx.py +44 -24
- ccxt/pro/bitfinex.py +13 -5
- ccxt/pro/bitget.py +76 -37
- ccxt/pro/bithumb.py +12 -4
- ccxt/pro/bitmart.py +44 -20
- ccxt/pro/bitmex.py +42 -14
- ccxt/pro/bitopro.py +15 -5
- ccxt/pro/bitrue.py +7 -3
- ccxt/pro/bitvavo.py +97 -62
- ccxt/pro/blockchaincom.py +18 -6
- ccxt/pro/blofin.py +36 -12
- ccxt/pro/bybit.py +100 -42
- ccxt/pro/cex.py +48 -16
- ccxt/pro/coinbase.py +32 -12
- ccxt/pro/coinbaseexchange.py +1 -1
- ccxt/pro/coinbaseinternational.py +34 -14
- ccxt/pro/coincatch.py +54 -19
- ccxt/pro/coincheck.py +6 -2
- ccxt/pro/coinex.py +40 -20
- ccxt/pro/coinone.py +9 -3
- ccxt/pro/cryptocom.py +71 -27
- ccxt/pro/deribit.py +36 -12
- ccxt/pro/exmo.py +10 -4
- ccxt/pro/gate.py +65 -31
- ccxt/pro/gemini.py +21 -7
- ccxt/pro/hashkey.py +27 -9
- ccxt/pro/hitbtc.py +61 -37
- ccxt/pro/hollaex.py +15 -5
- ccxt/pro/htx.py +39 -21
- ccxt/pro/hyperliquid.py +41 -14
- ccxt/pro/kraken.py +49 -17
- ccxt/pro/krakenfutures.py +47 -24
- ccxt/pro/kucoin.py +60 -31
- ccxt/pro/kucoinfutures.py +41 -19
- ccxt/pro/lbank.py +27 -9
- ccxt/pro/luno.py +3 -1
- ccxt/pro/mexc.py +36 -19
- ccxt/pro/ndax.py +12 -4
- ccxt/pro/okcoin.py +18 -6
- ccxt/pro/okx.py +76 -28
- ccxt/pro/onetrading.py +21 -7
- ccxt/pro/oxfun.py +54 -20
- ccxt/pro/p2b.py +23 -11
- ccxt/pro/paradex.py +12 -4
- ccxt/pro/phemex.py +31 -19
- ccxt/pro/poloniex.py +50 -22
- ccxt/pro/poloniexfutures.py +17 -7
- ccxt/pro/probit.py +18 -6
- ccxt/pro/upbit.py +25 -9
- ccxt/pro/vertex.py +20 -6
- ccxt/pro/wazirx.py +21 -7
- ccxt/pro/whitebit.py +25 -9
- ccxt/pro/woo.py +32 -12
- ccxt/pro/woofipro.py +35 -13
- ccxt/pro/xt.py +46 -26
- ccxt/probit.py +64 -22
- ccxt/timex.py +58 -19
- ccxt/tokocrypto.py +63 -22
- ccxt/tradeogre.py +7 -2
- ccxt/upbit.py +72 -25
- ccxt/vertex.py +74 -28
- ccxt/wavesexchange.py +32 -8
- ccxt/wazirx.py +51 -17
- ccxt/whitebit.py +105 -41
- ccxt/woo.py +162 -65
- ccxt/woofipro.py +119 -50
- ccxt/xt.py +150 -73
- ccxt/yobit.py +49 -16
- ccxt/zaif.py +30 -10
- ccxt/zonda.py +46 -16
- {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/METADATA +11 -5
- {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/RECORD +268 -268
- {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/WHEEL +0 -0
- {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/top_level.txt +0 -0
ccxt/okx.py
CHANGED
@@ -1289,7 +1289,9 @@ class okx(Exchange, ImplicitAPI):
|
|
1289
1289
|
def fetch_status(self, params={}):
|
1290
1290
|
"""
|
1291
1291
|
the latest known information on the availability of the exchange API
|
1292
|
-
|
1292
|
+
|
1293
|
+
https://www.okx.com/docs-v5/en/#status-get-status
|
1294
|
+
|
1293
1295
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1294
1296
|
:returns dict: a `status structure <https://docs.ccxt.com/#/?id=exchange-status-structure>`
|
1295
1297
|
"""
|
@@ -1341,7 +1343,9 @@ class okx(Exchange, ImplicitAPI):
|
|
1341
1343
|
def fetch_time(self, params={}):
|
1342
1344
|
"""
|
1343
1345
|
fetches the current integer timestamp in milliseconds from the exchange server
|
1344
|
-
|
1346
|
+
|
1347
|
+
https://www.okx.com/docs-v5/en/#public-data-rest-api-get-system-time
|
1348
|
+
|
1345
1349
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1346
1350
|
:returns int: the current integer timestamp in milliseconds from the exchange server
|
1347
1351
|
"""
|
@@ -1362,7 +1366,9 @@ class okx(Exchange, ImplicitAPI):
|
|
1362
1366
|
def fetch_accounts(self, params={}) -> List[Account]:
|
1363
1367
|
"""
|
1364
1368
|
fetch all the accounts associated with a profile
|
1365
|
-
|
1369
|
+
|
1370
|
+
https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-account-configuration
|
1371
|
+
|
1366
1372
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1367
1373
|
:returns dict: a dictionary of `account structures <https://docs.ccxt.com/#/?id=account-structure>` indexed by the account type
|
1368
1374
|
"""
|
@@ -1404,7 +1410,9 @@ class okx(Exchange, ImplicitAPI):
|
|
1404
1410
|
def fetch_markets(self, params={}) -> List[Market]:
|
1405
1411
|
"""
|
1406
1412
|
retrieves data on all markets for okx
|
1407
|
-
|
1413
|
+
|
1414
|
+
https://www.okx.com/docs-v5/en/#rest-api-public-data-get-instruments
|
1415
|
+
|
1408
1416
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1409
1417
|
:returns dict[]: an array of objects representing market data
|
1410
1418
|
"""
|
@@ -1617,7 +1625,9 @@ class okx(Exchange, ImplicitAPI):
|
|
1617
1625
|
def fetch_currencies(self, params={}) -> Currencies:
|
1618
1626
|
"""
|
1619
1627
|
fetches all available currencies on an exchange
|
1620
|
-
|
1628
|
+
|
1629
|
+
https://www.okx.com/docs-v5/en/#rest-api-funding-get-currencies
|
1630
|
+
|
1621
1631
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1622
1632
|
:returns dict: an associative dictionary of currencies
|
1623
1633
|
"""
|
@@ -1750,7 +1760,9 @@ class okx(Exchange, ImplicitAPI):
|
|
1750
1760
|
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
1751
1761
|
"""
|
1752
1762
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
1753
|
-
|
1763
|
+
|
1764
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-market-data-get-order-book
|
1765
|
+
|
1754
1766
|
:param str symbol: unified symbol of the market to fetch the order book for
|
1755
1767
|
:param int [limit]: the maximum amount of order book entries to return
|
1756
1768
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1877,7 +1889,9 @@ class okx(Exchange, ImplicitAPI):
|
|
1877
1889
|
def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
1878
1890
|
"""
|
1879
1891
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
1880
|
-
|
1892
|
+
|
1893
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-market-data-get-ticker
|
1894
|
+
|
1881
1895
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
1882
1896
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1883
1897
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -1921,7 +1935,9 @@ class okx(Exchange, ImplicitAPI):
|
|
1921
1935
|
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
1922
1936
|
"""
|
1923
1937
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
1924
|
-
|
1938
|
+
|
1939
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-market-data-get-tickers
|
1940
|
+
|
1925
1941
|
:param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
1926
1942
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1927
1943
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -1974,7 +1990,9 @@ class okx(Exchange, ImplicitAPI):
|
|
1974
1990
|
def fetch_mark_price(self, symbol: str, params={}) -> Ticker:
|
1975
1991
|
"""
|
1976
1992
|
fetches mark price for the market
|
1977
|
-
|
1993
|
+
|
1994
|
+
https://www.okx.com/docs-v5/en/#public-data-rest-api-get-mark-price
|
1995
|
+
|
1978
1996
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
1979
1997
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1980
1998
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -2005,7 +2023,9 @@ class okx(Exchange, ImplicitAPI):
|
|
2005
2023
|
def fetch_mark_prices(self, symbols: Strings = None, params={}) -> Tickers:
|
2006
2024
|
"""
|
2007
2025
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
2008
|
-
|
2026
|
+
|
2027
|
+
https://www.okx.com/docs-v5/en/#public-data-rest-api-get-mark-price
|
2028
|
+
|
2009
2029
|
:param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
2010
2030
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2011
2031
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -2122,8 +2142,10 @@ class okx(Exchange, ImplicitAPI):
|
|
2122
2142
|
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
2123
2143
|
"""
|
2124
2144
|
get the list of most recent trades for a particular symbol
|
2125
|
-
|
2126
|
-
|
2145
|
+
|
2146
|
+
https://www.okx.com/docs-v5/en/#rest-api-market-data-get-trades
|
2147
|
+
https://www.okx.com/docs-v5/en/#rest-api-public-data-get-option-trades
|
2148
|
+
|
2127
2149
|
:param str symbol: unified symbol of the market to fetch trades for
|
2128
2150
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
2129
2151
|
:param int [limit]: the maximum amount of trades to fetch
|
@@ -2218,12 +2240,14 @@ class okx(Exchange, ImplicitAPI):
|
|
2218
2240
|
def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
2219
2241
|
"""
|
2220
2242
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
2221
|
-
|
2222
|
-
|
2223
|
-
|
2224
|
-
|
2225
|
-
|
2226
|
-
|
2243
|
+
|
2244
|
+
https://www.okx.com/docs-v5/en/#rest-api-market-data-get-candlesticks
|
2245
|
+
https://www.okx.com/docs-v5/en/#rest-api-market-data-get-candlesticks-history
|
2246
|
+
https://www.okx.com/docs-v5/en/#rest-api-market-data-get-mark-price-candlesticks
|
2247
|
+
https://www.okx.com/docs-v5/en/#rest-api-market-data-get-mark-price-candlesticks-history
|
2248
|
+
https://www.okx.com/docs-v5/en/#rest-api-market-data-get-index-candlesticks
|
2249
|
+
https://www.okx.com/docs-v5/en/#rest-api-market-data-get-index-candlesticks-history
|
2250
|
+
|
2227
2251
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
2228
2252
|
:param str timeframe: the length of time each candle represents
|
2229
2253
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
@@ -2308,7 +2332,9 @@ class okx(Exchange, ImplicitAPI):
|
|
2308
2332
|
def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2309
2333
|
"""
|
2310
2334
|
fetches historical funding rate prices
|
2311
|
-
|
2335
|
+
|
2336
|
+
https://www.okx.com/docs-v5/en/#public-data-rest-api-get-funding-rate-history
|
2337
|
+
|
2312
2338
|
:param str symbol: unified symbol of the market to fetch the funding rate history for
|
2313
2339
|
:param int [since]: timestamp in ms of the earliest funding rate to fetch
|
2314
2340
|
:param int [limit]: the maximum amount of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>` to fetch
|
@@ -2442,7 +2468,9 @@ class okx(Exchange, ImplicitAPI):
|
|
2442
2468
|
def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
|
2443
2469
|
"""
|
2444
2470
|
fetch the trading fees for a market
|
2445
|
-
|
2471
|
+
|
2472
|
+
https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-fee-rates
|
2473
|
+
|
2446
2474
|
:param str symbol: unified market symbol
|
2447
2475
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2448
2476
|
:returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -2487,8 +2515,10 @@ class okx(Exchange, ImplicitAPI):
|
|
2487
2515
|
def fetch_balance(self, params={}) -> Balances:
|
2488
2516
|
"""
|
2489
2517
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
2490
|
-
|
2491
|
-
|
2518
|
+
|
2519
|
+
https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-balance
|
2520
|
+
https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-balance
|
2521
|
+
|
2492
2522
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2493
2523
|
:param str [params.type]: wallet type, ['funding' or 'trading'] default is 'trading'
|
2494
2524
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
@@ -2609,7 +2639,9 @@ class okx(Exchange, ImplicitAPI):
|
|
2609
2639
|
|
2610
2640
|
def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
2611
2641
|
"""
|
2612
|
-
|
2642
|
+
|
2643
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-place-order
|
2644
|
+
|
2613
2645
|
create a market buy order by providing the symbol and cost
|
2614
2646
|
:param str symbol: unified symbol of the market to create an order in
|
2615
2647
|
:param float cost: how much you want to trade in units of the quote currency
|
@@ -2626,7 +2658,9 @@ class okx(Exchange, ImplicitAPI):
|
|
2626
2658
|
|
2627
2659
|
def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
2628
2660
|
"""
|
2629
|
-
|
2661
|
+
|
2662
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-place-order
|
2663
|
+
|
2630
2664
|
create a market buy order by providing the symbol and cost
|
2631
2665
|
:param str symbol: unified symbol of the market to create an order in
|
2632
2666
|
:param float cost: how much you want to trade in units of the quote currency
|
@@ -2866,9 +2900,11 @@ class okx(Exchange, ImplicitAPI):
|
|
2866
2900
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
2867
2901
|
"""
|
2868
2902
|
create a trade order
|
2869
|
-
|
2870
|
-
|
2871
|
-
|
2903
|
+
|
2904
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-place-order
|
2905
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-place-multiple-orders
|
2906
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-post-place-algo-order
|
2907
|
+
|
2872
2908
|
:param str symbol: unified symbol of the market to create an order in
|
2873
2909
|
:param str type: 'market' or 'limit'
|
2874
2910
|
:param str side: 'buy' or 'sell'
|
@@ -2922,8 +2958,11 @@ class okx(Exchange, ImplicitAPI):
|
|
2922
2958
|
def create_orders(self, orders: List[OrderRequest], params={}):
|
2923
2959
|
"""
|
2924
2960
|
create a list of trade orders
|
2925
|
-
|
2961
|
+
|
2962
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-place-multiple-orders
|
2963
|
+
|
2926
2964
|
:param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
|
2965
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2927
2966
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2928
2967
|
"""
|
2929
2968
|
self.load_markets()
|
@@ -3044,8 +3083,10 @@ class okx(Exchange, ImplicitAPI):
|
|
3044
3083
|
def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
3045
3084
|
"""
|
3046
3085
|
edit a trade order
|
3047
|
-
|
3048
|
-
|
3086
|
+
|
3087
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-amend-order
|
3088
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-post-amend-algo-order
|
3089
|
+
|
3049
3090
|
:param str id: order id
|
3050
3091
|
:param str symbol: unified symbol of the market to create an order in
|
3051
3092
|
:param str type: 'market' or 'limit'
|
@@ -3107,8 +3148,10 @@ class okx(Exchange, ImplicitAPI):
|
|
3107
3148
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
3108
3149
|
"""
|
3109
3150
|
cancels an open order
|
3110
|
-
|
3111
|
-
|
3151
|
+
|
3152
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-cancel-order
|
3153
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-post-cancel-algo-order
|
3154
|
+
|
3112
3155
|
:param str id: order id
|
3113
3156
|
:param str symbol: unified symbol of the market the order was made in
|
3114
3157
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -3144,7 +3187,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3144
3187
|
|
3145
3188
|
def parse_ids(self, ids):
|
3146
3189
|
"""
|
3147
|
-
|
3190
|
+
@ignore
|
3148
3191
|
:param string[]|str ids: order ids
|
3149
3192
|
:returns str[]: list of order ids
|
3150
3193
|
"""
|
@@ -3156,8 +3199,10 @@ class okx(Exchange, ImplicitAPI):
|
|
3156
3199
|
def cancel_orders(self, ids, symbol: Str = None, params={}):
|
3157
3200
|
"""
|
3158
3201
|
cancel multiple orders
|
3159
|
-
|
3160
|
-
|
3202
|
+
|
3203
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-cancel-multiple-orders
|
3204
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-post-cancel-algo-order
|
3205
|
+
|
3161
3206
|
:param str[] ids: order ids
|
3162
3207
|
:param str symbol: unified market symbol
|
3163
3208
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -3245,8 +3290,10 @@ class okx(Exchange, ImplicitAPI):
|
|
3245
3290
|
def cancel_orders_for_symbols(self, orders: List[CancellationRequest], params={}):
|
3246
3291
|
"""
|
3247
3292
|
cancel multiple orders for multiple symbols
|
3248
|
-
|
3249
|
-
|
3293
|
+
|
3294
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-cancel-multiple-orders
|
3295
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-post-cancel-algo-order
|
3296
|
+
|
3250
3297
|
:param CancellationRequest[] orders: each order should contain the parameters required by cancelOrder namely id and symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
3251
3298
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3252
3299
|
:param boolean [params.trigger]: whether the order is a stop/trigger order
|
@@ -3319,7 +3366,9 @@ class okx(Exchange, ImplicitAPI):
|
|
3319
3366
|
def cancel_all_orders_after(self, timeout: Int, params={}):
|
3320
3367
|
"""
|
3321
3368
|
dead man's switch, cancel all orders after the given timeout
|
3322
|
-
|
3369
|
+
|
3370
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-cancel-all-after
|
3371
|
+
|
3323
3372
|
:param number timeout: time in milliseconds, 0 represents cancel the timer
|
3324
3373
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3325
3374
|
:returns dict: the api result
|
@@ -3557,8 +3606,10 @@ class okx(Exchange, ImplicitAPI):
|
|
3557
3606
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
3558
3607
|
"""
|
3559
3608
|
fetch an order by the id
|
3560
|
-
|
3561
|
-
|
3609
|
+
|
3610
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-details
|
3611
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-get-algo-order-details
|
3612
|
+
|
3562
3613
|
:param str id: the order id
|
3563
3614
|
:param str symbol: unified market symbol
|
3564
3615
|
:param dict [params]: extra and exchange specific parameters
|
@@ -3700,8 +3751,10 @@ class okx(Exchange, ImplicitAPI):
|
|
3700
3751
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
3701
3752
|
"""
|
3702
3753
|
fetch all unfilled currently open orders
|
3703
|
-
|
3704
|
-
|
3754
|
+
|
3755
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-list
|
3756
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-get-algo-order-list
|
3757
|
+
|
3705
3758
|
:param str symbol: unified market symbol
|
3706
3759
|
:param int [since]: the earliest time in ms to fetch open orders for
|
3707
3760
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
@@ -3854,8 +3907,10 @@ class okx(Exchange, ImplicitAPI):
|
|
3854
3907
|
def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
3855
3908
|
"""
|
3856
3909
|
fetches information on multiple canceled orders made by the user
|
3857
|
-
|
3858
|
-
|
3910
|
+
|
3911
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-history-last-7-days
|
3912
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-get-algo-order-history
|
3913
|
+
|
3859
3914
|
:param str symbol: unified market symbol of the market orders were made in
|
3860
3915
|
:param int [since]: timestamp in ms of the earliest order, default is None
|
3861
3916
|
:param int [limit]: max number of orders to return, default is None
|
@@ -4027,9 +4082,11 @@ class okx(Exchange, ImplicitAPI):
|
|
4027
4082
|
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
4028
4083
|
"""
|
4029
4084
|
fetches information on multiple closed orders made by the user
|
4030
|
-
|
4031
|
-
|
4032
|
-
|
4085
|
+
|
4086
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-history-last-7-days
|
4087
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-get-algo-order-history
|
4088
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-history-last-3-months
|
4089
|
+
|
4033
4090
|
:param str symbol: unified market symbol of the market orders were made in
|
4034
4091
|
:param int [since]: the earliest time in ms to fetch orders for
|
4035
4092
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -4201,7 +4258,9 @@ class okx(Exchange, ImplicitAPI):
|
|
4201
4258
|
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4202
4259
|
"""
|
4203
4260
|
fetch all trades made by the user
|
4204
|
-
|
4261
|
+
|
4262
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-transaction-details-last-3-months
|
4263
|
+
|
4205
4264
|
:param str symbol: unified market symbol
|
4206
4265
|
:param int [since]: the earliest time in ms to fetch trades for
|
4207
4266
|
:param int [limit]: the maximum number of trades structures to retrieve
|
@@ -4267,7 +4326,9 @@ class okx(Exchange, ImplicitAPI):
|
|
4267
4326
|
def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4268
4327
|
"""
|
4269
4328
|
fetch all the trades made from a single order
|
4270
|
-
|
4329
|
+
|
4330
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-transaction-details-last-3-months
|
4331
|
+
|
4271
4332
|
:param str id: order id
|
4272
4333
|
:param str symbol: unified market symbol
|
4273
4334
|
:param int [since]: the earliest time in ms to fetch trades for
|
@@ -4287,9 +4348,11 @@ class okx(Exchange, ImplicitAPI):
|
|
4287
4348
|
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
4288
4349
|
"""
|
4289
4350
|
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
4290
|
-
|
4291
|
-
|
4292
|
-
|
4351
|
+
|
4352
|
+
https://www.okx.com/docs-v5/en/#rest-api-account-get-bills-details-last-7-days
|
4353
|
+
https://www.okx.com/docs-v5/en/#rest-api-account-get-bills-details-last-3-months
|
4354
|
+
https://www.okx.com/docs-v5/en/#rest-api-funding-asset-bills-details
|
4355
|
+
|
4293
4356
|
:param str [code]: unified currency code, default is None
|
4294
4357
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
4295
4358
|
:param int [limit]: max number of ledger entries to return, default is None
|
@@ -4578,7 +4641,9 @@ class okx(Exchange, ImplicitAPI):
|
|
4578
4641
|
def fetch_deposit_addresses_by_network(self, code: str, params={}) -> List[DepositAddress]:
|
4579
4642
|
"""
|
4580
4643
|
fetch a dictionary of addresses for a currency, indexed by network
|
4581
|
-
|
4644
|
+
|
4645
|
+
https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-deposit-address
|
4646
|
+
|
4582
4647
|
:param str code: unified currency code of the currency for the deposit address
|
4583
4648
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4584
4649
|
:returns dict: a dictionary of `address structures <https://docs.ccxt.com/#/?id=address-structure>` indexed by the network
|
@@ -4618,7 +4683,9 @@ class okx(Exchange, ImplicitAPI):
|
|
4618
4683
|
def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
|
4619
4684
|
"""
|
4620
4685
|
fetch the deposit address for a currency associated with self account
|
4621
|
-
|
4686
|
+
|
4687
|
+
https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-deposit-address
|
4688
|
+
|
4622
4689
|
:param str code: unified currency code
|
4623
4690
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4624
4691
|
:param str [params.network]: the network name for the deposit address
|
@@ -4646,7 +4713,9 @@ class okx(Exchange, ImplicitAPI):
|
|
4646
4713
|
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
4647
4714
|
"""
|
4648
4715
|
make a withdrawal
|
4649
|
-
|
4716
|
+
|
4717
|
+
https://www.okx.com/docs-v5/en/#funding-account-rest-api-withdrawal
|
4718
|
+
|
4650
4719
|
:param str code: unified currency code
|
4651
4720
|
:param float amount: the amount to withdraw
|
4652
4721
|
:param str address: the address to withdraw to
|
@@ -4703,7 +4772,9 @@ class okx(Exchange, ImplicitAPI):
|
|
4703
4772
|
def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
4704
4773
|
"""
|
4705
4774
|
fetch all deposits made to an account
|
4706
|
-
|
4775
|
+
|
4776
|
+
https://www.okx.com/docs-v5/en/#rest-api-funding-get-deposit-history
|
4777
|
+
|
4707
4778
|
:param str code: unified currency code
|
4708
4779
|
:param int [since]: the earliest time in ms to fetch deposits for
|
4709
4780
|
:param int [limit]: the maximum number of deposits structures to retrieve
|
@@ -4778,7 +4849,9 @@ class okx(Exchange, ImplicitAPI):
|
|
4778
4849
|
def fetch_deposit(self, id: str, code: Str = None, params={}):
|
4779
4850
|
"""
|
4780
4851
|
fetch data on a currency deposit via the deposit id
|
4781
|
-
|
4852
|
+
|
4853
|
+
https://www.okx.com/docs-v5/en/#rest-api-funding-get-deposit-history
|
4854
|
+
|
4782
4855
|
:param str id: deposit id
|
4783
4856
|
:param str code: filter by currency code
|
4784
4857
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -4800,7 +4873,9 @@ class okx(Exchange, ImplicitAPI):
|
|
4800
4873
|
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
4801
4874
|
"""
|
4802
4875
|
fetch all withdrawals made from an account
|
4803
|
-
|
4876
|
+
|
4877
|
+
https://www.okx.com/docs-v5/en/#rest-api-funding-get-withdrawal-history
|
4878
|
+
|
4804
4879
|
:param str code: unified currency code
|
4805
4880
|
:param int [since]: the earliest time in ms to fetch withdrawals for
|
4806
4881
|
:param int [limit]: the maximum number of withdrawals structures to retrieve
|
@@ -4867,7 +4942,9 @@ class okx(Exchange, ImplicitAPI):
|
|
4867
4942
|
def fetch_withdrawal(self, id: str, code: Str = None, params={}):
|
4868
4943
|
"""
|
4869
4944
|
fetch data on a currency withdrawal via the withdrawal id
|
4870
|
-
|
4945
|
+
|
4946
|
+
https://www.okx.com/docs-v5/en/#rest-api-funding-get-withdrawal-history
|
4947
|
+
|
4871
4948
|
:param str id: withdrawal id
|
4872
4949
|
:param str code: unified currency code of the currency withdrawn, default is None
|
4873
4950
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -5048,7 +5125,9 @@ class okx(Exchange, ImplicitAPI):
|
|
5048
5125
|
def fetch_leverage(self, symbol: str, params={}) -> Leverage:
|
5049
5126
|
"""
|
5050
5127
|
fetch the set leverage for a market
|
5051
|
-
|
5128
|
+
|
5129
|
+
https://www.okx.com/docs-v5/en/#rest-api-account-get-leverage
|
5130
|
+
|
5052
5131
|
:param str symbol: unified market symbol
|
5053
5132
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5054
5133
|
:param str [params.marginMode]: 'cross' or 'isolated'
|
@@ -5112,7 +5191,9 @@ class okx(Exchange, ImplicitAPI):
|
|
5112
5191
|
def fetch_position(self, symbol: str, params={}):
|
5113
5192
|
"""
|
5114
5193
|
fetch data on a single open contract trade position
|
5115
|
-
|
5194
|
+
|
5195
|
+
https://www.okx.com/docs-v5/en/#rest-api-account-get-positions
|
5196
|
+
|
5116
5197
|
:param str symbol: unified market symbol of the market the position is held in, default is None
|
5117
5198
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5118
5199
|
:param str [params.instType]: MARGIN, SWAP, FUTURES, OPTION
|
@@ -5183,8 +5264,10 @@ class okx(Exchange, ImplicitAPI):
|
|
5183
5264
|
|
5184
5265
|
def fetch_positions(self, symbols: Strings = None, params={}):
|
5185
5266
|
"""
|
5186
|
-
|
5187
|
-
|
5267
|
+
|
5268
|
+
https://www.okx.com/docs-v5/en/#rest-api-account-get-positions
|
5269
|
+
https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-positions-history history
|
5270
|
+
|
5188
5271
|
fetch all open positions
|
5189
5272
|
:param str[]|None symbols: list of unified market symbols
|
5190
5273
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -5267,7 +5350,9 @@ class okx(Exchange, ImplicitAPI):
|
|
5267
5350
|
|
5268
5351
|
def fetch_positions_for_symbol(self, symbol: str, params={}):
|
5269
5352
|
"""
|
5270
|
-
|
5353
|
+
|
5354
|
+
https://www.okx.com/docs-v5/en/#rest-api-account-get-positions
|
5355
|
+
|
5271
5356
|
fetch all open positions for specific symbol
|
5272
5357
|
:param str symbol: unified market symbol
|
5273
5358
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -5437,7 +5522,9 @@ class okx(Exchange, ImplicitAPI):
|
|
5437
5522
|
def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
5438
5523
|
"""
|
5439
5524
|
transfer currency internally between wallets on the same account
|
5440
|
-
|
5525
|
+
|
5526
|
+
https://www.okx.com/docs-v5/en/#rest-api-funding-funds-transfer
|
5527
|
+
|
5441
5528
|
:param str code: unified currency code
|
5442
5529
|
:param float amount: amount to transfer
|
5443
5530
|
:param str fromAccount: account to transfer from
|
@@ -5607,7 +5694,9 @@ class okx(Exchange, ImplicitAPI):
|
|
5607
5694
|
def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]:
|
5608
5695
|
"""
|
5609
5696
|
fetch a history of internal transfers made on an account
|
5610
|
-
|
5697
|
+
|
5698
|
+
https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-bills-details-last-3-months
|
5699
|
+
|
5611
5700
|
:param str code: unified currency code of the currency transferred
|
5612
5701
|
:param int [since]: the earliest time in ms to fetch transfers for
|
5613
5702
|
:param int [limit]: the maximum number of transfers structures to retrieve
|
@@ -5786,7 +5875,9 @@ class okx(Exchange, ImplicitAPI):
|
|
5786
5875
|
def fetch_funding_interval(self, symbol: str, params={}) -> FundingRate:
|
5787
5876
|
"""
|
5788
5877
|
fetch the current funding rate interval
|
5789
|
-
|
5878
|
+
|
5879
|
+
https://www.okx.com/docs-v5/en/#public-data-rest-api-get-funding-rate
|
5880
|
+
|
5790
5881
|
:param str symbol: unified market symbol
|
5791
5882
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5792
5883
|
:returns dict: a `funding rate structure <https://docs.ccxt.com/#/?id=funding-rate-structure>`
|
@@ -5796,7 +5887,9 @@ class okx(Exchange, ImplicitAPI):
|
|
5796
5887
|
def fetch_funding_rate(self, symbol: str, params={}) -> FundingRate:
|
5797
5888
|
"""
|
5798
5889
|
fetch the current funding rate
|
5799
|
-
|
5890
|
+
|
5891
|
+
https://www.okx.com/docs-v5/en/#public-data-rest-api-get-funding-rate
|
5892
|
+
|
5800
5893
|
:param str symbol: unified market symbol
|
5801
5894
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5802
5895
|
:returns dict: a `funding rate structure <https://docs.ccxt.com/#/?id=funding-rate-structure>`
|
@@ -5832,7 +5925,9 @@ class okx(Exchange, ImplicitAPI):
|
|
5832
5925
|
def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
5833
5926
|
"""
|
5834
5927
|
fetch the history of funding payments paid and received on self account
|
5835
|
-
|
5928
|
+
|
5929
|
+
https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-bills-details-last-3-months
|
5930
|
+
|
5836
5931
|
:param str symbol: unified market symbol
|
5837
5932
|
:param int [since]: the earliest time in ms to fetch funding history for
|
5838
5933
|
:param int [limit]: the maximum number of funding history structures to retrieve
|
@@ -5982,7 +6077,9 @@ class okx(Exchange, ImplicitAPI):
|
|
5982
6077
|
def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
5983
6078
|
"""
|
5984
6079
|
set the level of leverage for a market
|
5985
|
-
|
6080
|
+
|
6081
|
+
https://www.okx.com/docs-v5/en/#rest-api-account-set-leverage
|
6082
|
+
|
5986
6083
|
:param float leverage: the rate of leverage
|
5987
6084
|
:param str symbol: unified market symbol
|
5988
6085
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6034,11 +6131,13 @@ class okx(Exchange, ImplicitAPI):
|
|
6034
6131
|
|
6035
6132
|
def fetch_position_mode(self, symbol: Str = None, params={}):
|
6036
6133
|
"""
|
6037
|
-
|
6134
|
+
|
6135
|
+
https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-account-configuration
|
6136
|
+
|
6038
6137
|
fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets
|
6039
6138
|
:param str symbol: unified symbol of the market to fetch the order book for
|
6040
6139
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6041
|
-
:param str [
|
6140
|
+
:param str [params.accountId]: if you have multiple accounts, you must specify the account id to fetch the position mode
|
6042
6141
|
:returns dict: an object detailing whether the market is in hedged or one-way mode
|
6043
6142
|
"""
|
6044
6143
|
accounts = self.fetch_accounts()
|
@@ -6065,7 +6164,9 @@ class okx(Exchange, ImplicitAPI):
|
|
6065
6164
|
def set_position_mode(self, hedged: bool, symbol: Str = None, params={}):
|
6066
6165
|
"""
|
6067
6166
|
set hedged to True or False for a market
|
6068
|
-
|
6167
|
+
|
6168
|
+
https://www.okx.com/docs-v5/en/#trading-account-rest-api-set-position-mode
|
6169
|
+
|
6069
6170
|
:param bool hedged: set to True to use long_short_mode, False for net_mode
|
6070
6171
|
:param str symbol: not used by okx setPositionMode
|
6071
6172
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6096,7 +6197,9 @@ class okx(Exchange, ImplicitAPI):
|
|
6096
6197
|
def set_margin_mode(self, marginMode: str, symbol: Str = None, params={}):
|
6097
6198
|
"""
|
6098
6199
|
set margin mode to 'cross' or 'isolated'
|
6099
|
-
|
6200
|
+
|
6201
|
+
https://www.okx.com/docs-v5/en/#trading-account-rest-api-set-leverage
|
6202
|
+
|
6100
6203
|
:param str marginMode: 'cross' or 'isolated'
|
6101
6204
|
:param str symbol: unified market symbol
|
6102
6205
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6141,7 +6244,9 @@ class okx(Exchange, ImplicitAPI):
|
|
6141
6244
|
def fetch_cross_borrow_rates(self, params={}) -> CrossBorrowRates:
|
6142
6245
|
"""
|
6143
6246
|
fetch the borrow interest rates of all currencies
|
6144
|
-
|
6247
|
+
|
6248
|
+
https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-interest-rate
|
6249
|
+
|
6145
6250
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6146
6251
|
:returns dict: a list of `borrow rate structures <https://docs.ccxt.com/#/?id=borrow-rate-structure>`
|
6147
6252
|
"""
|
@@ -6168,7 +6273,9 @@ class okx(Exchange, ImplicitAPI):
|
|
6168
6273
|
def fetch_cross_borrow_rate(self, code: str, params={}) -> CrossBorrowRate:
|
6169
6274
|
"""
|
6170
6275
|
fetch the rate of interest to borrow a currency for margin trading
|
6171
|
-
|
6276
|
+
|
6277
|
+
https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-interest-rate
|
6278
|
+
|
6172
6279
|
:param str code: unified currency code
|
6173
6280
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6174
6281
|
:returns dict: a `borrow rate structure <https://docs.ccxt.com/#/?id=borrow-rate-structure>`
|
@@ -6246,7 +6353,9 @@ class okx(Exchange, ImplicitAPI):
|
|
6246
6353
|
def fetch_borrow_rate_histories(self, codes=None, since: Int = None, limit: Int = None, params={}):
|
6247
6354
|
"""
|
6248
6355
|
retrieves a history of a multiple currencies borrow interest rate at specific time slots, returns all currencies if no symbols passed, default is None
|
6249
|
-
|
6356
|
+
|
6357
|
+
https://www.okx.com/docs-v5/en/#financial-product-savings-get-public-borrow-history-public
|
6358
|
+
|
6250
6359
|
:param str[]|None codes: list of unified currency codes, default is None
|
6251
6360
|
:param int [since]: timestamp in ms of the earliest borrowRate, default is None
|
6252
6361
|
:param int [limit]: max number of borrow rate prices to return, default is None
|
@@ -6285,7 +6394,9 @@ class okx(Exchange, ImplicitAPI):
|
|
6285
6394
|
def fetch_borrow_rate_history(self, code: str, since: Int = None, limit: Int = None, params={}):
|
6286
6395
|
"""
|
6287
6396
|
retrieves a history of a currencies borrow interest rate at specific time slots
|
6288
|
-
|
6397
|
+
|
6398
|
+
https://www.okx.com/docs-v5/en/#financial-product-savings-get-public-borrow-history-public
|
6399
|
+
|
6289
6400
|
:param str code: unified currency code
|
6290
6401
|
:param int [since]: timestamp for the earliest borrow rate
|
6291
6402
|
:param int [limit]: the maximum number of `borrow rate structures <https://docs.ccxt.com/#/?id=borrow-rate-structure>` to retrieve
|
@@ -6431,7 +6542,9 @@ class okx(Exchange, ImplicitAPI):
|
|
6431
6542
|
def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
6432
6543
|
"""
|
6433
6544
|
remove margin from a position
|
6434
|
-
|
6545
|
+
|
6546
|
+
https://www.okx.com/docs-v5/en/#trading-account-rest-api-increase-decrease-margin
|
6547
|
+
|
6435
6548
|
:param str symbol: unified market symbol
|
6436
6549
|
:param float amount: the amount of margin to remove
|
6437
6550
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6442,7 +6555,9 @@ class okx(Exchange, ImplicitAPI):
|
|
6442
6555
|
def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
6443
6556
|
"""
|
6444
6557
|
add margin
|
6445
|
-
|
6558
|
+
|
6559
|
+
https://www.okx.com/docs-v5/en/#trading-account-rest-api-increase-decrease-margin
|
6560
|
+
|
6446
6561
|
:param str symbol: unified market symbol
|
6447
6562
|
:param float amount: amount of margin to add
|
6448
6563
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6453,7 +6568,9 @@ class okx(Exchange, ImplicitAPI):
|
|
6453
6568
|
def fetch_market_leverage_tiers(self, symbol: str, params={}) -> List[LeverageTier]:
|
6454
6569
|
"""
|
6455
6570
|
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
|
6456
|
-
|
6571
|
+
|
6572
|
+
https://www.okx.com/docs-v5/en/#rest-api-public-data-get-position-tiers
|
6573
|
+
|
6457
6574
|
:param str symbol: unified market symbol
|
6458
6575
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6459
6576
|
:param str [params.marginMode]: 'cross' or 'isolated'
|
@@ -6504,7 +6621,7 @@ class okx(Exchange, ImplicitAPI):
|
|
6504
6621
|
|
6505
6622
|
def parse_market_leverage_tiers(self, info, market: Market = None) -> List[LeverageTier]:
|
6506
6623
|
"""
|
6507
|
-
|
6624
|
+
@ignore
|
6508
6625
|
:param dict info: Exchange response for 1 market
|
6509
6626
|
:param dict market: CCXT market
|
6510
6627
|
"""
|
@@ -6529,8 +6646,10 @@ class okx(Exchange, ImplicitAPI):
|
|
6529
6646
|
tiers = []
|
6530
6647
|
for i in range(0, len(info)):
|
6531
6648
|
tier = info[i]
|
6649
|
+
marketId = self.safe_string(tier, 'instId')
|
6532
6650
|
tiers.append({
|
6533
6651
|
'tier': self.safe_integer(tier, 'tier'),
|
6652
|
+
'symbol': self.safe_symbol(marketId, market),
|
6534
6653
|
'currency': market['quote'],
|
6535
6654
|
'minNotional': self.safe_number(tier, 'minSz'),
|
6536
6655
|
'maxNotional': self.safe_number(tier, 'maxSz'),
|
@@ -6543,7 +6662,9 @@ class okx(Exchange, ImplicitAPI):
|
|
6543
6662
|
def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[BorrowInterest]:
|
6544
6663
|
"""
|
6545
6664
|
fetch the interest owed by the user for borrowing currency for margin trading
|
6546
|
-
|
6665
|
+
|
6666
|
+
https://www.okx.com/docs-v5/en/#rest-api-account-get-interest-accrued-data
|
6667
|
+
|
6547
6668
|
:param str code: the unified currency code for the currency of the interest
|
6548
6669
|
:param str symbol: the market symbol of an isolated margin market, if None, the interest for cross margin markets is returned
|
6549
6670
|
:param int [since]: timestamp in ms of the earliest time to receive interest records for
|
@@ -6616,7 +6737,9 @@ class okx(Exchange, ImplicitAPI):
|
|
6616
6737
|
def borrow_cross_margin(self, code: str, amount: float, params={}):
|
6617
6738
|
"""
|
6618
6739
|
create a loan to borrow margin(need to be VIP 5 and above)
|
6619
|
-
|
6740
|
+
|
6741
|
+
https://www.okx.com/docs-v5/en/#trading-account-rest-api-vip-loans-borrow-and-repay
|
6742
|
+
|
6620
6743
|
:param str code: unified currency code of the currency to borrow
|
6621
6744
|
:param float amount: the amount to borrow
|
6622
6745
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6652,7 +6775,9 @@ class okx(Exchange, ImplicitAPI):
|
|
6652
6775
|
def repay_cross_margin(self, code: str, amount, params={}):
|
6653
6776
|
"""
|
6654
6777
|
repay borrowed margin and interest
|
6655
|
-
|
6778
|
+
|
6779
|
+
https://www.okx.com/docs-v5/en/#trading-account-rest-api-vip-loans-borrow-and-repay
|
6780
|
+
|
6656
6781
|
:param str code: unified currency code of the currency to repay
|
6657
6782
|
:param float amount: the amount to repay
|
6658
6783
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6717,7 +6842,9 @@ class okx(Exchange, ImplicitAPI):
|
|
6717
6842
|
def fetch_open_interest(self, symbol: str, params={}):
|
6718
6843
|
"""
|
6719
6844
|
Retrieves the open interest of a currency
|
6720
|
-
|
6845
|
+
|
6846
|
+
https://www.okx.com/docs-v5/en/#rest-api-public-data-get-open-interest
|
6847
|
+
|
6721
6848
|
:param str symbol: Unified CCXT market symbol
|
6722
6849
|
:param dict [params]: exchange specific parameters
|
6723
6850
|
:returns dict} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure:
|
@@ -6755,8 +6882,10 @@ class okx(Exchange, ImplicitAPI):
|
|
6755
6882
|
def fetch_open_interest_history(self, symbol: str, timeframe='1d', since: Int = None, limit: Int = None, params={}):
|
6756
6883
|
"""
|
6757
6884
|
Retrieves the open interest history of a currency
|
6758
|
-
|
6759
|
-
|
6885
|
+
|
6886
|
+
https://www.okx.com/docs-v5/en/#rest-api-trading-data-get-contracts-open-interest-and-volume
|
6887
|
+
https://www.okx.com/docs-v5/en/#rest-api-trading-data-get-options-open-interest-and-volume
|
6888
|
+
|
6760
6889
|
:param str symbol: Unified CCXT currency code or unified symbol
|
6761
6890
|
:param str timeframe: "5m", "1h", or "1d" for option only "1d" or "8h"
|
6762
6891
|
:param int [since]: The time in ms of the earliest record to retrieve unix timestamp
|
@@ -6877,7 +7006,9 @@ class okx(Exchange, ImplicitAPI):
|
|
6877
7006
|
def fetch_deposit_withdraw_fees(self, codes: Strings = None, params={}):
|
6878
7007
|
"""
|
6879
7008
|
fetch deposit and withdraw fees
|
6880
|
-
|
7009
|
+
|
7010
|
+
https://www.okx.com/docs-v5/en/#rest-api-funding-get-currencies
|
7011
|
+
|
6881
7012
|
:param str[]|None codes: list of unified currency codes
|
6882
7013
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6883
7014
|
:returns dict[]: a list of `fees structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -6992,7 +7123,9 @@ class okx(Exchange, ImplicitAPI):
|
|
6992
7123
|
def fetch_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
6993
7124
|
"""
|
6994
7125
|
fetches historical settlement records
|
6995
|
-
|
7126
|
+
|
7127
|
+
https://www.okx.com/docs-v5/en/#rest-api-public-data-get-delivery-exercise-history
|
7128
|
+
|
6996
7129
|
:param str symbol: unified market symbol to fetch the settlement history for
|
6997
7130
|
:param int [since]: timestamp in ms
|
6998
7131
|
:param int [limit]: number of records
|
@@ -7085,7 +7218,9 @@ class okx(Exchange, ImplicitAPI):
|
|
7085
7218
|
def fetch_underlying_assets(self, params={}):
|
7086
7219
|
"""
|
7087
7220
|
fetches the market ids of underlying assets for a specific contract market type
|
7088
|
-
|
7221
|
+
|
7222
|
+
https://www.okx.com/docs-v5/en/#public-data-rest-api-get-underlying
|
7223
|
+
|
7089
7224
|
:param dict [params]: exchange specific params
|
7090
7225
|
:param str [params.type]: the contract market type, 'option', 'swap' or 'future', the default is 'option'
|
7091
7226
|
:returns dict[]: a list of `underlying assets <https://docs.ccxt.com/#/?id=underlying-assets-structure>`
|
@@ -7119,7 +7254,9 @@ class okx(Exchange, ImplicitAPI):
|
|
7119
7254
|
def fetch_greeks(self, symbol: str, params={}) -> Greeks:
|
7120
7255
|
"""
|
7121
7256
|
fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
|
7122
|
-
|
7257
|
+
|
7258
|
+
https://www.okx.com/docs-v5/en/#public-data-rest-api-get-option-market-data
|
7259
|
+
|
7123
7260
|
:param str symbol: unified symbol of the market to fetch greeks for
|
7124
7261
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7125
7262
|
:returns dict: a `greeks structure <https://docs.ccxt.com/#/?id=greeks-structure>`
|
@@ -7223,15 +7360,17 @@ class okx(Exchange, ImplicitAPI):
|
|
7223
7360
|
def close_position(self, symbol: str, side: OrderSide = None, params={}) -> Order:
|
7224
7361
|
"""
|
7225
7362
|
closes open positions for a market
|
7226
|
-
|
7363
|
+
|
7364
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-close-positions
|
7365
|
+
|
7227
7366
|
:param str symbol: Unified CCXT market symbol
|
7228
7367
|
:param str [side]: 'buy' or 'sell', leave in net mode
|
7229
7368
|
:param dict [params]: extra parameters specific to the okx api endpoint
|
7230
7369
|
:param str [params.clientOrderId]: a unique identifier for the order
|
7231
7370
|
:param str [params.marginMode]: 'cross' or 'isolated', default is 'cross
|
7232
7371
|
:param str [params.code]: *required in the case of closing cross MARGIN position for Single-currency margin* margin currency
|
7233
|
-
|
7234
|
-
|
7372
|
+
|
7373
|
+
EXCHANGE SPECIFIC PARAMETERS
|
7235
7374
|
:param boolean [params.autoCxl]: whether any pending orders for closing out needs to be automatically canceled when close position via a market order. False or True, the default is False
|
7236
7375
|
:param str [params.tag]: order tag a combination of case-sensitive alphanumerics, all numbers, or all letters of up to 16 characters
|
7237
7376
|
:returns dict[]: `A list of position structures <https://docs.ccxt.com/#/?id=position-structure>`
|
@@ -7283,7 +7422,9 @@ class okx(Exchange, ImplicitAPI):
|
|
7283
7422
|
def fetch_option(self, symbol: str, params={}) -> Option:
|
7284
7423
|
"""
|
7285
7424
|
fetches option data that is commonly found in an option chain
|
7286
|
-
|
7425
|
+
|
7426
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-market-data-get-ticker
|
7427
|
+
|
7287
7428
|
:param str symbol: unified market symbol
|
7288
7429
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7289
7430
|
:returns dict: an `option chain structure <https://docs.ccxt.com/#/?id=option-chain-structure>`
|
@@ -7327,8 +7468,10 @@ class okx(Exchange, ImplicitAPI):
|
|
7327
7468
|
def fetch_option_chain(self, code: str, params={}) -> OptionChain:
|
7328
7469
|
"""
|
7329
7470
|
fetches data for an underlying asset that is commonly found in an option chain
|
7330
|
-
|
7331
|
-
|
7471
|
+
|
7472
|
+
https://www.okx.com/docs-v5/en/#order-book-trading-market-data-get-tickers
|
7473
|
+
|
7474
|
+
:param str code: base currency to fetch an option chain for
|
7332
7475
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7333
7476
|
:param str [params.uly]: the underlying asset, can be obtained from fetchUnderlyingAssets()
|
7334
7477
|
:returns dict: a list of `option chain structures <https://docs.ccxt.com/#/?id=option-chain-structure>`
|
@@ -7416,7 +7559,9 @@ class okx(Exchange, ImplicitAPI):
|
|
7416
7559
|
def fetch_convert_quote(self, fromCode: str, toCode: str, amount: Num = None, params={}) -> Conversion:
|
7417
7560
|
"""
|
7418
7561
|
fetch a quote for converting from one currency to another
|
7419
|
-
|
7562
|
+
|
7563
|
+
https://www.okx.com/docs-v5/en/#funding-account-rest-api-estimate-quote
|
7564
|
+
|
7420
7565
|
:param str fromCode: the currency that you want to sell and convert from
|
7421
7566
|
:param str toCode: the currency that you want to buy and convert into
|
7422
7567
|
:param float [amount]: how much you want to trade in units of the from currency
|
@@ -7466,7 +7611,9 @@ class okx(Exchange, ImplicitAPI):
|
|
7466
7611
|
def create_convert_trade(self, id: str, fromCode: str, toCode: str, amount: Num = None, params={}) -> Conversion:
|
7467
7612
|
"""
|
7468
7613
|
convert from one currency to another
|
7469
|
-
|
7614
|
+
|
7615
|
+
https://www.okx.com/docs-v5/en/#funding-account-rest-api-convert-trade
|
7616
|
+
|
7470
7617
|
:param str id: the id of the trade that you want to make
|
7471
7618
|
:param str fromCode: the currency that you want to sell and convert from
|
7472
7619
|
:param str toCode: the currency that you want to buy and convert into
|
@@ -7517,7 +7664,9 @@ class okx(Exchange, ImplicitAPI):
|
|
7517
7664
|
def fetch_convert_trade(self, id: str, code: Str = None, params={}) -> Conversion:
|
7518
7665
|
"""
|
7519
7666
|
fetch the data for a conversion trade
|
7520
|
-
|
7667
|
+
|
7668
|
+
https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-convert-history
|
7669
|
+
|
7521
7670
|
:param str id: the id of the trade that you want to fetch
|
7522
7671
|
:param str [code]: the unified currency code of the conversion trade
|
7523
7672
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -7564,7 +7713,9 @@ class okx(Exchange, ImplicitAPI):
|
|
7564
7713
|
def fetch_convert_trade_history(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Conversion]:
|
7565
7714
|
"""
|
7566
7715
|
fetch the users history of conversion trades
|
7567
|
-
|
7716
|
+
|
7717
|
+
https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-convert-history
|
7718
|
+
|
7568
7719
|
:param str [code]: the unified currency code
|
7569
7720
|
:param int [since]: the earliest time in ms to fetch conversions for
|
7570
7721
|
:param int [limit]: the maximum number of conversion structures to retrieve
|
@@ -7678,7 +7829,9 @@ class okx(Exchange, ImplicitAPI):
|
|
7678
7829
|
def fetch_convert_currencies(self, params={}) -> Currencies:
|
7679
7830
|
"""
|
7680
7831
|
fetches all available currencies that can be converted
|
7681
|
-
|
7832
|
+
|
7833
|
+
https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-convert-currencies
|
7834
|
+
|
7682
7835
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7683
7836
|
:returns dict: an associative dictionary of currencies
|
7684
7837
|
"""
|
@@ -7773,10 +7926,14 @@ class okx(Exchange, ImplicitAPI):
|
|
7773
7926
|
def fetch_margin_adjustment_history(self, symbol: Str = None, type: Str = None, since: Num = None, limit: Num = None, params={}) -> List[MarginModification]:
|
7774
7927
|
"""
|
7775
7928
|
fetches the history of margin added or reduced from contract isolated positions
|
7776
|
-
|
7777
|
-
|
7929
|
+
|
7930
|
+
https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-bills-details-last-7-days
|
7931
|
+
https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-bills-details-last-3-months
|
7932
|
+
|
7778
7933
|
:param str [symbol]: not used by okx fetchMarginAdjustmentHistory
|
7779
7934
|
:param str [type]: "add" or "reduce"
|
7935
|
+
:param int [since]: the earliest time in ms to fetch margin adjustment history for
|
7936
|
+
:param int [limit]: the maximum number of entries to retrieve
|
7780
7937
|
:param dict params: extra parameters specific to the exchange api endpoint
|
7781
7938
|
:param boolean [params.auto]: True if fetching auto margin increases
|
7782
7939
|
:returns dict[]: a list of `margin structures <https://docs.ccxt.com/#/?id=margin-loan-structure>`
|
@@ -7863,14 +8020,16 @@ class okx(Exchange, ImplicitAPI):
|
|
7863
8020
|
def fetch_positions_history(self, symbols: Strings = None, since: Int = None, limit: Int = None, params={}) -> List[Position]:
|
7864
8021
|
"""
|
7865
8022
|
fetches historical positions
|
7866
|
-
|
8023
|
+
|
8024
|
+
https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-positions-history
|
8025
|
+
|
7867
8026
|
:param str [symbols]: unified market symbols
|
7868
8027
|
:param int [since]: timestamp in ms of the earliest position to fetch
|
7869
8028
|
:param int [limit]: the maximum amount of records to fetch, default=100, max=100
|
7870
8029
|
:param dict params: extra parameters specific to the exchange api endpoint
|
7871
8030
|
:param str [params.marginMode]: "cross" or "isolated"
|
7872
|
-
|
7873
|
-
|
8031
|
+
|
8032
|
+
EXCHANGE SPECIFIC PARAMETERS
|
7874
8033
|
:param str [params.instType]: margin, swap, futures or option
|
7875
8034
|
:param str [params.type]: the type of latest close position 1: close position partially, 2:close all, 3:liquidation, 4:partial liquidation; 5:adl, is it is the latest type if there are several types for the same position
|
7876
8035
|
:param str [params.posId]: position id, there is attribute expiration, the posid will be expired if it is more than 30 days after the last full close position, then position will use new posid
|
@@ -7937,7 +8096,9 @@ class okx(Exchange, ImplicitAPI):
|
|
7937
8096
|
def fetch_long_short_ratio_history(self, symbol: Str = None, timeframe: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LongShortRatio]:
|
7938
8097
|
"""
|
7939
8098
|
fetches the long short ratio history for a unified market symbol
|
7940
|
-
|
8099
|
+
|
8100
|
+
https://www.okx.com/docs-v5/en/#trading-statistics-rest-api-get-contract-long-short-ratio
|
8101
|
+
|
7941
8102
|
:param str symbol: unified symbol of the market to fetch the long short ratio for
|
7942
8103
|
:param str [timeframe]: the period for the ratio
|
7943
8104
|
:param int [since]: the earliest time in ms to fetch ratios for
|