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/async_support/bybit.py
CHANGED
@@ -1092,7 +1092,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
1092
1092
|
def enable_demo_trading(self, enable: bool):
|
1093
1093
|
"""
|
1094
1094
|
enables or disables demo trading mode
|
1095
|
-
|
1095
|
+
https://bybit-exchange.github.io/docs/v5/demo
|
1096
1096
|
:param boolean [enable]: True if demo trading should be enabled, False otherwise
|
1097
1097
|
"""
|
1098
1098
|
if self.isSandboxModeEnabled:
|
@@ -1123,9 +1123,13 @@ class bybit(Exchange, ImplicitAPI):
|
|
1123
1123
|
|
1124
1124
|
async def is_unified_enabled(self, params={}):
|
1125
1125
|
"""
|
1126
|
-
:
|
1127
|
-
|
1126
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1127
|
+
|
1128
|
+
https://bybit-exchange.github.io/docs/v5/user/apikey-info#http-request
|
1129
|
+
https://bybit-exchange.github.io/docs/v5/account/account-info
|
1130
|
+
|
1128
1131
|
returns [enableUnifiedMargin, enableUnifiedAccount] so the user can check if unified account is enabled
|
1132
|
+
:returns any: [enableUnifiedMargin, enableUnifiedAccount]
|
1129
1133
|
"""
|
1130
1134
|
# The API key of user id must own one of permissions will be allowed to call following API endpoints.
|
1131
1135
|
# SUB UID: "Account Transfer"
|
@@ -1208,8 +1212,12 @@ class bybit(Exchange, ImplicitAPI):
|
|
1208
1212
|
|
1209
1213
|
async def upgrade_unified_trade_account(self, params={}):
|
1210
1214
|
"""
|
1211
|
-
:see: https://bybit-exchange.github.io/docs/v5/account/upgrade-unified-account
|
1212
1215
|
upgrades the account to unified trade account *warning* self is irreversible
|
1216
|
+
|
1217
|
+
https://bybit-exchange.github.io/docs/v5/account/upgrade-unified-account
|
1218
|
+
|
1219
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1220
|
+
:returns any: nothing
|
1213
1221
|
"""
|
1214
1222
|
return await self.privatePostV5AccountUpgradeToUta(params)
|
1215
1223
|
|
@@ -1331,7 +1339,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
1331
1339
|
async def fetch_time(self, params={}):
|
1332
1340
|
"""
|
1333
1341
|
fetches the current integer timestamp in milliseconds from the exchange server
|
1334
|
-
|
1342
|
+
|
1343
|
+
https://bybit-exchange.github.io/docs/v5/market/time
|
1344
|
+
|
1335
1345
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1336
1346
|
:returns int: the current integer timestamp in milliseconds from the exchange server
|
1337
1347
|
"""
|
@@ -1353,7 +1363,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
1353
1363
|
async def fetch_currencies(self, params={}) -> Currencies:
|
1354
1364
|
"""
|
1355
1365
|
fetches all available currencies on an exchange
|
1356
|
-
|
1366
|
+
|
1367
|
+
https://bybit-exchange.github.io/docs/v5/asset/coin-info
|
1368
|
+
|
1357
1369
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1358
1370
|
:returns dict: an associative dictionary of currencies
|
1359
1371
|
"""
|
@@ -1478,7 +1490,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
1478
1490
|
async def fetch_markets(self, params={}) -> List[Market]:
|
1479
1491
|
"""
|
1480
1492
|
retrieves data on all markets for bybit
|
1481
|
-
|
1493
|
+
|
1494
|
+
https://bybit-exchange.github.io/docs/v5/market/instrument
|
1495
|
+
|
1482
1496
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1483
1497
|
:returns dict[]: an array of objects representing market data
|
1484
1498
|
"""
|
@@ -2069,7 +2083,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
2069
2083
|
async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
2070
2084
|
"""
|
2071
2085
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
2072
|
-
|
2086
|
+
|
2087
|
+
https://bybit-exchange.github.io/docs/v5/market/tickers
|
2088
|
+
|
2073
2089
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
2074
2090
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2075
2091
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -2139,7 +2155,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
2139
2155
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
2140
2156
|
"""
|
2141
2157
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
2142
|
-
|
2158
|
+
|
2159
|
+
https://bybit-exchange.github.io/docs/v5/market/tickers
|
2160
|
+
|
2143
2161
|
:param str[] symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
2144
2162
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2145
2163
|
:param str [params.subType]: *contract only* 'linear', 'inverse'
|
@@ -2256,10 +2274,12 @@ class bybit(Exchange, ImplicitAPI):
|
|
2256
2274
|
async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
2257
2275
|
"""
|
2258
2276
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
2259
|
-
|
2260
|
-
|
2261
|
-
|
2262
|
-
|
2277
|
+
|
2278
|
+
https://bybit-exchange.github.io/docs/v5/market/kline
|
2279
|
+
https://bybit-exchange.github.io/docs/v5/market/mark-kline
|
2280
|
+
https://bybit-exchange.github.io/docs/v5/market/index-kline
|
2281
|
+
https://bybit-exchange.github.io/docs/v5/market/preimum-index-kline
|
2282
|
+
|
2263
2283
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
2264
2284
|
:param str timeframe: the length of time each candle represents
|
2265
2285
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
@@ -2418,7 +2438,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
2418
2438
|
async def fetch_funding_rates(self, symbols: Strings = None, params={}) -> FundingRates:
|
2419
2439
|
"""
|
2420
2440
|
fetches funding rates for multiple markets
|
2421
|
-
|
2441
|
+
|
2442
|
+
https://bybit-exchange.github.io/docs/v5/market/tickers
|
2443
|
+
|
2422
2444
|
:param str[] symbols: unified symbols of the markets to fetch the funding rates for, all market funding rates are returned if not assigned
|
2423
2445
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2424
2446
|
:returns dict[]: a list of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-structure>`
|
@@ -2488,7 +2510,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
2488
2510
|
async def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2489
2511
|
"""
|
2490
2512
|
fetches historical funding rate prices
|
2491
|
-
|
2513
|
+
|
2514
|
+
https://bybit-exchange.github.io/docs/v5/market/history-fund-rate
|
2515
|
+
|
2492
2516
|
:param str symbol: unified symbol of the market to fetch the funding rate history for
|
2493
2517
|
:param int [since]: timestamp in ms of the earliest funding rate to fetch
|
2494
2518
|
:param int [limit]: the maximum amount of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>` to fetch
|
@@ -2740,7 +2764,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
2740
2764
|
async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
2741
2765
|
"""
|
2742
2766
|
get the list of most recent trades for a particular symbol
|
2743
|
-
|
2767
|
+
|
2768
|
+
https://bybit-exchange.github.io/docs/v5/market/recent-trade
|
2769
|
+
|
2744
2770
|
:param str symbol: unified symbol of the market to fetch trades for
|
2745
2771
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
2746
2772
|
:param int [limit]: the maximum amount of trades to fetch
|
@@ -2795,7 +2821,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
2795
2821
|
async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
2796
2822
|
"""
|
2797
2823
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
2798
|
-
|
2824
|
+
|
2825
|
+
https://bybit-exchange.github.io/docs/v5/market/orderbook
|
2826
|
+
|
2799
2827
|
:param str symbol: unified symbol of the market to fetch the order book for
|
2800
2828
|
:param int [limit]: the maximum amount of order book entries to return
|
2801
2829
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -3008,9 +3036,11 @@ class bybit(Exchange, ImplicitAPI):
|
|
3008
3036
|
async def fetch_balance(self, params={}) -> Balances:
|
3009
3037
|
"""
|
3010
3038
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
3011
|
-
|
3012
|
-
|
3013
|
-
|
3039
|
+
|
3040
|
+
https://bybit-exchange.github.io/docs/v5/spot-margin-normal/account-info
|
3041
|
+
https://bybit-exchange.github.io/docs/v5/asset/all-balance
|
3042
|
+
https://bybit-exchange.github.io/docs/v5/account/wallet-balance
|
3043
|
+
|
3014
3044
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3015
3045
|
:param str [params.type]: wallet type, ['spot', 'swap', 'funding']
|
3016
3046
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
@@ -3408,8 +3438,10 @@ class bybit(Exchange, ImplicitAPI):
|
|
3408
3438
|
|
3409
3439
|
async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
3410
3440
|
"""
|
3411
|
-
:see: https://bybit-exchange.github.io/docs/v5/order/create-order
|
3412
3441
|
create a market buy order by providing the symbol and cost
|
3442
|
+
|
3443
|
+
https://bybit-exchange.github.io/docs/v5/order/create-order
|
3444
|
+
|
3413
3445
|
:param str symbol: unified symbol of the market to create an order in
|
3414
3446
|
:param float cost: how much you want to trade in units of the quote currency
|
3415
3447
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -3423,8 +3455,10 @@ class bybit(Exchange, ImplicitAPI):
|
|
3423
3455
|
|
3424
3456
|
async def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
3425
3457
|
"""
|
3426
|
-
:see: https://bybit-exchange.github.io/docs/v5/order/create-order
|
3427
3458
|
create a market sell order by providing the symbol and cost
|
3459
|
+
|
3460
|
+
https://bybit-exchange.github.io/docs/v5/order/create-order
|
3461
|
+
|
3428
3462
|
:param str symbol: unified symbol of the market to create an order in
|
3429
3463
|
:param float cost: how much you want to trade in units of the quote currency
|
3430
3464
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -3443,8 +3477,10 @@ class bybit(Exchange, ImplicitAPI):
|
|
3443
3477
|
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
3444
3478
|
"""
|
3445
3479
|
create a trade order
|
3446
|
-
|
3447
|
-
|
3480
|
+
|
3481
|
+
https://bybit-exchange.github.io/docs/v5/order/create-order
|
3482
|
+
https://bybit-exchange.github.io/docs/v5/position/trading-stop
|
3483
|
+
|
3448
3484
|
:param str symbol: unified symbol of the market to create an order in
|
3449
3485
|
:param str type: 'market' or 'limit'
|
3450
3486
|
:param str side: 'buy' or 'sell'
|
@@ -3695,8 +3731,11 @@ class bybit(Exchange, ImplicitAPI):
|
|
3695
3731
|
async def create_orders(self, orders: List[OrderRequest], params={}):
|
3696
3732
|
"""
|
3697
3733
|
create a list of trade orders
|
3698
|
-
|
3734
|
+
|
3735
|
+
https://bybit-exchange.github.io/docs/v5/order/batch-place
|
3736
|
+
|
3699
3737
|
: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
|
3738
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3700
3739
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
3701
3740
|
"""
|
3702
3741
|
await self.load_markets()
|
@@ -3840,9 +3879,11 @@ class bybit(Exchange, ImplicitAPI):
|
|
3840
3879
|
async def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
3841
3880
|
"""
|
3842
3881
|
edit a trade order
|
3843
|
-
|
3844
|
-
|
3845
|
-
|
3882
|
+
|
3883
|
+
https://bybit-exchange.github.io/docs/v5/order/amend-order
|
3884
|
+
https://bybit-exchange.github.io/docs/derivatives/unified/replace-order
|
3885
|
+
https://bybit-exchange.github.io/docs/api-explorer/derivatives/trade/contract/replace-order
|
3886
|
+
|
3846
3887
|
:param str id: cancel order id
|
3847
3888
|
:param str symbol: unified symbol of the market to create an order in
|
3848
3889
|
:param str type: 'market' or 'limit'
|
@@ -3914,7 +3955,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
3914
3955
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
3915
3956
|
"""
|
3916
3957
|
cancels an open order
|
3917
|
-
|
3958
|
+
|
3959
|
+
https://bybit-exchange.github.io/docs/v5/order/cancel-order
|
3960
|
+
|
3918
3961
|
:param str id: order id
|
3919
3962
|
:param str symbol: unified symbol of the market the order was made in
|
3920
3963
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -3947,7 +3990,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
3947
3990
|
async def cancel_orders(self, ids, symbol: Str = None, params={}):
|
3948
3991
|
"""
|
3949
3992
|
cancel multiple orders
|
3950
|
-
|
3993
|
+
|
3994
|
+
https://bybit-exchange.github.io/docs/v5/order/batch-cancel
|
3995
|
+
|
3951
3996
|
:param str[] ids: order ids
|
3952
3997
|
:param str symbol: unified symbol of the market the order was made in
|
3953
3998
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -4026,7 +4071,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
4026
4071
|
async def cancel_all_orders_after(self, timeout: Int, params={}):
|
4027
4072
|
"""
|
4028
4073
|
dead man's switch, cancel all orders after the given timeout
|
4029
|
-
|
4074
|
+
|
4075
|
+
https://bybit-exchange.github.io/docs/v5/order/dcp
|
4076
|
+
|
4030
4077
|
:param number timeout: time in milliseconds
|
4031
4078
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4032
4079
|
:param str [params.product]: OPTIONS, DERIVATIVES, SPOT, default is 'DERIVATIVES'
|
@@ -4057,7 +4104,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
4057
4104
|
async def cancel_orders_for_symbols(self, orders: List[CancellationRequest], params={}):
|
4058
4105
|
"""
|
4059
4106
|
cancel multiple orders for multiple symbols
|
4060
|
-
|
4107
|
+
|
4108
|
+
https://bybit-exchange.github.io/docs/v5/order/batch-cancel
|
4109
|
+
|
4061
4110
|
:param CancellationRequest[] orders: list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
4062
4111
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4063
4112
|
:returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -4137,7 +4186,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
4137
4186
|
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
4138
4187
|
"""
|
4139
4188
|
cancel all open orders
|
4140
|
-
|
4189
|
+
|
4190
|
+
https://bybit-exchange.github.io/docs/v5/order/cancel-all
|
4191
|
+
|
4141
4192
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
4142
4193
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4143
4194
|
:param boolean [params.trigger]: True if trigger order
|
@@ -4208,7 +4259,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
4208
4259
|
async def fetch_order_classic(self, id: str, symbol: Str = None, params={}):
|
4209
4260
|
"""
|
4210
4261
|
fetches information on an order made by the user *classic accounts only*
|
4211
|
-
|
4262
|
+
|
4263
|
+
https://bybit-exchange.github.io/docs/v5/order/order-list
|
4264
|
+
|
4212
4265
|
:param str id: the order id
|
4213
4266
|
:param str symbol: unified symbol of the market the order was made in
|
4214
4267
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -4235,8 +4288,10 @@ class bybit(Exchange, ImplicitAPI):
|
|
4235
4288
|
|
4236
4289
|
async def fetch_order(self, id: str, symbol: Str = None, params={}) -> Order:
|
4237
4290
|
"""
|
4238
|
-
|
4239
|
-
|
4291
|
+
classic accounts only/ spot not supported* fetches information on an order made by the user *classic accounts only*
|
4292
|
+
|
4293
|
+
https://bybit-exchange.github.io/docs/v5/order/order-list
|
4294
|
+
|
4240
4295
|
:param str id: the order id
|
4241
4296
|
:param str symbol: unified symbol of the market the order was made in
|
4242
4297
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -4326,7 +4381,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4326
4381
|
res = await self.is_unified_enabled()
|
4327
4382
|
"""
|
4328
4383
|
*classic accounts only/ spot not supported* fetches information on multiple orders made by the user *classic accounts only/ spot not supported*
|
4329
|
-
|
4384
|
+
https://bybit-exchange.github.io/docs/v5/order/order-list
|
4330
4385
|
:param str symbol: unified market symbol of the market orders were made in
|
4331
4386
|
:param int [since]: the earliest time in ms to fetch orders for
|
4332
4387
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -4348,7 +4403,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
4348
4403
|
async def fetch_orders_classic(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
4349
4404
|
"""
|
4350
4405
|
fetches information on multiple orders made by the user *classic accounts only*
|
4351
|
-
|
4406
|
+
|
4407
|
+
https://bybit-exchange.github.io/docs/v5/order/order-list
|
4408
|
+
|
4352
4409
|
:param str symbol: unified market symbol of the market orders were made in
|
4353
4410
|
:param int [since]: the earliest time in ms to fetch orders for
|
4354
4411
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -4447,7 +4504,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
4447
4504
|
async def fetch_closed_order(self, id: str, symbol: Str = None, params={}):
|
4448
4505
|
"""
|
4449
4506
|
fetches information on a closed order made by the user
|
4450
|
-
|
4507
|
+
|
4508
|
+
https://bybit-exchange.github.io/docs/v5/order/order-list
|
4509
|
+
|
4451
4510
|
:param str id: order id
|
4452
4511
|
:param str [symbol]: unified symbol of the market the order was made in
|
4453
4512
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -4475,7 +4534,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
4475
4534
|
async def fetch_open_order(self, id: str, symbol: Str = None, params={}):
|
4476
4535
|
"""
|
4477
4536
|
fetches information on an open order made by the user
|
4478
|
-
|
4537
|
+
|
4538
|
+
https://bybit-exchange.github.io/docs/v5/order/open-order
|
4539
|
+
|
4479
4540
|
:param str id: order id
|
4480
4541
|
:param str [symbol]: unified symbol of the market the order was made in
|
4481
4542
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -4505,7 +4566,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
4505
4566
|
async def fetch_canceled_and_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
4506
4567
|
"""
|
4507
4568
|
fetches information on multiple canceled and closed orders made by the user
|
4508
|
-
|
4569
|
+
|
4570
|
+
https://bybit-exchange.github.io/docs/v5/order/order-list
|
4571
|
+
|
4509
4572
|
:param str [symbol]: unified market symbol of the market orders were made in
|
4510
4573
|
:param int [since]: the earliest time in ms to fetch orders for
|
4511
4574
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -4602,7 +4665,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
4602
4665
|
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
4603
4666
|
"""
|
4604
4667
|
fetches information on multiple closed orders made by the user
|
4605
|
-
|
4668
|
+
|
4669
|
+
https://bybit-exchange.github.io/docs/v5/order/order-list
|
4670
|
+
|
4606
4671
|
:param str [symbol]: unified market symbol of the market orders were made in
|
4607
4672
|
:param int [since]: the earliest time in ms to fetch orders for
|
4608
4673
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -4625,7 +4690,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
4625
4690
|
async def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4626
4691
|
"""
|
4627
4692
|
fetches information on multiple canceled orders made by the user
|
4628
|
-
|
4693
|
+
|
4694
|
+
https://bybit-exchange.github.io/docs/v5/order/order-list
|
4695
|
+
|
4629
4696
|
:param str [symbol]: unified market symbol of the market orders were made in
|
4630
4697
|
:param int [since]: timestamp in ms of the earliest order, default is None
|
4631
4698
|
:param int [limit]: max number of orders to return, default is None
|
@@ -4648,7 +4715,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
4648
4715
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
4649
4716
|
"""
|
4650
4717
|
fetch all unfilled currently open orders
|
4651
|
-
|
4718
|
+
|
4719
|
+
https://bybit-exchange.github.io/docs/v5/order/open-order
|
4720
|
+
|
4652
4721
|
:param str symbol: unified market symbol
|
4653
4722
|
:param int [since]: the earliest time in ms to fetch open orders for
|
4654
4723
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
@@ -4744,7 +4813,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
4744
4813
|
async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4745
4814
|
"""
|
4746
4815
|
fetch all the trades made from a single order
|
4747
|
-
|
4816
|
+
|
4817
|
+
https://bybit-exchange.github.io/docs/v5/position/execution
|
4818
|
+
|
4748
4819
|
:param str id: order id
|
4749
4820
|
:param str symbol: unified market symbol
|
4750
4821
|
:param int [since]: the earliest time in ms to fetch trades for
|
@@ -4764,7 +4835,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
4764
4835
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4765
4836
|
"""
|
4766
4837
|
fetch all trades made by the user
|
4767
|
-
|
4838
|
+
|
4839
|
+
https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
|
4840
|
+
|
4768
4841
|
:param str symbol: unified market symbol
|
4769
4842
|
:param int [since]: the earliest time in ms to fetch trades for
|
4770
4843
|
:param int [limit]: the maximum number of trades structures to retrieve
|
@@ -4863,7 +4936,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
4863
4936
|
async def fetch_deposit_addresses_by_network(self, code: str, params={}) -> List[DepositAddress]:
|
4864
4937
|
"""
|
4865
4938
|
fetch a dictionary of addresses for a currency, indexed by network
|
4866
|
-
|
4939
|
+
|
4940
|
+
https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
|
4941
|
+
|
4867
4942
|
:param str code: unified currency code of the currency for the deposit address
|
4868
4943
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4869
4944
|
:returns dict: a dictionary of `address structures <https://docs.ccxt.com/#/?id=address-structure>` indexed by the network
|
@@ -4905,7 +4980,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
4905
4980
|
async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
|
4906
4981
|
"""
|
4907
4982
|
fetch the deposit address for a currency associated with self account
|
4908
|
-
|
4983
|
+
|
4984
|
+
https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
|
4985
|
+
|
4909
4986
|
:param str code: unified currency code
|
4910
4987
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4911
4988
|
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
@@ -4949,13 +5026,15 @@ class bybit(Exchange, ImplicitAPI):
|
|
4949
5026
|
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
4950
5027
|
"""
|
4951
5028
|
fetch all deposits made to an account
|
4952
|
-
|
5029
|
+
|
5030
|
+
https://bybit-exchange.github.io/docs/v5/asset/deposit-record
|
5031
|
+
|
4953
5032
|
:param str code: unified currency code
|
4954
5033
|
:param int [since]: the earliest time in ms to fetch deposits for, default = 30 days before the current time
|
4955
5034
|
:param int [limit]: the maximum number of deposits structures to retrieve, default = 50, max = 50
|
4956
5035
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4957
5036
|
:param int [params.until]: the latest time in ms to fetch deposits for, default = 30 days after since
|
4958
|
-
|
5037
|
+
EXCHANGE SPECIFIC PARAMETERS
|
4959
5038
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
4960
5039
|
:param str [params.cursor]: used for pagination
|
4961
5040
|
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
|
@@ -5013,7 +5092,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
5013
5092
|
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
5014
5093
|
"""
|
5015
5094
|
fetch all withdrawals made from an account
|
5016
|
-
|
5095
|
+
|
5096
|
+
https://bybit-exchange.github.io/docs/v5/asset/withdraw-record
|
5097
|
+
|
5017
5098
|
:param str code: unified currency code
|
5018
5099
|
:param int [since]: the earliest time in ms to fetch withdrawals for
|
5019
5100
|
:param int [limit]: the maximum number of withdrawals structures to retrieve
|
@@ -5186,14 +5267,16 @@ class bybit(Exchange, ImplicitAPI):
|
|
5186
5267
|
async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
5187
5268
|
"""
|
5188
5269
|
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
5189
|
-
|
5190
|
-
|
5270
|
+
|
5271
|
+
https://bybit-exchange.github.io/docs/v5/account/transaction-log
|
5272
|
+
https://bybit-exchange.github.io/docs/v5/account/contract-transaction-log
|
5273
|
+
|
5191
5274
|
:param str [code]: unified currency code, default is None
|
5192
5275
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
5193
5276
|
:param int [limit]: max number of ledger entries to return, default is None
|
5277
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5194
5278
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
5195
5279
|
:param str [params.subType]: if inverse will use v5/account/contract-transaction-log
|
5196
|
-
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5197
5280
|
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
|
5198
5281
|
"""
|
5199
5282
|
await self.load_markets()
|
@@ -5454,7 +5537,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
5454
5537
|
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
5455
5538
|
"""
|
5456
5539
|
make a withdrawal
|
5457
|
-
|
5540
|
+
|
5541
|
+
https://bybit-exchange.github.io/docs/v5/asset/withdraw
|
5542
|
+
|
5458
5543
|
:param str code: unified currency code
|
5459
5544
|
:param float amount: the amount to withdraw
|
5460
5545
|
:param str address: the address to withdraw to
|
@@ -5499,7 +5584,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
5499
5584
|
async def fetch_position(self, symbol: str, params={}):
|
5500
5585
|
"""
|
5501
5586
|
fetch data on a single open contract trade position
|
5502
|
-
|
5587
|
+
|
5588
|
+
https://bybit-exchange.github.io/docs/v5/position
|
5589
|
+
|
5503
5590
|
:param str symbol: unified market symbol of the market the position is held in, default is None
|
5504
5591
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5505
5592
|
:returns dict: a `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
@@ -5568,7 +5655,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
5568
5655
|
async def fetch_positions(self, symbols: Strings = None, params={}):
|
5569
5656
|
"""
|
5570
5657
|
fetch all open positions
|
5571
|
-
|
5658
|
+
|
5659
|
+
https://bybit-exchange.github.io/docs/v5/position
|
5660
|
+
|
5572
5661
|
:param str[] symbols: list of unified market symbols
|
5573
5662
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5574
5663
|
:param str [params.type]: market type, ['swap', 'option', 'spot']
|
@@ -5889,7 +5978,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
5889
5978
|
async def fetch_leverage(self, symbol: str, params={}) -> Leverage:
|
5890
5979
|
"""
|
5891
5980
|
fetch the set leverage for a market
|
5892
|
-
|
5981
|
+
|
5982
|
+
https://bybit-exchange.github.io/docs/v5/position
|
5983
|
+
|
5893
5984
|
:param str symbol: unified market symbol
|
5894
5985
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5895
5986
|
:returns dict: a `leverage structure <https://docs.ccxt.com/#/?id=leverage-structure>`
|
@@ -5913,8 +6004,10 @@ class bybit(Exchange, ImplicitAPI):
|
|
5913
6004
|
async def set_margin_mode(self, marginMode: str, symbol: Str = None, params={}):
|
5914
6005
|
"""
|
5915
6006
|
set margin mode(account) or trade mode(symbol)
|
5916
|
-
|
5917
|
-
|
6007
|
+
|
6008
|
+
https://bybit-exchange.github.io/docs/v5/account/set-margin-mode
|
6009
|
+
https://bybit-exchange.github.io/docs/v5/position/cross-isolate
|
6010
|
+
|
5918
6011
|
:param str marginMode: account mode must be either [isolated, cross, portfolio], trade mode must be either [isolated, cross]
|
5919
6012
|
:param str symbol: unified market symbol of the market the position is held in, default is None
|
5920
6013
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -5995,7 +6088,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
5995
6088
|
async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
5996
6089
|
"""
|
5997
6090
|
set the level of leverage for a market
|
5998
|
-
|
6091
|
+
|
6092
|
+
https://bybit-exchange.github.io/docs/v5/position/leverage
|
6093
|
+
|
5999
6094
|
:param float leverage: the rate of leverage
|
6000
6095
|
:param str symbol: unified market symbol
|
6001
6096
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6031,7 +6126,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
6031
6126
|
async def set_position_mode(self, hedged: bool, symbol: Str = None, params={}):
|
6032
6127
|
"""
|
6033
6128
|
set hedged to True or False for a market
|
6034
|
-
|
6129
|
+
|
6130
|
+
https://bybit-exchange.github.io/docs/v5/position/position-mode
|
6131
|
+
|
6035
6132
|
:param bool hedged:
|
6036
6133
|
:param str symbol: used for unified account with inverse market
|
6037
6134
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6127,7 +6224,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
6127
6224
|
async def fetch_open_interest(self, symbol: str, params={}):
|
6128
6225
|
"""
|
6129
6226
|
Retrieves the open interest of a derivative trading pair
|
6130
|
-
|
6227
|
+
|
6228
|
+
https://bybit-exchange.github.io/docs/v5/market/open-interest
|
6229
|
+
|
6131
6230
|
:param str symbol: Unified CCXT market symbol
|
6132
6231
|
:param dict [params]: exchange specific parameters
|
6133
6232
|
:param str [params.interval]: 5m, 15m, 30m, 1h, 4h, 1d
|
@@ -6183,7 +6282,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
6183
6282
|
async def fetch_open_interest_history(self, symbol: str, timeframe='1h', since: Int = None, limit: Int = None, params={}):
|
6184
6283
|
"""
|
6185
6284
|
Gets the total amount of unsettled contracts. In other words, the total number of contracts held in open positions
|
6186
|
-
|
6285
|
+
|
6286
|
+
https://bybit-exchange.github.io/docs/v5/market/open-interest
|
6287
|
+
|
6187
6288
|
:param str symbol: Unified market symbol
|
6188
6289
|
:param str timeframe: "5m", 15m, 30m, 1h, 4h, 1d
|
6189
6290
|
:param int [since]: Not used by Bybit
|
@@ -6231,7 +6332,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
6231
6332
|
async def fetch_cross_borrow_rate(self, code: str, params={}) -> CrossBorrowRate:
|
6232
6333
|
"""
|
6233
6334
|
fetch the rate of interest to borrow a currency for margin trading
|
6234
|
-
|
6335
|
+
|
6336
|
+
https://bybit-exchange.github.io/docs/zh-TW/v5/spot-margin-normal/interest-quota
|
6337
|
+
|
6235
6338
|
:param str code: unified currency code
|
6236
6339
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6237
6340
|
:returns dict: a `borrow rate structure <https://docs.ccxt.com/#/?id=borrow-rate-structure>`
|
@@ -6295,7 +6398,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
6295
6398
|
async def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[BorrowInterest]:
|
6296
6399
|
"""
|
6297
6400
|
fetch the interest owed by the user for borrowing currency for margin trading
|
6298
|
-
|
6401
|
+
|
6402
|
+
https://bybit-exchange.github.io/docs/zh-TW/v5/spot-margin-normal/account-info
|
6403
|
+
|
6299
6404
|
:param str code: unified currency code
|
6300
6405
|
:param str symbol: unified market symbol when fetch interest in isolated markets
|
6301
6406
|
:param number [since]: the earliest time in ms to fetch borrrow interest for
|
@@ -6339,7 +6444,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
6339
6444
|
async def fetch_borrow_rate_history(self, code: str, since: Int = None, limit: Int = None, params={}):
|
6340
6445
|
"""
|
6341
6446
|
retrieves a history of a currencies borrow interest rate at specific time slots
|
6342
|
-
|
6447
|
+
|
6448
|
+
https://bybit-exchange.github.io/docs/v5/spot-margin-uta/historical-interest
|
6449
|
+
|
6343
6450
|
:param str code: unified currency code
|
6344
6451
|
:param int [since]: timestamp for the earliest borrow rate
|
6345
6452
|
:param int [limit]: the maximum number of `borrow rate structures <https://docs.ccxt.com/#/?id=borrow-rate-structure>` to retrieve
|
@@ -6409,7 +6516,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
6409
6516
|
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
6410
6517
|
"""
|
6411
6518
|
transfer currency internally between wallets on the same account
|
6412
|
-
|
6519
|
+
|
6520
|
+
https://bybit-exchange.github.io/docs/v5/asset/create-inter-transfer
|
6521
|
+
|
6413
6522
|
:param str code: unified currency code
|
6414
6523
|
:param float amount: amount to transfer
|
6415
6524
|
:param str fromAccount: account to transfer from
|
@@ -6460,7 +6569,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
6460
6569
|
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]:
|
6461
6570
|
"""
|
6462
6571
|
fetch a history of internal transfers made on an account
|
6463
|
-
|
6572
|
+
|
6573
|
+
https://bybit-exchange.github.io/docs/v5/asset/inter-transfer-list
|
6574
|
+
|
6464
6575
|
:param str code: unified currency code of the currency transferred
|
6465
6576
|
:param int [since]: the earliest time in ms to fetch transfers for
|
6466
6577
|
:param int [limit]: the maximum number of transfer structures to retrieve
|
@@ -6513,7 +6624,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
6513
6624
|
async def borrow_cross_margin(self, code: str, amount: float, params={}):
|
6514
6625
|
"""
|
6515
6626
|
create a loan to borrow margin
|
6516
|
-
|
6627
|
+
|
6628
|
+
https://bybit-exchange.github.io/docs/v5/spot-margin-normal/borrow
|
6629
|
+
|
6517
6630
|
:param str code: unified currency code of the currency to borrow
|
6518
6631
|
:param float amount: the amount to borrow
|
6519
6632
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6547,7 +6660,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
6547
6660
|
async def repay_cross_margin(self, code: str, amount, params={}):
|
6548
6661
|
"""
|
6549
6662
|
repay borrowed margin and interest
|
6550
|
-
|
6663
|
+
|
6664
|
+
https://bybit-exchange.github.io/docs/v5/spot-margin-normal/repay
|
6665
|
+
|
6551
6666
|
:param str code: unified currency code of the currency to repay
|
6552
6667
|
:param float amount: the amount to repay
|
6553
6668
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6649,7 +6764,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6649
6764
|
'status': self.parse_transfer_status(self.safe_string(transfer, 'status')),
|
6650
6765
|
}
|
6651
6766
|
|
6652
|
-
async def fetch_derivatives_market_leverage_tiers(self, symbol: str, params={}):
|
6767
|
+
async def fetch_derivatives_market_leverage_tiers(self, symbol: str, params={}) -> List[LeverageTier]:
|
6653
6768
|
await self.load_markets()
|
6654
6769
|
market = self.market(symbol)
|
6655
6770
|
request: dict = {
|
@@ -6690,7 +6805,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
6690
6805
|
async def fetch_market_leverage_tiers(self, symbol: str, params={}) -> List[LeverageTier]:
|
6691
6806
|
"""
|
6692
6807
|
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
|
6693
|
-
|
6808
|
+
|
6809
|
+
https://bybit-exchange.github.io/docs/v5/market/risk-limit
|
6810
|
+
|
6694
6811
|
:param str symbol: unified market symbol
|
6695
6812
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6696
6813
|
:returns dict: a `leverage tiers structure <https://docs.ccxt.com/#/?id=leverage-tiers-structure>`
|
@@ -6727,7 +6844,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
6727
6844
|
async def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
|
6728
6845
|
"""
|
6729
6846
|
fetch the trading fees for a market
|
6730
|
-
|
6847
|
+
|
6848
|
+
https://bybit-exchange.github.io/docs/v5/account/fee-rate
|
6849
|
+
|
6731
6850
|
:param str symbol: unified market symbol
|
6732
6851
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6733
6852
|
:returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -6773,7 +6892,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
6773
6892
|
async def fetch_trading_fees(self, params={}) -> TradingFees:
|
6774
6893
|
"""
|
6775
6894
|
fetch the trading fees for multiple markets
|
6776
|
-
|
6895
|
+
|
6896
|
+
https://bybit-exchange.github.io/docs/v5/account/fee-rate
|
6897
|
+
|
6777
6898
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6778
6899
|
:param str [params.type]: market type, ['swap', 'option', 'spot']
|
6779
6900
|
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
|
@@ -6863,7 +6984,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
6863
6984
|
async def fetch_deposit_withdraw_fees(self, codes: Strings = None, params={}):
|
6864
6985
|
"""
|
6865
6986
|
fetch deposit and withdraw fees
|
6866
|
-
|
6987
|
+
|
6988
|
+
https://bybit-exchange.github.io/docs/v5/asset/coin-info
|
6989
|
+
|
6867
6990
|
:param str[] codes: list of unified currency codes
|
6868
6991
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6869
6992
|
:returns dict: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -6908,7 +7031,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
6908
7031
|
async def fetch_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
6909
7032
|
"""
|
6910
7033
|
fetches historical settlement records
|
6911
|
-
|
7034
|
+
|
7035
|
+
https://bybit-exchange.github.io/docs/v5/market/delivery-price
|
7036
|
+
|
6912
7037
|
:param str symbol: unified market symbol of the settlement history
|
6913
7038
|
:param int [since]: timestamp in ms
|
6914
7039
|
:param int [limit]: number of records
|
@@ -6959,7 +7084,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
6959
7084
|
async def fetch_my_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
6960
7085
|
"""
|
6961
7086
|
fetches historical settlement records of the user
|
6962
|
-
|
7087
|
+
|
7088
|
+
https://bybit-exchange.github.io/docs/v5/asset/delivery
|
7089
|
+
|
6963
7090
|
:param str symbol: unified market symbol of the settlement history
|
6964
7091
|
:param int [since]: timestamp in ms
|
6965
7092
|
:param int [limit]: number of records
|
@@ -7080,7 +7207,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
7080
7207
|
async def fetch_volatility_history(self, code: str, params={}):
|
7081
7208
|
"""
|
7082
7209
|
fetch the historical volatility of an option market based on an underlying asset
|
7083
|
-
|
7210
|
+
|
7211
|
+
https://bybit-exchange.github.io/docs/v5/market/iv
|
7212
|
+
|
7084
7213
|
:param str code: unified currency code
|
7085
7214
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7086
7215
|
:param int [params.period]: the period in days to fetch the volatility for: 7,14,21,30,60,90,180,270
|
@@ -7133,7 +7262,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
7133
7262
|
async def fetch_greeks(self, symbol: str, params={}) -> Greeks:
|
7134
7263
|
"""
|
7135
7264
|
fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
|
7136
|
-
|
7265
|
+
|
7266
|
+
https://bybit-exchange.github.io/docs/api-explorer/v5/market/tickers
|
7267
|
+
|
7137
7268
|
:param str symbol: unified symbol of the market to fetch greeks for
|
7138
7269
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7139
7270
|
:returns dict: a `greeks structure <https://docs.ccxt.com/#/?id=greeks-structure>`
|
@@ -7251,7 +7382,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
7251
7382
|
async def fetch_my_liquidations(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
7252
7383
|
"""
|
7253
7384
|
retrieves the users liquidated positions
|
7254
|
-
|
7385
|
+
|
7386
|
+
https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
|
7387
|
+
|
7255
7388
|
:param str [symbol]: unified CCXT market symbol
|
7256
7389
|
:param int [since]: the earliest time in ms to fetch liquidations for
|
7257
7390
|
:param int [limit]: the maximum number of liquidation structures to retrieve
|
@@ -7402,8 +7535,10 @@ class bybit(Exchange, ImplicitAPI):
|
|
7402
7535
|
|
7403
7536
|
async def fetch_leverage_tiers(self, symbols: Strings = None, params={}) -> LeverageTiers:
|
7404
7537
|
"""
|
7405
|
-
:see: https://bybit-exchange.github.io/docs/v5/market/risk-limit
|
7406
7538
|
retrieve information on the maximum leverage, for different trade sizes
|
7539
|
+
|
7540
|
+
https://bybit-exchange.github.io/docs/v5/market/risk-limit
|
7541
|
+
|
7407
7542
|
:param str[] [symbols]: a list of unified market symbols
|
7408
7543
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7409
7544
|
:param str [params.subType]: market subType, ['linear', 'inverse'], default is 'linear'
|
@@ -7422,7 +7557,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
7422
7557
|
symbols = self.market_symbols(symbols)
|
7423
7558
|
return self.parse_leverage_tiers(data, symbols, 'symbol')
|
7424
7559
|
|
7425
|
-
def parse_leverage_tiers(self, response, symbols: Strings = None, marketIdKey=None):
|
7560
|
+
def parse_leverage_tiers(self, response, symbols: Strings = None, marketIdKey=None) -> LeverageTiers:
|
7426
7561
|
#
|
7427
7562
|
# [
|
7428
7563
|
# {
|
@@ -7476,6 +7611,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
7476
7611
|
minNotional = self.safe_number(info[i - 1], 'riskLimitValue')
|
7477
7612
|
tiers.append({
|
7478
7613
|
'tier': self.safe_integer(tier, 'id'),
|
7614
|
+
'symbol': self.safe_symbol(marketId, market),
|
7479
7615
|
'currency': market['settle'],
|
7480
7616
|
'minNotional': minNotional,
|
7481
7617
|
'maxNotional': self.safe_number(tier, 'riskLimitValue'),
|
@@ -7488,7 +7624,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
7488
7624
|
async def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
7489
7625
|
"""
|
7490
7626
|
fetch the history of funding payments paid and received on self account
|
7491
|
-
|
7627
|
+
|
7628
|
+
https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
|
7629
|
+
|
7492
7630
|
:param str [symbol]: unified market symbol
|
7493
7631
|
:param int [since]: the earliest time in ms to fetch funding history for
|
7494
7632
|
:param int [limit]: the maximum number of funding history structures to retrieve
|
@@ -7579,7 +7717,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
7579
7717
|
async def fetch_option(self, symbol: str, params={}) -> Option:
|
7580
7718
|
"""
|
7581
7719
|
fetches option data that is commonly found in an option chain
|
7582
|
-
|
7720
|
+
|
7721
|
+
https://bybit-exchange.github.io/docs/v5/market/tickers
|
7722
|
+
|
7583
7723
|
:param str symbol: unified market symbol
|
7584
7724
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7585
7725
|
:returns dict: an `option chain structure <https://docs.ccxt.com/#/?id=option-chain-structure>`
|
@@ -7639,8 +7779,10 @@ class bybit(Exchange, ImplicitAPI):
|
|
7639
7779
|
async def fetch_option_chain(self, code: str, params={}) -> OptionChain:
|
7640
7780
|
"""
|
7641
7781
|
fetches data for an underlying asset that is commonly found in an option chain
|
7642
|
-
|
7643
|
-
|
7782
|
+
|
7783
|
+
https://bybit-exchange.github.io/docs/v5/market/tickers
|
7784
|
+
|
7785
|
+
:param str code: base currency to fetch an option chain for
|
7644
7786
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7645
7787
|
:returns dict: a list of `option chain structures <https://docs.ccxt.com/#/?id=option-chain-structure>`
|
7646
7788
|
"""
|
@@ -7750,8 +7892,10 @@ class bybit(Exchange, ImplicitAPI):
|
|
7750
7892
|
async def fetch_positions_history(self, symbols: Strings = None, since: Int = None, limit: Int = None, params={}) -> List[Position]:
|
7751
7893
|
"""
|
7752
7894
|
fetches historical positions
|
7753
|
-
|
7754
|
-
|
7895
|
+
|
7896
|
+
https://bybit-exchange.github.io/docs/v5/position/close-pnl
|
7897
|
+
|
7898
|
+
:param str[] symbols: a list of unified market symbols
|
7755
7899
|
:param int [since]: timestamp in ms of the earliest position to fetch, params["until"] - since <= 7 days
|
7756
7900
|
:param int [limit]: the maximum amount of records to fetch, default=50, max=100
|
7757
7901
|
:param dict params: extra parameters specific to the exchange api endpoint
|
@@ -7823,7 +7967,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
7823
7967
|
async def fetch_convert_currencies(self, params={}) -> Currencies:
|
7824
7968
|
"""
|
7825
7969
|
fetches all available currencies that can be converted
|
7826
|
-
|
7970
|
+
|
7971
|
+
https://bybit-exchange.github.io/docs/v5/asset/convert/convert-coin-list
|
7972
|
+
|
7827
7973
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7828
7974
|
:param str [params.accountType]: eb_convert_uta, eb_convert_spot, eb_convert_funding, eb_convert_inverse, or eb_convert_contract
|
7829
7975
|
:returns dict: an associative dictionary of currencies
|
@@ -7914,7 +8060,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
7914
8060
|
async def fetch_convert_quote(self, fromCode: str, toCode: str, amount: Num = None, params={}) -> Conversion:
|
7915
8061
|
"""
|
7916
8062
|
fetch a quote for converting from one currency to another
|
7917
|
-
|
8063
|
+
|
8064
|
+
https://bybit-exchange.github.io/docs/v5/asset/convert/apply-quote
|
8065
|
+
|
7918
8066
|
:param str fromCode: the currency that you want to sell and convert from
|
7919
8067
|
:param str toCode: the currency that you want to buy and convert into
|
7920
8068
|
:param float [amount]: how much you want to trade in units of the from currency
|
@@ -7966,7 +8114,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
7966
8114
|
async def create_convert_trade(self, id: str, fromCode: str, toCode: str, amount: Num = None, params={}) -> Conversion:
|
7967
8115
|
"""
|
7968
8116
|
convert from one currency to another
|
7969
|
-
|
8117
|
+
|
8118
|
+
https://bybit-exchange.github.io/docs/v5/asset/convert/confirm-quote
|
8119
|
+
|
7970
8120
|
:param str id: the id of the trade that you want to make
|
7971
8121
|
:param str fromCode: the currency that you want to sell and convert from
|
7972
8122
|
:param str toCode: the currency that you want to buy and convert into
|
@@ -7997,7 +8147,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
7997
8147
|
async def fetch_convert_trade(self, id: str, code: Str = None, params={}) -> Conversion:
|
7998
8148
|
"""
|
7999
8149
|
fetch the data for a conversion trade
|
8000
|
-
|
8150
|
+
|
8151
|
+
https://bybit-exchange.github.io/docs/v5/asset/convert/get-convert-result
|
8152
|
+
|
8001
8153
|
:param str id: the id of the trade that you want to fetch
|
8002
8154
|
:param str [code]: the unified currency code of the conversion trade
|
8003
8155
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -8055,7 +8207,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
8055
8207
|
async def fetch_convert_trade_history(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Conversion]:
|
8056
8208
|
"""
|
8057
8209
|
fetch the users history of conversion trades
|
8058
|
-
|
8210
|
+
|
8211
|
+
https://bybit-exchange.github.io/docs/v5/asset/convert/get-convert-history
|
8212
|
+
|
8059
8213
|
:param str [code]: the unified currency code
|
8060
8214
|
:param int [since]: the earliest time in ms to fetch conversions for
|
8061
8215
|
:param int [limit]: the maximum number of conversion structures to retrieve
|
@@ -8162,7 +8316,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
8162
8316
|
async def fetch_long_short_ratio_history(self, symbol: Str = None, timeframe: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LongShortRatio]:
|
8163
8317
|
"""
|
8164
8318
|
fetches the long short ratio history for a unified market symbol
|
8165
|
-
|
8319
|
+
|
8320
|
+
https://bybit-exchange.github.io/docs/v5/market/long-short-ratio
|
8321
|
+
|
8166
8322
|
:param str symbol: unified symbol of the market to fetch the long short ratio for
|
8167
8323
|
:param str [timeframe]: the period for the ratio, default is 24 hours
|
8168
8324
|
:param int [since]: the earliest time in ms to fetch ratios for
|