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