ccxt 4.4.30__py2.py3-none-any.whl → 4.4.31__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/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 -19
- 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 +298 -155
- ccxt/async_support/gemini.py +57 -20
- ccxt/async_support/hashkey.py +151 -66
- ccxt/async_support/hitbtc.py +156 -73
- 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 +53 -16
- ccxt/async_support/kraken.py +107 -35
- ccxt/async_support/krakenfutures.py +88 -34
- ccxt/async_support/kucoin.py +211 -109
- ccxt/async_support/kucoinfutures.py +119 -42
- 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 +91 -41
- 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 +29 -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 +118 -49
- 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 +34 -34
- 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 -19
- 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 +298 -155
- ccxt/gemini.py +57 -20
- ccxt/hashkey.py +151 -66
- ccxt/hitbtc.py +156 -73
- 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 +53 -16
- ccxt/kraken.py +107 -35
- ccxt/krakenfutures.py +88 -34
- ccxt/kucoin.py +211 -109
- ccxt/kucoinfutures.py +119 -42
- 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 +91 -41
- 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 +200 -119
- ccxt/pro/bingx.py +44 -24
- ccxt/pro/bitfinex.py +13 -5
- ccxt/pro/bitget.py +75 -36
- 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 +51 -17
- 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 +70 -26
- ccxt/pro/deribit.py +36 -12
- ccxt/pro/exmo.py +10 -4
- ccxt/pro/gate.py +64 -30
- ccxt/pro/gemini.py +21 -7
- ccxt/pro/hashkey.py +26 -8
- 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 +35 -17
- 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 +29 -8
- ccxt/wazirx.py +51 -17
- ccxt/whitebit.py +105 -41
- ccxt/woo.py +162 -65
- ccxt/woofipro.py +118 -49
- 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.31.dist-info}/METADATA +5 -5
- {ccxt-4.4.30.dist-info → ccxt-4.4.31.dist-info}/RECORD +267 -267
- {ccxt-4.4.30.dist-info → ccxt-4.4.31.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.30.dist-info → ccxt-4.4.31.dist-info}/WHEEL +0 -0
- {ccxt-4.4.30.dist-info → ccxt-4.4.31.dist-info}/top_level.txt +0 -0
ccxt/async_support/binance.py
CHANGED
@@ -132,7 +132,7 @@ class binance(Exchange, ImplicitAPI):
|
|
132
132
|
'fetchLongShortRatio': False,
|
133
133
|
'fetchLongShortRatioHistory': True,
|
134
134
|
'fetchMarginAdjustmentHistory': True,
|
135
|
-
'fetchMarginMode':
|
135
|
+
'fetchMarginMode': True,
|
136
136
|
'fetchMarginModes': True,
|
137
137
|
'fetchMarketLeverageTiers': 'emulated',
|
138
138
|
'fetchMarkets': True,
|
@@ -2668,9 +2668,11 @@ class binance(Exchange, ImplicitAPI):
|
|
2668
2668
|
async def fetch_time(self, params={}):
|
2669
2669
|
"""
|
2670
2670
|
fetches the current integer timestamp in milliseconds from the exchange server
|
2671
|
-
|
2672
|
-
|
2673
|
-
|
2671
|
+
|
2672
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#check-server-time # spot
|
2673
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time # swap
|
2674
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Check-Server-time # future
|
2675
|
+
|
2674
2676
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2675
2677
|
:param str [params.subType]: "linear" or "inverse"
|
2676
2678
|
:returns int: the current integer timestamp in milliseconds from the exchange server
|
@@ -2692,8 +2694,10 @@ class binance(Exchange, ImplicitAPI):
|
|
2692
2694
|
async def fetch_currencies(self, params={}) -> Currencies:
|
2693
2695
|
"""
|
2694
2696
|
fetches all available currencies on an exchange
|
2695
|
-
|
2696
|
-
|
2697
|
+
|
2698
|
+
https://developers.binance.com/docs/wallet/capital/all-coins-info
|
2699
|
+
https://developers.binance.com/docs/margin_trading/market-data/Get-All-Margin-Assets
|
2700
|
+
|
2697
2701
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2698
2702
|
:returns dict: an associative dictionary of currencies
|
2699
2703
|
"""
|
@@ -2900,12 +2904,14 @@ class binance(Exchange, ImplicitAPI):
|
|
2900
2904
|
async def fetch_markets(self, params={}) -> List[Market]:
|
2901
2905
|
"""
|
2902
2906
|
retrieves data on all markets for binance
|
2903
|
-
|
2904
|
-
|
2905
|
-
|
2906
|
-
|
2907
|
-
|
2908
|
-
|
2907
|
+
|
2908
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#exchange-information # spot
|
2909
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information # swap
|
2910
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Exchange-Information # future
|
2911
|
+
https://developers.binance.com/docs/derivatives/option/market-data/Exchange-Information # option
|
2912
|
+
https://developers.binance.com/docs/margin_trading/market-data/Get-All-Cross-Margin-Pairs # cross margin
|
2913
|
+
https://developers.binance.com/docs/margin_trading/market-data/Get-All-Isolated-Margin-Symbol # isolated margin
|
2914
|
+
|
2909
2915
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2910
2916
|
:returns dict[]: an array of objects representing market data
|
2911
2917
|
"""
|
@@ -3453,14 +3459,16 @@ class binance(Exchange, ImplicitAPI):
|
|
3453
3459
|
async def fetch_balance(self, params={}) -> Balances:
|
3454
3460
|
"""
|
3455
3461
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
3456
|
-
|
3457
|
-
|
3458
|
-
|
3459
|
-
|
3460
|
-
|
3461
|
-
|
3462
|
-
|
3463
|
-
|
3462
|
+
|
3463
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-information-user_data # spot
|
3464
|
+
https://developers.binance.com/docs/margin_trading/account/Query-Cross-Margin-Account-Details # cross margin
|
3465
|
+
https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Account-Info # isolated margin
|
3466
|
+
https://developers.binance.com/docs/wallet/asset/funding-wallet # funding
|
3467
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2 # swap
|
3468
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Futures-Account-Balance # future
|
3469
|
+
https://developers.binance.com/docs/derivatives/option/account/Option-Account-Information # option
|
3470
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Balance # portfolio margin
|
3471
|
+
|
3464
3472
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3465
3473
|
:param str [params.type]: 'future', 'delivery', 'savings', 'funding', or 'spot' or 'papi'
|
3466
3474
|
:param str [params.marginMode]: 'cross' or 'isolated', for margin trading, uses self.options.defaultMarginMode if not passed, defaults to None/None/None
|
@@ -3709,10 +3717,12 @@ class binance(Exchange, ImplicitAPI):
|
|
3709
3717
|
async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
3710
3718
|
"""
|
3711
3719
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
3712
|
-
|
3713
|
-
|
3714
|
-
|
3715
|
-
|
3720
|
+
|
3721
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#order-book # spot
|
3722
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book # swap
|
3723
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Order-Book # future
|
3724
|
+
https://developers.binance.com/docs/derivatives/option/market-data/Order-Book # option
|
3725
|
+
|
3716
3726
|
:param str symbol: unified symbol of the market to fetch the order book for
|
3717
3727
|
:param int [limit]: the maximum amount of order book entries to return
|
3718
3728
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -3939,7 +3949,9 @@ class binance(Exchange, ImplicitAPI):
|
|
3939
3949
|
async def fetch_status(self, params={}):
|
3940
3950
|
"""
|
3941
3951
|
the latest known information on the availability of the exchange API
|
3942
|
-
|
3952
|
+
|
3953
|
+
https://developers.binance.com/docs/wallet/others/system-status
|
3954
|
+
|
3943
3955
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3944
3956
|
:returns dict: a `status structure <https://docs.ccxt.com/#/?id=exchange-status-structure>`
|
3945
3957
|
"""
|
@@ -3962,11 +3974,13 @@ class binance(Exchange, ImplicitAPI):
|
|
3962
3974
|
async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
3963
3975
|
"""
|
3964
3976
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
3965
|
-
|
3966
|
-
|
3967
|
-
|
3968
|
-
|
3969
|
-
|
3977
|
+
|
3978
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics # spot
|
3979
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#rolling-window-price-change-statistics # spot
|
3980
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics # swap
|
3981
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics # future
|
3982
|
+
https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics # option
|
3983
|
+
|
3970
3984
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
3971
3985
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3972
3986
|
:param boolean [params.rolling]:(spot only) default False, if True, uses the rolling 24 hour ticker endpoint /api/v3/ticker
|
@@ -3999,9 +4013,11 @@ class binance(Exchange, ImplicitAPI):
|
|
3999
4013
|
async def fetch_bids_asks(self, symbols: Strings = None, params={}):
|
4000
4014
|
"""
|
4001
4015
|
fetches the bid and ask price and volume for multiple markets
|
4002
|
-
|
4003
|
-
|
4004
|
-
|
4016
|
+
|
4017
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-order-book-ticker # spot
|
4018
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker # swap
|
4019
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Order-Book-Ticker # future
|
4020
|
+
|
4005
4021
|
:param str[]|None symbols: unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
|
4006
4022
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4007
4023
|
:param str [params.subType]: "linear" or "inverse"
|
@@ -4031,9 +4047,11 @@ class binance(Exchange, ImplicitAPI):
|
|
4031
4047
|
async def fetch_last_prices(self, symbols: Strings = None, params={}):
|
4032
4048
|
"""
|
4033
4049
|
fetches the last price for multiple markets
|
4034
|
-
|
4035
|
-
|
4036
|
-
|
4050
|
+
|
4051
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-price-ticker # spot
|
4052
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker # swap
|
4053
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Price-Ticker # future
|
4054
|
+
|
4037
4055
|
:param str[]|None symbols: unified symbols of the markets to fetch the last prices
|
4038
4056
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4039
4057
|
:param str [params.subType]: "linear" or "inverse"
|
@@ -4130,10 +4148,12 @@ class binance(Exchange, ImplicitAPI):
|
|
4130
4148
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
4131
4149
|
"""
|
4132
4150
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
4133
|
-
|
4134
|
-
|
4135
|
-
|
4136
|
-
|
4151
|
+
|
4152
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics # spot
|
4153
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics # swap
|
4154
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics # future
|
4155
|
+
https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics # option
|
4156
|
+
|
4137
4157
|
:param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
4138
4158
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4139
4159
|
:param str [params.subType]: "linear" or "inverse"
|
@@ -4166,8 +4186,10 @@ class binance(Exchange, ImplicitAPI):
|
|
4166
4186
|
async def fetch_mark_price(self, symbol: str, params={}) -> Ticker:
|
4167
4187
|
"""
|
4168
4188
|
fetches mark price for the market
|
4169
|
-
|
4170
|
-
|
4189
|
+
|
4190
|
+
https://binance-docs.github.io/apidocs/futures/en/#mark-price
|
4191
|
+
https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
|
4192
|
+
|
4171
4193
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
4172
4194
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4173
4195
|
:param str [params.subType]: "linear" or "inverse"
|
@@ -4196,8 +4218,10 @@ class binance(Exchange, ImplicitAPI):
|
|
4196
4218
|
async def fetch_mark_prices(self, symbols: Strings = None, params={}) -> Tickers:
|
4197
4219
|
"""
|
4198
4220
|
fetches mark prices for multiple markets
|
4199
|
-
|
4200
|
-
|
4221
|
+
|
4222
|
+
https://binance-docs.github.io/apidocs/futures/en/#mark-price
|
4223
|
+
https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
|
4224
|
+
|
4201
4225
|
:param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
4202
4226
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4203
4227
|
:param str [params.subType]: "linear" or "inverse"
|
@@ -4285,16 +4309,18 @@ class binance(Exchange, ImplicitAPI):
|
|
4285
4309
|
async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
4286
4310
|
"""
|
4287
4311
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
4288
|
-
|
4289
|
-
|
4290
|
-
|
4291
|
-
|
4292
|
-
|
4293
|
-
|
4294
|
-
|
4295
|
-
|
4296
|
-
|
4297
|
-
|
4312
|
+
|
4313
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#klinecandlestick-data
|
4314
|
+
https://developers.binance.com/docs/derivatives/option/market-data/Kline-Candlestick-Data
|
4315
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data
|
4316
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data
|
4317
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data
|
4318
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data
|
4319
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Kline-Candlestick-Data
|
4320
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-Kline-Candlestick-Data
|
4321
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Mark-Price-Kline-Candlestick-Data
|
4322
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Premium-Index-Kline-Data
|
4323
|
+
|
4298
4324
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
4299
4325
|
:param str timeframe: the length of time each candle represents
|
4300
4326
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
@@ -4658,19 +4684,23 @@ class binance(Exchange, ImplicitAPI):
|
|
4658
4684
|
async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
4659
4685
|
"""
|
4660
4686
|
get the list of most recent trades for a particular symbol
|
4661
|
-
|
4662
|
-
|
4663
|
-
|
4664
|
-
|
4665
|
-
|
4666
|
-
|
4667
|
-
|
4668
|
-
|
4669
|
-
|
4670
|
-
|
4671
|
-
|
4672
|
-
|
4673
|
-
|
4687
|
+
Default fetchTradesMethod
|
4688
|
+
|
4689
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#compressedaggregate-trades-list # publicGetAggTrades(spot)
|
4690
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List # fapiPublicGetAggTrades(swap)
|
4691
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Compressed-Aggregate-Trades-List # dapiPublicGetAggTrades(future)
|
4692
|
+
https://developers.binance.com/docs/derivatives/option/market-data/Recent-Trades-List # eapiPublicGetTrades(option)
|
4693
|
+
|
4694
|
+
Other fetchTradesMethod
|
4695
|
+
|
4696
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#recent-trades-list # publicGetTrades(spot)
|
4697
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List # fapiPublicGetTrades(swap)
|
4698
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Recent-Trades-List # dapiPublicGetTrades(future)
|
4699
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#old-trade-lookup # publicGetHistoricalTrades(spot)
|
4700
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup # fapiPublicGetHistoricalTrades(swap)
|
4701
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Old-Trades-Lookup # dapiPublicGetHistoricalTrades(future)
|
4702
|
+
https://developers.binance.com/docs/derivatives/option/market-data/Old-Trades-Lookup # eapiPublicGetHistoricalTrades(option)
|
4703
|
+
|
4674
4704
|
:param str symbol: unified symbol of the market to fetch trades for
|
4675
4705
|
:param int [since]: only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades'
|
4676
4706
|
:param int [limit]: default 500, max 1000
|
@@ -4678,8 +4708,8 @@ class binance(Exchange, ImplicitAPI):
|
|
4678
4708
|
:param int [params.until]: only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades'
|
4679
4709
|
:param int [params.fetchTradesMethod]: 'publicGetAggTrades'(spot default), 'fapiPublicGetAggTrades'(swap default), 'dapiPublicGetAggTrades'(future default), 'eapiPublicGetTrades'(option default), 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', 'publicGetHistoricalTrades', 'fapiPublicGetHistoricalTrades', 'dapiPublicGetHistoricalTrades', 'eapiPublicGetHistoricalTrades'
|
4680
4710
|
: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)
|
4681
|
-
|
4682
|
-
|
4711
|
+
|
4712
|
+
EXCHANGE SPECIFIC PARAMETERS
|
4683
4713
|
:param int [params.fromId]: trade id to fetch from, default gets most recent trades, not used when fetchTradesMethod is 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', or 'eapiPublicGetTrades'
|
4684
4714
|
:returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
|
4685
4715
|
"""
|
@@ -4790,17 +4820,19 @@ class binance(Exchange, ImplicitAPI):
|
|
4790
4820
|
|
4791
4821
|
async def edit_spot_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
4792
4822
|
"""
|
4793
|
-
|
4823
|
+
@ignore
|
4794
4824
|
edit a trade order
|
4795
|
-
|
4825
|
+
|
4826
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
|
4827
|
+
|
4796
4828
|
:param str id: cancel order id
|
4797
4829
|
:param str symbol: unified symbol of the market to create an order in
|
4798
4830
|
:param str type: 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP'
|
4799
4831
|
:param str side: 'buy' or 'sell'
|
4800
4832
|
:param float amount: how much of currency you want to trade in units of base currency
|
4801
4833
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
4802
|
-
:param str [params.marginMode]: 'cross' or 'isolated', for spot margin trading
|
4803
4834
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4835
|
+
:param str [params.marginMode]: 'cross' or 'isolated', for spot margin trading
|
4804
4836
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
4805
4837
|
"""
|
4806
4838
|
await self.load_markets()
|
@@ -4853,7 +4885,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4853
4885
|
|
4854
4886
|
def edit_spot_order_request(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
4855
4887
|
"""
|
4856
|
-
|
4888
|
+
@ignore
|
4857
4889
|
helper function to build request for editSpotOrder
|
4858
4890
|
:param str id: order id to be edited
|
4859
4891
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -4977,8 +5009,10 @@ class binance(Exchange, ImplicitAPI):
|
|
4977
5009
|
async def edit_contract_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
4978
5010
|
"""
|
4979
5011
|
edit a trade order
|
4980
|
-
|
4981
|
-
|
5012
|
+
|
5013
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
5014
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
5015
|
+
|
4982
5016
|
:param str id: cancel order id
|
4983
5017
|
:param str symbol: unified symbol of the market to create an order in
|
4984
5018
|
:param str type: 'market' or 'limit'
|
@@ -5028,9 +5062,11 @@ class binance(Exchange, ImplicitAPI):
|
|
5028
5062
|
async def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
5029
5063
|
"""
|
5030
5064
|
edit a trade order
|
5031
|
-
|
5032
|
-
|
5033
|
-
|
5065
|
+
|
5066
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
|
5067
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
5068
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
5069
|
+
|
5034
5070
|
:param str id: cancel order id
|
5035
5071
|
:param str symbol: unified symbol of the market to create an order in
|
5036
5072
|
:param str type: 'market' or 'limit'
|
@@ -5624,10 +5660,13 @@ class binance(Exchange, ImplicitAPI):
|
|
5624
5660
|
async def create_orders(self, orders: List[OrderRequest], params={}):
|
5625
5661
|
"""
|
5626
5662
|
*contract only* create a list of trade orders
|
5627
|
-
|
5628
|
-
|
5629
|
-
|
5663
|
+
|
5664
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Place-Multiple-Orders
|
5665
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders
|
5666
|
+
https://developers.binance.com/docs/derivatives/option/trade/Place-Multiple-Orders
|
5667
|
+
|
5630
5668
|
: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
|
5669
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5631
5670
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
5632
5671
|
"""
|
5633
5672
|
await self.load_markets()
|
@@ -5698,18 +5737,20 @@ class binance(Exchange, ImplicitAPI):
|
|
5698
5737
|
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
5699
5738
|
"""
|
5700
5739
|
create a trade order
|
5701
|
-
|
5702
|
-
|
5703
|
-
|
5704
|
-
|
5705
|
-
|
5706
|
-
|
5707
|
-
|
5708
|
-
|
5709
|
-
|
5710
|
-
|
5711
|
-
|
5712
|
-
|
5740
|
+
|
5741
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
5742
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-trade
|
5743
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order
|
5744
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/New-Order
|
5745
|
+
https://developers.binance.com/docs/derivatives/option/trade/New-Order
|
5746
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#sor
|
5747
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-using-sor-trade
|
5748
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Order
|
5749
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order
|
5750
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order
|
5751
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order
|
5752
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Conditional-Order
|
5753
|
+
|
5713
5754
|
:param str symbol: unified symbol of the market to create an order in
|
5714
5755
|
:param str type: 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP'
|
5715
5756
|
:param str side: 'buy' or 'sell'
|
@@ -5790,7 +5831,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5790
5831
|
|
5791
5832
|
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
5792
5833
|
"""
|
5793
|
-
|
5834
|
+
@ignore
|
5794
5835
|
helper function to build the request
|
5795
5836
|
:param str symbol: unified symbol of the market to create an order in
|
5796
5837
|
:param str type: 'market' or 'limit'
|
@@ -6039,7 +6080,9 @@ class binance(Exchange, ImplicitAPI):
|
|
6039
6080
|
async def create_market_order_with_cost(self, symbol: str, side: OrderSide, cost: float, params={}):
|
6040
6081
|
"""
|
6041
6082
|
create a market order by providing the symbol, side and cost
|
6042
|
-
|
6083
|
+
|
6084
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
6085
|
+
|
6043
6086
|
:param str symbol: unified symbol of the market to create an order in
|
6044
6087
|
:param str side: 'buy' or 'sell'
|
6045
6088
|
:param float cost: how much you want to trade in units of the quote currency
|
@@ -6056,7 +6099,9 @@ class binance(Exchange, ImplicitAPI):
|
|
6056
6099
|
async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
6057
6100
|
"""
|
6058
6101
|
create a market buy order by providing the symbol and cost
|
6059
|
-
|
6102
|
+
|
6103
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
6104
|
+
|
6060
6105
|
:param str symbol: unified symbol of the market to create an order in
|
6061
6106
|
:param float cost: how much you want to trade in units of the quote currency
|
6062
6107
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6072,7 +6117,9 @@ class binance(Exchange, ImplicitAPI):
|
|
6072
6117
|
async def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
6073
6118
|
"""
|
6074
6119
|
create a market sell order by providing the symbol and cost
|
6075
|
-
|
6120
|
+
|
6121
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
6122
|
+
|
6076
6123
|
:param str symbol: unified symbol of the market to create an order in
|
6077
6124
|
:param float cost: how much you want to trade in units of the quote currency
|
6078
6125
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6088,13 +6135,15 @@ class binance(Exchange, ImplicitAPI):
|
|
6088
6135
|
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
6089
6136
|
"""
|
6090
6137
|
fetches information on an order made by the user
|
6091
|
-
|
6092
|
-
|
6093
|
-
|
6094
|
-
|
6095
|
-
|
6096
|
-
|
6097
|
-
|
6138
|
+
|
6139
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-order-user_data
|
6140
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order
|
6141
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Order
|
6142
|
+
https://developers.binance.com/docs/derivatives/option/trade/Query-Single-Order
|
6143
|
+
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Order
|
6144
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order
|
6145
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Order
|
6146
|
+
|
6098
6147
|
:param str id: the order id
|
6099
6148
|
:param str symbol: unified symbol of the market the order was made in
|
6100
6149
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6151,15 +6200,17 @@ class binance(Exchange, ImplicitAPI):
|
|
6151
6200
|
async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
6152
6201
|
"""
|
6153
6202
|
fetches information on multiple orders made by the user
|
6154
|
-
|
6155
|
-
|
6156
|
-
|
6157
|
-
|
6158
|
-
|
6159
|
-
|
6160
|
-
|
6161
|
-
|
6162
|
-
|
6203
|
+
|
6204
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
6205
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
6206
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
6207
|
+
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
6208
|
+
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
6209
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
6210
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
6211
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
6212
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
6213
|
+
|
6163
6214
|
:param str symbol: unified market symbol of the market orders were made in
|
6164
6215
|
:param int [since]: the earliest time in ms to fetch orders for
|
6165
6216
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -6408,15 +6459,17 @@ class binance(Exchange, ImplicitAPI):
|
|
6408
6459
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
6409
6460
|
"""
|
6410
6461
|
fetch all unfilled currently open orders
|
6411
|
-
|
6412
|
-
|
6413
|
-
|
6414
|
-
|
6415
|
-
|
6416
|
-
|
6417
|
-
|
6418
|
-
|
6419
|
-
|
6462
|
+
|
6463
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#current-open-orders-user_data
|
6464
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders
|
6465
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Current-All-Open-Orders
|
6466
|
+
https://developers.binance.com/docs/derivatives/option/trade/Query-Current-Open-Option-Orders
|
6467
|
+
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Open-Orders
|
6468
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders
|
6469
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Conditional-Orders
|
6470
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders
|
6471
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Conditional-Orders
|
6472
|
+
|
6420
6473
|
:param str symbol: unified market symbol
|
6421
6474
|
:param int [since]: the earliest time in ms to fetch open orders for
|
6422
6475
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
@@ -6489,12 +6542,14 @@ class binance(Exchange, ImplicitAPI):
|
|
6489
6542
|
async def fetch_open_order(self, id: str, symbol: Str = None, params={}):
|
6490
6543
|
"""
|
6491
6544
|
fetch an open order by the id
|
6492
|
-
|
6493
|
-
|
6494
|
-
|
6495
|
-
|
6496
|
-
|
6497
|
-
|
6545
|
+
|
6546
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order
|
6547
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Current-Open-Order
|
6548
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order
|
6549
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order
|
6550
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order
|
6551
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order
|
6552
|
+
|
6498
6553
|
:param str id: order id
|
6499
6554
|
:param str symbol: unified market symbol
|
6500
6555
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6690,15 +6745,17 @@ class binance(Exchange, ImplicitAPI):
|
|
6690
6745
|
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
6691
6746
|
"""
|
6692
6747
|
fetches information on multiple closed orders made by the user
|
6693
|
-
|
6694
|
-
|
6695
|
-
|
6696
|
-
|
6697
|
-
|
6698
|
-
|
6699
|
-
|
6700
|
-
|
6701
|
-
|
6748
|
+
|
6749
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
6750
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
6751
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
6752
|
+
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
6753
|
+
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
6754
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
6755
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
6756
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
6757
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
6758
|
+
|
6702
6759
|
:param str symbol: unified market symbol of the market orders were made in
|
6703
6760
|
:param int [since]: the earliest time in ms to fetch orders for
|
6704
6761
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -6717,15 +6774,17 @@ class binance(Exchange, ImplicitAPI):
|
|
6717
6774
|
async def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
6718
6775
|
"""
|
6719
6776
|
fetches information on multiple canceled orders made by the user
|
6720
|
-
|
6721
|
-
|
6722
|
-
|
6723
|
-
|
6724
|
-
|
6725
|
-
|
6726
|
-
|
6727
|
-
|
6728
|
-
|
6777
|
+
|
6778
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
6779
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
6780
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
6781
|
+
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
6782
|
+
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
6783
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
6784
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
6785
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
6786
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
6787
|
+
|
6729
6788
|
:param str symbol: unified market symbol of the market the orders were made in
|
6730
6789
|
:param int [since]: the earliest time in ms to fetch orders for
|
6731
6790
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -6744,15 +6803,17 @@ class binance(Exchange, ImplicitAPI):
|
|
6744
6803
|
async def fetch_canceled_and_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
6745
6804
|
"""
|
6746
6805
|
fetches information on multiple canceled orders made by the user
|
6747
|
-
|
6748
|
-
|
6749
|
-
|
6750
|
-
|
6751
|
-
|
6752
|
-
|
6753
|
-
|
6754
|
-
|
6755
|
-
|
6806
|
+
|
6807
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
6808
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
6809
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
6810
|
+
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
6811
|
+
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
6812
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
6813
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
6814
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
6815
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
6816
|
+
|
6756
6817
|
:param str symbol: unified market symbol of the market the orders were made in
|
6757
6818
|
:param int [since]: the earliest time in ms to fetch orders for
|
6758
6819
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -6774,16 +6835,18 @@ class binance(Exchange, ImplicitAPI):
|
|
6774
6835
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
6775
6836
|
"""
|
6776
6837
|
cancels an open order
|
6777
|
-
|
6778
|
-
|
6779
|
-
|
6780
|
-
|
6781
|
-
|
6782
|
-
|
6783
|
-
|
6784
|
-
|
6785
|
-
|
6786
|
-
|
6838
|
+
|
6839
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-order-trade
|
6840
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order
|
6841
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Order
|
6842
|
+
https://developers.binance.com/docs/derivatives/option/trade/Cancel-Option-Order
|
6843
|
+
https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-Order
|
6844
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order
|
6845
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Order
|
6846
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order
|
6847
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Conditional-Order
|
6848
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order
|
6849
|
+
|
6787
6850
|
:param str id: order id
|
6788
6851
|
:param str symbol: unified symbol of the market the order was made in
|
6789
6852
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6853,15 +6916,17 @@ class binance(Exchange, ImplicitAPI):
|
|
6853
6916
|
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
6854
6917
|
"""
|
6855
6918
|
cancel all open orders in a market
|
6856
|
-
|
6857
|
-
|
6858
|
-
|
6859
|
-
|
6860
|
-
|
6861
|
-
|
6862
|
-
|
6863
|
-
|
6864
|
-
|
6919
|
+
|
6920
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-all-open-orders-on-a-symbol-trade
|
6921
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders
|
6922
|
+
https://developers.binance.com/docs/derivatives/option/trade/Cancel-all-Option-orders-on-specific-symbol
|
6923
|
+
https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-All-Open-Orders
|
6924
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders
|
6925
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders
|
6926
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders
|
6927
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Conditional-Orders
|
6928
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-All-Open-Orders-on-a-Symbol
|
6929
|
+
|
6865
6930
|
:param str symbol: unified market symbol of the market to cancel orders in
|
6866
6931
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6867
6932
|
:param str [params.marginMode]: 'cross' or 'isolated', for spot margin trading
|
@@ -7008,13 +7073,15 @@ class binance(Exchange, ImplicitAPI):
|
|
7008
7073
|
async def cancel_orders(self, ids: List[str], symbol: Str = None, params={}):
|
7009
7074
|
"""
|
7010
7075
|
cancel multiple orders
|
7011
|
-
|
7012
|
-
|
7076
|
+
|
7077
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders
|
7078
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Multiple-Orders
|
7079
|
+
|
7013
7080
|
:param str[] ids: order ids
|
7014
7081
|
:param str [symbol]: unified market symbol
|
7015
7082
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7016
|
-
|
7017
|
-
|
7083
|
+
|
7084
|
+
EXCHANGE SPECIFIC PARAMETERS
|
7018
7085
|
:param str[] [params.origClientOrderIdList]: max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma
|
7019
7086
|
:param int[] [params.recvWindow]:
|
7020
7087
|
:returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -7074,10 +7141,12 @@ class binance(Exchange, ImplicitAPI):
|
|
7074
7141
|
async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
7075
7142
|
"""
|
7076
7143
|
fetch all the trades made from a single order
|
7077
|
-
|
7078
|
-
|
7079
|
-
|
7080
|
-
|
7144
|
+
|
7145
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
7146
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
7147
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
7148
|
+
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
7149
|
+
|
7081
7150
|
:param str id: order id
|
7082
7151
|
:param str symbol: unified market symbol
|
7083
7152
|
:param int [since]: the earliest time in ms to fetch trades for
|
@@ -7101,13 +7170,15 @@ class binance(Exchange, ImplicitAPI):
|
|
7101
7170
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
7102
7171
|
"""
|
7103
7172
|
fetch all trades made by the user
|
7104
|
-
|
7105
|
-
|
7106
|
-
|
7107
|
-
|
7108
|
-
|
7109
|
-
|
7110
|
-
|
7173
|
+
|
7174
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
7175
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
7176
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
7177
|
+
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
7178
|
+
https://developers.binance.com/docs/derivatives/option/trade/Account-Trade-List
|
7179
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Account-Trade-List
|
7180
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List
|
7181
|
+
|
7111
7182
|
:param str symbol: unified market symbol
|
7112
7183
|
:param int [since]: the earliest time in ms to fetch trades for
|
7113
7184
|
:param int [limit]: the maximum number of trades structures to retrieve
|
@@ -7312,7 +7383,9 @@ class binance(Exchange, ImplicitAPI):
|
|
7312
7383
|
async def fetch_my_dust_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
7313
7384
|
"""
|
7314
7385
|
fetch all dust trades made by the user
|
7315
|
-
|
7386
|
+
|
7387
|
+
https://developers.binance.com/docs/wallet/asset/dust-log
|
7388
|
+
|
7316
7389
|
:param str symbol: not used by binance fetchMyDustTrades()
|
7317
7390
|
:param int [since]: the earliest time in ms to fetch my dust trades for
|
7318
7391
|
:param int [limit]: the maximum number of dust trades to retrieve
|
@@ -7446,8 +7519,10 @@ class binance(Exchange, ImplicitAPI):
|
|
7446
7519
|
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
7447
7520
|
"""
|
7448
7521
|
fetch all deposits made to an account
|
7449
|
-
|
7450
|
-
|
7522
|
+
|
7523
|
+
https://developers.binance.com/docs/wallet/capital/deposite-history
|
7524
|
+
https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History
|
7525
|
+
|
7451
7526
|
:param str code: unified currency code
|
7452
7527
|
:param int [since]: the earliest time in ms to fetch deposits for
|
7453
7528
|
:param int [limit]: the maximum number of deposits structures to retrieve
|
@@ -7546,8 +7621,10 @@ class binance(Exchange, ImplicitAPI):
|
|
7546
7621
|
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
7547
7622
|
"""
|
7548
7623
|
fetch all withdrawals made from an account
|
7549
|
-
|
7550
|
-
|
7624
|
+
|
7625
|
+
https://developers.binance.com/docs/wallet/capital/withdraw-history
|
7626
|
+
https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History
|
7627
|
+
|
7551
7628
|
:param str code: unified currency code
|
7552
7629
|
:param int [since]: the earliest time in ms to fetch withdrawals for
|
7553
7630
|
:param int [limit]: the maximum number of withdrawals structures to retrieve
|
@@ -7960,7 +8037,9 @@ class binance(Exchange, ImplicitAPI):
|
|
7960
8037
|
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
7961
8038
|
"""
|
7962
8039
|
transfer currency internally between wallets on the same account
|
7963
|
-
|
8040
|
+
|
8041
|
+
https://developers.binance.com/docs/wallet/asset/user-universal-transfer
|
8042
|
+
|
7964
8043
|
:param str code: unified currency code
|
7965
8044
|
:param float amount: amount to transfer
|
7966
8045
|
:param str fromAccount: account to transfer from
|
@@ -8045,7 +8124,9 @@ class binance(Exchange, ImplicitAPI):
|
|
8045
8124
|
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]:
|
8046
8125
|
"""
|
8047
8126
|
fetch a history of internal transfers made on an account
|
8048
|
-
|
8127
|
+
|
8128
|
+
https://developers.binance.com/docs/wallet/asset/query-user-universal-transfer
|
8129
|
+
|
8049
8130
|
:param str code: unified currency code of the currency transferred
|
8050
8131
|
:param int [since]: the earliest time in ms to fetch transfers for
|
8051
8132
|
:param int [limit]: the maximum number of transfers structures to retrieve
|
@@ -8177,9 +8258,12 @@ class binance(Exchange, ImplicitAPI):
|
|
8177
8258
|
async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
|
8178
8259
|
"""
|
8179
8260
|
fetch the deposit address for a currency associated with self account
|
8180
|
-
|
8261
|
+
|
8262
|
+
https://developers.binance.com/docs/wallet/capital/deposite-address
|
8263
|
+
|
8181
8264
|
:param str code: unified currency code
|
8182
8265
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
8266
|
+
:param str [params.network]: network for fetch deposit address
|
8183
8267
|
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
8184
8268
|
"""
|
8185
8269
|
await self.load_markets()
|
@@ -8261,9 +8345,11 @@ class binance(Exchange, ImplicitAPI):
|
|
8261
8345
|
|
8262
8346
|
async def fetch_transaction_fees(self, codes: Strings = None, params={}):
|
8263
8347
|
"""
|
8264
|
-
|
8348
|
+
@deprecated
|
8265
8349
|
please use fetchDepositWithdrawFees instead
|
8266
|
-
|
8350
|
+
|
8351
|
+
https://developers.binance.com/docs/wallet/capital/all-coins-info
|
8352
|
+
|
8267
8353
|
:param str[]|None codes: not used by binance fetchTransactionFees()
|
8268
8354
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
8269
8355
|
:returns dict[]: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -8373,7 +8459,9 @@ class binance(Exchange, ImplicitAPI):
|
|
8373
8459
|
async def fetch_deposit_withdraw_fees(self, codes: Strings = None, params={}):
|
8374
8460
|
"""
|
8375
8461
|
fetch deposit and withdraw fees
|
8376
|
-
|
8462
|
+
|
8463
|
+
https://developers.binance.com/docs/wallet/capital/all-coins-info
|
8464
|
+
|
8377
8465
|
:param str[]|None codes: not used by binance fetchDepositWithdrawFees()
|
8378
8466
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
8379
8467
|
:returns dict[]: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -8493,7 +8581,9 @@ class binance(Exchange, ImplicitAPI):
|
|
8493
8581
|
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
8494
8582
|
"""
|
8495
8583
|
make a withdrawal
|
8496
|
-
|
8584
|
+
|
8585
|
+
https://developers.binance.com/docs/wallet/capital/withdraw
|
8586
|
+
|
8497
8587
|
:param str code: unified currency code
|
8498
8588
|
:param float amount: the amount to withdraw
|
8499
8589
|
:param str address: the address to withdraw to
|
@@ -8556,11 +8646,13 @@ class binance(Exchange, ImplicitAPI):
|
|
8556
8646
|
async def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
|
8557
8647
|
"""
|
8558
8648
|
fetch the trading fees for a market
|
8559
|
-
|
8560
|
-
|
8561
|
-
|
8562
|
-
|
8563
|
-
|
8649
|
+
|
8650
|
+
https://developers.binance.com/docs/wallet/asset/trade-fee
|
8651
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/User-Commission-Rate
|
8652
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/User-Commission-Rate
|
8653
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-UM
|
8654
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-CM
|
8655
|
+
|
8564
8656
|
:param str symbol: unified market symbol
|
8565
8657
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
8566
8658
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch trading fees in a portfolio margin account
|
@@ -8619,10 +8711,12 @@ class binance(Exchange, ImplicitAPI):
|
|
8619
8711
|
async def fetch_trading_fees(self, params={}) -> TradingFees:
|
8620
8712
|
"""
|
8621
8713
|
fetch the trading fees for multiple markets
|
8622
|
-
|
8623
|
-
|
8624
|
-
|
8625
|
-
|
8714
|
+
|
8715
|
+
https://developers.binance.com/docs/wallet/asset/trade-fee
|
8716
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
8717
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
8718
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config
|
8719
|
+
|
8626
8720
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
8627
8721
|
:param str [params.subType]: "linear" or "inverse"
|
8628
8722
|
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
|
@@ -8785,9 +8879,11 @@ class binance(Exchange, ImplicitAPI):
|
|
8785
8879
|
|
8786
8880
|
async def futures_transfer(self, code: str, amount, type, params={}):
|
8787
8881
|
"""
|
8788
|
-
|
8882
|
+
@ignore
|
8789
8883
|
transfer between futures account
|
8790
|
-
|
8884
|
+
|
8885
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/New-Future-Account-Transfer
|
8886
|
+
|
8791
8887
|
:param str code: unified currency code
|
8792
8888
|
:param float amount: the amount to transfer
|
8793
8889
|
:param str type: 1 - transfer from spot account to USDT-Ⓜ futures account, 2 - transfer from USDT-Ⓜ futures account to spot account, 3 - transfer from spot account to COIN-Ⓜ futures account, 4 - transfer from COIN-Ⓜ futures account to spot account
|
@@ -8815,8 +8911,10 @@ class binance(Exchange, ImplicitAPI):
|
|
8815
8911
|
async def fetch_funding_rate(self, symbol: str, params={}) -> FundingRate:
|
8816
8912
|
"""
|
8817
8913
|
fetch the current funding rate
|
8818
|
-
|
8819
|
-
|
8914
|
+
|
8915
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price
|
8916
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-and-Mark-Price
|
8917
|
+
|
8820
8918
|
:param str symbol: unified market symbol
|
8821
8919
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
8822
8920
|
:returns dict: a `funding rate structure <https://docs.ccxt.com/#/?id=funding-rate-structure>`
|
@@ -8852,8 +8950,10 @@ class binance(Exchange, ImplicitAPI):
|
|
8852
8950
|
async def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
8853
8951
|
"""
|
8854
8952
|
fetches historical funding rate prices
|
8855
|
-
|
8856
|
-
|
8953
|
+
|
8954
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-History
|
8955
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Get-Funding-Rate-History-of-Perpetual-Futures
|
8956
|
+
|
8857
8957
|
:param str symbol: unified symbol of the market to fetch the funding rate history for
|
8858
8958
|
:param int [since]: timestamp in ms of the earliest funding rate to fetch
|
8859
8959
|
:param int [limit]: the maximum amount of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>` to fetch
|
@@ -8919,8 +9019,10 @@ class binance(Exchange, ImplicitAPI):
|
|
8919
9019
|
async def fetch_funding_rates(self, symbols: Strings = None, params={}) -> FundingRates:
|
8920
9020
|
"""
|
8921
9021
|
fetch the funding rate for multiple markets
|
8922
|
-
|
8923
|
-
|
9022
|
+
|
9023
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price
|
9024
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-and-Mark-Price
|
9025
|
+
|
8924
9026
|
:param str[]|None symbols: list of unified market symbols
|
8925
9027
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
8926
9028
|
:param str [params.subType]: "linear" or "inverse"
|
@@ -9538,10 +9640,12 @@ class binance(Exchange, ImplicitAPI):
|
|
9538
9640
|
async def fetch_leverage_tiers(self, symbols: Strings = None, params={}) -> LeverageTiers:
|
9539
9641
|
"""
|
9540
9642
|
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
9541
|
-
|
9542
|
-
|
9543
|
-
|
9544
|
-
|
9643
|
+
|
9644
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Notional-and-Leverage-Brackets
|
9645
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Notional-Bracket-for-Symbol
|
9646
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/UM-Notional-and-Leverage-Brackets
|
9647
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/CM-Notional-and-Leverage-Brackets
|
9648
|
+
|
9545
9649
|
:param str[]|None symbols: list of unified market symbols
|
9546
9650
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
9547
9651
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch the leverage tiers for a portfolio margin account
|
@@ -9610,7 +9714,7 @@ class binance(Exchange, ImplicitAPI):
|
|
9610
9714
|
|
9611
9715
|
def parse_market_leverage_tiers(self, info, market: Market = None) -> List[LeverageTier]:
|
9612
9716
|
"""
|
9613
|
-
|
9717
|
+
@ignore
|
9614
9718
|
:param dict info: Exchange response for 1 market
|
9615
9719
|
:param dict market: CCXT market
|
9616
9720
|
"""
|
@@ -9638,6 +9742,7 @@ class binance(Exchange, ImplicitAPI):
|
|
9638
9742
|
bracket = brackets[j]
|
9639
9743
|
tiers.append({
|
9640
9744
|
'tier': self.safe_number(bracket, 'bracket'),
|
9745
|
+
'symbol': self.safe_symbol(marketId, market),
|
9641
9746
|
'currency': market['quote'],
|
9642
9747
|
'minNotional': self.safe_number_2(bracket, 'notionalFloor', 'qtyFloor'),
|
9643
9748
|
'maxNotional': self.safe_number_2(bracket, 'notionalCap', 'qtyCap'),
|
@@ -9650,7 +9755,9 @@ class binance(Exchange, ImplicitAPI):
|
|
9650
9755
|
async def fetch_position(self, symbol: str, params={}):
|
9651
9756
|
"""
|
9652
9757
|
fetch data on an open position
|
9653
|
-
|
9758
|
+
|
9759
|
+
https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
|
9760
|
+
|
9654
9761
|
:param str symbol: unified market symbol of the market the position is held in
|
9655
9762
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
9656
9763
|
:returns dict: a `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
@@ -9691,7 +9798,9 @@ class binance(Exchange, ImplicitAPI):
|
|
9691
9798
|
async def fetch_option_positions(self, symbols: Strings = None, params={}):
|
9692
9799
|
"""
|
9693
9800
|
fetch data on open options positions
|
9694
|
-
|
9801
|
+
|
9802
|
+
https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
|
9803
|
+
|
9695
9804
|
:param str[]|None symbols: list of unified market symbols
|
9696
9805
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
9697
9806
|
:returns dict[]: a list of `position structures <https://docs.ccxt.com/#/?id=position-structure>`
|
@@ -9799,14 +9908,17 @@ class binance(Exchange, ImplicitAPI):
|
|
9799
9908
|
async def fetch_positions(self, symbols: Strings = None, params={}):
|
9800
9909
|
"""
|
9801
9910
|
fetch all open positions
|
9802
|
-
|
9803
|
-
|
9804
|
-
|
9805
|
-
|
9806
|
-
|
9911
|
+
|
9912
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
9913
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
9914
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2
|
9915
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
|
9916
|
+
https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
|
9917
|
+
|
9807
9918
|
:param str[] [symbols]: list of unified market symbols
|
9808
9919
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
9809
|
-
:param
|
9920
|
+
:param dict [params.params]: extra parameters specific to the exchange API endpoint
|
9921
|
+
:param str [params.method]: method name to call, "positionRisk", "account" or "option", default is "positionRisk"
|
9810
9922
|
:param bool [params.useV2]: set to True if you want to use the obsolete endpoint, where some more additional fields were provided
|
9811
9923
|
:returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
9812
9924
|
"""
|
@@ -9829,13 +9941,15 @@ class binance(Exchange, ImplicitAPI):
|
|
9829
9941
|
|
9830
9942
|
async def fetch_account_positions(self, symbols: Strings = None, params={}):
|
9831
9943
|
"""
|
9832
|
-
|
9944
|
+
@ignore
|
9833
9945
|
fetch account positions
|
9834
|
-
|
9835
|
-
|
9836
|
-
|
9837
|
-
|
9838
|
-
|
9946
|
+
|
9947
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
9948
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
9949
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2
|
9950
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
|
9951
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3
|
9952
|
+
|
9839
9953
|
:param str[] [symbols]: list of unified market symbols
|
9840
9954
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
9841
9955
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch positions in a portfolio margin account
|
@@ -9948,13 +10062,15 @@ class binance(Exchange, ImplicitAPI):
|
|
9948
10062
|
|
9949
10063
|
async def fetch_positions_risk(self, symbols: Strings = None, params={}):
|
9950
10064
|
"""
|
9951
|
-
|
10065
|
+
@ignore
|
9952
10066
|
fetch positions risk
|
9953
|
-
|
9954
|
-
|
9955
|
-
|
9956
|
-
|
9957
|
-
|
10067
|
+
|
10068
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2
|
10069
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
|
10070
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-UM-Position-Information
|
10071
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-CM-Position-Information
|
10072
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3
|
10073
|
+
|
9958
10074
|
:param str[]|None symbols: list of unified market symbols
|
9959
10075
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
9960
10076
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch positions for a portfolio margin account
|
@@ -10114,10 +10230,12 @@ class binance(Exchange, ImplicitAPI):
|
|
10114
10230
|
async def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
10115
10231
|
"""
|
10116
10232
|
fetch the history of funding payments paid and received on self account
|
10117
|
-
|
10118
|
-
|
10119
|
-
|
10120
|
-
|
10233
|
+
|
10234
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History
|
10235
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Income-History
|
10236
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History
|
10237
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History
|
10238
|
+
|
10121
10239
|
:param str symbol: unified market symbol
|
10122
10240
|
:param int [since]: the earliest time in ms to fetch funding history for
|
10123
10241
|
:param int [limit]: the maximum number of funding history structures to retrieve
|
@@ -10167,10 +10285,12 @@ class binance(Exchange, ImplicitAPI):
|
|
10167
10285
|
async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
10168
10286
|
"""
|
10169
10287
|
set the level of leverage for a market
|
10170
|
-
|
10171
|
-
|
10172
|
-
|
10173
|
-
|
10288
|
+
|
10289
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Initial-Leverage
|
10290
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Initial-Leverage
|
10291
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Initial-Leverage
|
10292
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Initial-Leverage
|
10293
|
+
|
10174
10294
|
:param float leverage: the rate of leverage
|
10175
10295
|
:param str symbol: unified market symbol
|
10176
10296
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -10209,8 +10329,10 @@ class binance(Exchange, ImplicitAPI):
|
|
10209
10329
|
async def set_margin_mode(self, marginMode: str, symbol: Str = None, params={}):
|
10210
10330
|
"""
|
10211
10331
|
set margin mode to 'cross' or 'isolated'
|
10212
|
-
|
10213
|
-
|
10332
|
+
|
10333
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Margin-Type
|
10334
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Margin-Type
|
10335
|
+
|
10214
10336
|
:param str marginMode: 'cross' or 'isolated'
|
10215
10337
|
:param str symbol: unified market symbol
|
10216
10338
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -10263,10 +10385,12 @@ class binance(Exchange, ImplicitAPI):
|
|
10263
10385
|
async def set_position_mode(self, hedged: bool, symbol: Str = None, params={}):
|
10264
10386
|
"""
|
10265
10387
|
set hedged to True or False for a market
|
10266
|
-
|
10267
|
-
|
10268
|
-
|
10269
|
-
|
10388
|
+
|
10389
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Position-Mode
|
10390
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Position-Mode
|
10391
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Current-Position-Mode
|
10392
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Current-Position-Mode
|
10393
|
+
|
10270
10394
|
:param bool hedged: set to True to use dualSidePosition
|
10271
10395
|
:param str symbol: not used by binance setPositionMode()
|
10272
10396
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -10313,11 +10437,13 @@ class binance(Exchange, ImplicitAPI):
|
|
10313
10437
|
async def fetch_leverages(self, symbols: Strings = None, params={}) -> Leverages:
|
10314
10438
|
"""
|
10315
10439
|
fetch the set leverage for all markets
|
10316
|
-
|
10317
|
-
|
10318
|
-
|
10319
|
-
|
10320
|
-
|
10440
|
+
|
10441
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
10442
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
10443
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail
|
10444
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Account-Detail
|
10445
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config
|
10446
|
+
|
10321
10447
|
:param str[] [symbols]: a list of unified market symbols
|
10322
10448
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
10323
10449
|
:param str [params.subType]: "linear" or "inverse"
|
@@ -10380,7 +10506,9 @@ class binance(Exchange, ImplicitAPI):
|
|
10380
10506
|
async def fetch_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
10381
10507
|
"""
|
10382
10508
|
fetches historical settlement records
|
10383
|
-
|
10509
|
+
|
10510
|
+
https://developers.binance.com/docs/derivatives/option/market-data/Historical-Exercise-Records
|
10511
|
+
|
10384
10512
|
:param str symbol: unified market symbol of the settlement history
|
10385
10513
|
:param int [since]: timestamp in ms
|
10386
10514
|
:param int [limit]: number of records, default 100, max 100
|
@@ -10420,7 +10548,9 @@ class binance(Exchange, ImplicitAPI):
|
|
10420
10548
|
async def fetch_my_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
10421
10549
|
"""
|
10422
10550
|
fetches historical settlement records of the user
|
10423
|
-
|
10551
|
+
|
10552
|
+
https://developers.binance.com/docs/derivatives/option/trade/User-Exercise-Record
|
10553
|
+
|
10424
10554
|
:param str symbol: unified market symbol of the settlement history
|
10425
10555
|
:param int [since]: timestamp in ms
|
10426
10556
|
:param int [limit]: number of records
|
@@ -10549,7 +10679,9 @@ class binance(Exchange, ImplicitAPI):
|
|
10549
10679
|
async def fetch_ledger_entry(self, id: str, code: Str = None, params={}) -> LedgerEntry:
|
10550
10680
|
"""
|
10551
10681
|
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
10552
|
-
|
10682
|
+
|
10683
|
+
https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow
|
10684
|
+
|
10553
10685
|
:param str id: the identification number of the ledger entry
|
10554
10686
|
:param str code: unified currency code
|
10555
10687
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -10584,11 +10716,13 @@ class binance(Exchange, ImplicitAPI):
|
|
10584
10716
|
async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
10585
10717
|
"""
|
10586
10718
|
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
10587
|
-
|
10588
|
-
|
10589
|
-
|
10590
|
-
|
10591
|
-
|
10719
|
+
|
10720
|
+
https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow
|
10721
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History
|
10722
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Income-History
|
10723
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History
|
10724
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History
|
10725
|
+
|
10592
10726
|
:param str [code]: unified currency code
|
10593
10727
|
:param int [since]: timestamp in ms of the earliest ledger entry
|
10594
10728
|
:param int [limit]: max number of ledger entries to return
|
@@ -11034,8 +11168,10 @@ class binance(Exchange, ImplicitAPI):
|
|
11034
11168
|
async def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
11035
11169
|
"""
|
11036
11170
|
remove margin from a position
|
11037
|
-
|
11038
|
-
|
11171
|
+
|
11172
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin
|
11173
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Isolated-Position-Margin
|
11174
|
+
|
11039
11175
|
:param str symbol: unified market symbol
|
11040
11176
|
:param float amount: the amount of margin to remove
|
11041
11177
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -11046,8 +11182,10 @@ class binance(Exchange, ImplicitAPI):
|
|
11046
11182
|
async def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
11047
11183
|
"""
|
11048
11184
|
add margin
|
11049
|
-
|
11050
|
-
|
11185
|
+
|
11186
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin
|
11187
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Isolated-Position-Margin
|
11188
|
+
|
11051
11189
|
:param str symbol: unified market symbol
|
11052
11190
|
:param float amount: amount of margin to add
|
11053
11191
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -11058,7 +11196,9 @@ class binance(Exchange, ImplicitAPI):
|
|
11058
11196
|
async def fetch_cross_borrow_rate(self, code: str, params={}) -> CrossBorrowRate:
|
11059
11197
|
"""
|
11060
11198
|
fetch the rate of interest to borrow a currency for margin trading
|
11061
|
-
|
11199
|
+
|
11200
|
+
https://developers.binance.com/docs/margin_trading/borrow-and-repay/Query-Margin-Interest-Rate-History
|
11201
|
+
|
11062
11202
|
:param str code: unified currency code
|
11063
11203
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
11064
11204
|
:returns dict: a `borrow rate structure <https://docs.ccxt.com/#/?id=borrow-rate-structure>`
|
@@ -11086,11 +11226,13 @@ class binance(Exchange, ImplicitAPI):
|
|
11086
11226
|
async def fetch_isolated_borrow_rate(self, symbol: str, params={}) -> IsolatedBorrowRate:
|
11087
11227
|
"""
|
11088
11228
|
fetch the rate of interest to borrow a currency for margin trading
|
11089
|
-
|
11229
|
+
|
11230
|
+
https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Fee-Data
|
11231
|
+
|
11090
11232
|
:param str symbol: unified market symbol
|
11091
11233
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
11092
|
-
|
11093
|
-
|
11234
|
+
|
11235
|
+
EXCHANGE SPECIFIC PARAMETERS
|
11094
11236
|
:param dict [params.vipLevel]: user's current specific margin data will be returned if viplevel is omitted
|
11095
11237
|
:returns dict: an `isolated borrow rate structure <https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure>`
|
11096
11238
|
"""
|
@@ -11103,11 +11245,13 @@ class binance(Exchange, ImplicitAPI):
|
|
11103
11245
|
async def fetch_isolated_borrow_rates(self, params={}) -> IsolatedBorrowRates:
|
11104
11246
|
"""
|
11105
11247
|
fetch the borrow interest rates of all currencies
|
11106
|
-
|
11248
|
+
|
11249
|
+
https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Fee-Data
|
11250
|
+
|
11107
11251
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
11108
11252
|
:param dict [params.symbol]: unified market symbol
|
11109
|
-
|
11110
|
-
|
11253
|
+
|
11254
|
+
EXCHANGE SPECIFIC PARAMETERS
|
11111
11255
|
:param dict [params.vipLevel]: user's current specific margin data will be returned if viplevel is omitted
|
11112
11256
|
:returns dict: a `borrow rate structure <https://docs.ccxt.com/#/?id=borrow-rate-structure>`
|
11113
11257
|
"""
|
@@ -11145,7 +11289,9 @@ class binance(Exchange, ImplicitAPI):
|
|
11145
11289
|
async def fetch_borrow_rate_history(self, code: str, since: Int = None, limit: Int = None, params={}):
|
11146
11290
|
"""
|
11147
11291
|
retrieves a history of a currencies borrow interest rate at specific time slots
|
11148
|
-
|
11292
|
+
|
11293
|
+
https://developers.binance.com/docs/margin_trading/borrow-and-repay/Query-Margin-Interest-Rate-History
|
11294
|
+
|
11149
11295
|
:param str code: unified currency code
|
11150
11296
|
:param int [since]: timestamp for the earliest borrow rate
|
11151
11297
|
:param int [limit]: the maximum number of `borrow rate structures <https://docs.ccxt.com/#/?id=borrow-rate-structure>` to retrieve
|
@@ -11241,7 +11387,9 @@ class binance(Exchange, ImplicitAPI):
|
|
11241
11387
|
async def create_gift_code(self, code: str, amount, params={}):
|
11242
11388
|
"""
|
11243
11389
|
create gift code
|
11244
|
-
|
11390
|
+
|
11391
|
+
https://developers.binance.com/docs/gift_card/market-data/Create-a-single-token-gift-card
|
11392
|
+
|
11245
11393
|
:param str code: gift code
|
11246
11394
|
:param float amount: amount of currency for the gift
|
11247
11395
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -11277,7 +11425,9 @@ class binance(Exchange, ImplicitAPI):
|
|
11277
11425
|
async def redeem_gift_code(self, giftcardCode, params={}):
|
11278
11426
|
"""
|
11279
11427
|
redeem gift code
|
11280
|
-
|
11428
|
+
|
11429
|
+
https://developers.binance.com/docs/gift_card/market-data/Redeem-a-Binance-Gift-Card
|
11430
|
+
|
11281
11431
|
:param str giftcardCode:
|
11282
11432
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
11283
11433
|
:returns dict: response from the exchange
|
@@ -11302,7 +11452,9 @@ class binance(Exchange, ImplicitAPI):
|
|
11302
11452
|
async def verify_gift_code(self, id: str, params={}):
|
11303
11453
|
"""
|
11304
11454
|
verify gift code
|
11305
|
-
|
11455
|
+
|
11456
|
+
https://developers.binance.com/docs/gift_card/market-data/Verify-Binance-Gift-Card-by-Gift-Card-Number
|
11457
|
+
|
11306
11458
|
:param str id: reference number id
|
11307
11459
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
11308
11460
|
:returns dict: response from the exchange
|
@@ -11324,8 +11476,10 @@ class binance(Exchange, ImplicitAPI):
|
|
11324
11476
|
async def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[BorrowInterest]:
|
11325
11477
|
"""
|
11326
11478
|
fetch the interest owed by the user for borrowing currency for margin trading
|
11327
|
-
|
11328
|
-
|
11479
|
+
|
11480
|
+
https://developers.binance.com/docs/margin_trading/borrow-and-repay/Get-Interest-History
|
11481
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Margin-BorrowLoan-Interest-History
|
11482
|
+
|
11329
11483
|
:param str [code]: unified currency code
|
11330
11484
|
:param str [symbol]: unified market symbol when fetch interest in isolated markets
|
11331
11485
|
:param int [since]: the earliest time in ms to fetch borrrow interest for
|
@@ -11414,9 +11568,11 @@ class binance(Exchange, ImplicitAPI):
|
|
11414
11568
|
async def repay_cross_margin(self, code: str, amount, params={}):
|
11415
11569
|
"""
|
11416
11570
|
repay borrowed margin and interest
|
11417
|
-
|
11418
|
-
|
11419
|
-
|
11571
|
+
|
11572
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay
|
11573
|
+
https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
11574
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay-Debt
|
11575
|
+
|
11420
11576
|
:param str code: unified currency code of the currency to repay
|
11421
11577
|
:param float amount: the amount to repay
|
11422
11578
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -11471,7 +11627,9 @@ class binance(Exchange, ImplicitAPI):
|
|
11471
11627
|
async def repay_isolated_margin(self, symbol: str, code: str, amount, params={}):
|
11472
11628
|
"""
|
11473
11629
|
repay borrowed margin and interest
|
11474
|
-
|
11630
|
+
|
11631
|
+
https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
11632
|
+
|
11475
11633
|
:param str symbol: unified market symbol, required for isolated margin
|
11476
11634
|
:param str code: unified currency code of the currency to repay
|
11477
11635
|
:param float amount: the amount to repay
|
@@ -11500,8 +11658,10 @@ class binance(Exchange, ImplicitAPI):
|
|
11500
11658
|
async def borrow_cross_margin(self, code: str, amount: float, params={}):
|
11501
11659
|
"""
|
11502
11660
|
create a loan to borrow margin
|
11503
|
-
|
11504
|
-
|
11661
|
+
|
11662
|
+
https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
11663
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Borrow
|
11664
|
+
|
11505
11665
|
:param str code: unified currency code of the currency to borrow
|
11506
11666
|
:param float amount: the amount to borrow
|
11507
11667
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -11534,7 +11694,9 @@ class binance(Exchange, ImplicitAPI):
|
|
11534
11694
|
async def borrow_isolated_margin(self, symbol: str, code: str, amount: float, params={}):
|
11535
11695
|
"""
|
11536
11696
|
create a loan to borrow margin
|
11537
|
-
|
11697
|
+
|
11698
|
+
https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
11699
|
+
|
11538
11700
|
:param str symbol: unified market symbol, required for isolated margin
|
11539
11701
|
:param str code: unified currency code of the currency to borrow
|
11540
11702
|
:param float amount: the amount to borrow
|
@@ -11592,8 +11754,10 @@ class binance(Exchange, ImplicitAPI):
|
|
11592
11754
|
async def fetch_open_interest_history(self, symbol: str, timeframe='5m', since: Int = None, limit: Int = None, params={}):
|
11593
11755
|
"""
|
11594
11756
|
Retrieves the open interest history of a currency
|
11595
|
-
|
11596
|
-
|
11757
|
+
|
11758
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest-Statistics
|
11759
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Open-Interest-Statistics
|
11760
|
+
|
11597
11761
|
:param str symbol: Unified CCXT market symbol
|
11598
11762
|
:param str timeframe: "5m","15m","30m","1h","2h","4h","6h","12h", or "1d"
|
11599
11763
|
:param int [since]: the time(ms) of the earliest record to retrieve unix timestamp
|
@@ -11653,9 +11817,11 @@ class binance(Exchange, ImplicitAPI):
|
|
11653
11817
|
async def fetch_open_interest(self, symbol: str, params={}):
|
11654
11818
|
"""
|
11655
11819
|
retrieves the open interest of a contract trading pair
|
11656
|
-
|
11657
|
-
|
11658
|
-
|
11820
|
+
|
11821
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest
|
11822
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Open-Interest
|
11823
|
+
https://developers.binance.com/docs/derivatives/option/market-data/Open-Interest
|
11824
|
+
|
11659
11825
|
:param str symbol: unified CCXT market symbol
|
11660
11826
|
:param dict [params]: exchange specific parameters
|
11661
11827
|
:returns dict} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure:
|
@@ -11739,11 +11905,13 @@ class binance(Exchange, ImplicitAPI):
|
|
11739
11905
|
async def fetch_my_liquidations(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
11740
11906
|
"""
|
11741
11907
|
retrieves the users liquidated positions
|
11742
|
-
|
11743
|
-
|
11744
|
-
|
11745
|
-
|
11746
|
-
|
11908
|
+
|
11909
|
+
https://developers.binance.com/docs/margin_trading/trade/Get-Force-Liquidation-Record
|
11910
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders
|
11911
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Users-Force-Orders
|
11912
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-UM-Force-Orders
|
11913
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-CM-Force-Orders
|
11914
|
+
|
11747
11915
|
:param str [symbol]: unified CCXT market symbol
|
11748
11916
|
:param int [since]: the earliest time in ms to fetch liquidations for
|
11749
11917
|
:param int [limit]: the maximum number of liquidation structures to retrieve
|
@@ -11968,7 +12136,9 @@ class binance(Exchange, ImplicitAPI):
|
|
11968
12136
|
async def fetch_greeks(self, symbol: str, params={}) -> Greeks:
|
11969
12137
|
"""
|
11970
12138
|
fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
|
11971
|
-
|
12139
|
+
|
12140
|
+
https://developers.binance.com/docs/derivatives/option/market-data/Option-Mark-Price
|
12141
|
+
|
11972
12142
|
:param str symbol: unified symbol of the market to fetch greeks for
|
11973
12143
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
11974
12144
|
:returns dict: a `greeks structure <https://docs.ccxt.com/#/?id=greeks-structure>`
|
@@ -12052,8 +12222,10 @@ class binance(Exchange, ImplicitAPI):
|
|
12052
12222
|
async def fetch_position_mode(self, symbol: Str = None, params={}):
|
12053
12223
|
"""
|
12054
12224
|
fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets
|
12055
|
-
|
12056
|
-
|
12225
|
+
|
12226
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Position-Mode
|
12227
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Current-Position-Mode
|
12228
|
+
|
12057
12229
|
:param str symbol: unified symbol of the market to fetch the order book for
|
12058
12230
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
12059
12231
|
:param str [params.subType]: "linear" or "inverse"
|
@@ -12085,10 +12257,12 @@ class binance(Exchange, ImplicitAPI):
|
|
12085
12257
|
async def fetch_margin_modes(self, symbols: Strings = None, params={}) -> MarginModes:
|
12086
12258
|
"""
|
12087
12259
|
fetches margin modes("isolated" or "cross") that the market for the symbol in in, with symbol=None all markets for a subType(linear/inverse) are returned
|
12088
|
-
|
12089
|
-
|
12090
|
-
|
12091
|
-
|
12260
|
+
|
12261
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
12262
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
12263
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config
|
12264
|
+
|
12265
|
+
:param str[] symbols: unified market symbols
|
12092
12266
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
12093
12267
|
:param str [params.subType]: "linear" or "inverse"
|
12094
12268
|
:returns dict: a list of `margin mode structures <https://docs.ccxt.com/#/?id=margin-mode-structure>`
|
@@ -12171,6 +12345,46 @@ class binance(Exchange, ImplicitAPI):
|
|
12171
12345
|
assets = response
|
12172
12346
|
return self.parse_margin_modes(assets, symbols, 'symbol', 'swap')
|
12173
12347
|
|
12348
|
+
async def fetch_margin_mode(self, symbol: str, params={}) -> MarginMode:
|
12349
|
+
"""
|
12350
|
+
fetches the margin mode of a specific symbol
|
12351
|
+
|
12352
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config
|
12353
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
12354
|
+
|
12355
|
+
:param str symbol: unified symbol of the market the order was made in
|
12356
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
12357
|
+
:param str [params.subType]: "linear" or "inverse"
|
12358
|
+
:returns dict: a `margin mode structure <https://docs.ccxt.com/#/?id=margin-mode-structure>`
|
12359
|
+
"""
|
12360
|
+
await self.load_markets()
|
12361
|
+
market = self.market(symbol)
|
12362
|
+
subType = None
|
12363
|
+
subType, params = self.handle_sub_type_and_params('fetchMarginMode', market, params)
|
12364
|
+
response = None
|
12365
|
+
if subType == 'linear':
|
12366
|
+
request: dict = {
|
12367
|
+
'symbol': market['id'],
|
12368
|
+
}
|
12369
|
+
response = await self.fapiPrivateGetSymbolConfig(self.extend(request, params))
|
12370
|
+
#
|
12371
|
+
# [
|
12372
|
+
# {
|
12373
|
+
# "symbol": "BTCUSDT",
|
12374
|
+
# "marginType": "CROSSED",
|
12375
|
+
# "isAutoAddMargin": "false",
|
12376
|
+
# "leverage": 21,
|
12377
|
+
# "maxNotionalValue": "1000000",
|
12378
|
+
# }
|
12379
|
+
# ]
|
12380
|
+
#
|
12381
|
+
elif subType == 'inverse':
|
12382
|
+
fetchMarginModesResponse = await self.fetch_margin_modes([symbol], params)
|
12383
|
+
return fetchMarginModesResponse[symbol]
|
12384
|
+
else:
|
12385
|
+
raise BadRequest(self.id + ' fetchMarginMode() supports linear and inverse subTypes only')
|
12386
|
+
return self.parse_margin_mode(response[0], market)
|
12387
|
+
|
12174
12388
|
def parse_margin_mode(self, marginMode: dict, market=None) -> MarginMode:
|
12175
12389
|
marketId = self.safe_string(marginMode, 'symbol')
|
12176
12390
|
market = self.safe_market(marketId, market)
|
@@ -12190,7 +12404,9 @@ class binance(Exchange, ImplicitAPI):
|
|
12190
12404
|
async def fetch_option(self, symbol: str, params={}) -> Option:
|
12191
12405
|
"""
|
12192
12406
|
fetches option data that is commonly found in an option chain
|
12193
|
-
|
12407
|
+
|
12408
|
+
https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics
|
12409
|
+
|
12194
12410
|
:param str symbol: unified market symbol
|
12195
12411
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
12196
12412
|
:returns dict: an `option chain structure <https://docs.ccxt.com/#/?id=option-chain-structure>`
|
@@ -12276,8 +12492,10 @@ class binance(Exchange, ImplicitAPI):
|
|
12276
12492
|
async def fetch_margin_adjustment_history(self, symbol: Str = None, type: Str = None, since: Num = None, limit: Num = None, params={}) -> List[MarginModification]:
|
12277
12493
|
"""
|
12278
12494
|
fetches the history of margin added or reduced from contract isolated positions
|
12279
|
-
|
12280
|
-
|
12495
|
+
|
12496
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Position-Margin-Change-History
|
12497
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Get-Position-Margin-Change-History
|
12498
|
+
|
12281
12499
|
:param str symbol: unified market symbol
|
12282
12500
|
:param str [type]: "add" or "reduce"
|
12283
12501
|
:param int [since]: timestamp in ms of the earliest change to fetch
|
@@ -12331,7 +12549,9 @@ class binance(Exchange, ImplicitAPI):
|
|
12331
12549
|
async def fetch_convert_currencies(self, params={}) -> Currencies:
|
12332
12550
|
"""
|
12333
12551
|
fetches all available currencies that can be converted
|
12334
|
-
|
12552
|
+
|
12553
|
+
https://developers.binance.com/docs/convert/market-data/Query-order-quantity-precision-per-asset
|
12554
|
+
|
12335
12555
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
12336
12556
|
:returns dict: an associative dictionary of currencies
|
12337
12557
|
"""
|
@@ -12383,7 +12603,9 @@ class binance(Exchange, ImplicitAPI):
|
|
12383
12603
|
async def fetch_convert_quote(self, fromCode: str, toCode: str, amount: Num = None, params={}) -> Conversion:
|
12384
12604
|
"""
|
12385
12605
|
fetch a quote for converting from one currency to another
|
12386
|
-
|
12606
|
+
|
12607
|
+
https://developers.binance.com/docs/convert/trade/Send-quote-request
|
12608
|
+
|
12387
12609
|
:param str fromCode: the currency that you want to sell and convert from
|
12388
12610
|
:param str toCode: the currency that you want to buy and convert into
|
12389
12611
|
:param float amount: how much you want to trade in units of the from currency
|
@@ -12417,7 +12639,9 @@ class binance(Exchange, ImplicitAPI):
|
|
12417
12639
|
async def create_convert_trade(self, id: str, fromCode: str, toCode: str, amount: Num = None, params={}) -> Conversion:
|
12418
12640
|
"""
|
12419
12641
|
convert from one currency to another
|
12420
|
-
|
12642
|
+
|
12643
|
+
https://developers.binance.com/docs/convert/trade/Accept-Quote
|
12644
|
+
|
12421
12645
|
:param str id: the id of the trade that you want to make
|
12422
12646
|
:param str fromCode: the currency that you want to sell and convert from
|
12423
12647
|
:param str toCode: the currency that you want to buy and convert into
|
@@ -12459,7 +12683,9 @@ class binance(Exchange, ImplicitAPI):
|
|
12459
12683
|
async def fetch_convert_trade(self, id: str, code: Str = None, params={}) -> Conversion:
|
12460
12684
|
"""
|
12461
12685
|
fetch the data for a conversion trade
|
12462
|
-
|
12686
|
+
|
12687
|
+
https://developers.binance.com/docs/convert/trade/Order-Status
|
12688
|
+
|
12463
12689
|
:param str id: the id of the trade that you want to fetch
|
12464
12690
|
:param str [code]: the unified currency code of the conversion trade
|
12465
12691
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -12529,7 +12755,9 @@ class binance(Exchange, ImplicitAPI):
|
|
12529
12755
|
async def fetch_convert_trade_history(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Conversion]:
|
12530
12756
|
"""
|
12531
12757
|
fetch the users history of conversion trades
|
12532
|
-
|
12758
|
+
|
12759
|
+
https://developers.binance.com/docs/convert/trade/Get-Convert-Trade-History
|
12760
|
+
|
12533
12761
|
:param str [code]: the unified currency code
|
12534
12762
|
:param int [since]: the earliest time in ms to fetch conversions for
|
12535
12763
|
:param int [limit]: the maximum number of conversion structures to retrieve
|
@@ -12708,8 +12936,10 @@ class binance(Exchange, ImplicitAPI):
|
|
12708
12936
|
async def fetch_funding_intervals(self, symbols: Strings = None, params={}) -> FundingRates:
|
12709
12937
|
"""
|
12710
12938
|
fetch the funding rate interval for multiple markets
|
12711
|
-
|
12712
|
-
|
12939
|
+
|
12940
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Info
|
12941
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Get-Funding-Info
|
12942
|
+
|
12713
12943
|
:param str[] [symbols]: list of unified market symbols
|
12714
12944
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
12715
12945
|
:param str [params.subType]: "linear" or "inverse"
|
@@ -12747,8 +12977,10 @@ class binance(Exchange, ImplicitAPI):
|
|
12747
12977
|
async def fetch_long_short_ratio_history(self, symbol: Str = None, timeframe: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LongShortRatio]:
|
12748
12978
|
"""
|
12749
12979
|
fetches the long short ratio history for a unified market symbol
|
12750
|
-
|
12751
|
-
|
12980
|
+
|
12981
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Long-Short-Ratio
|
12982
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Long-Short-Ratio
|
12983
|
+
|
12752
12984
|
:param str symbol: unified symbol of the market to fetch the long short ratio for
|
12753
12985
|
:param str [timeframe]: the period for the ratio, default is 24 hours
|
12754
12986
|
:param int [since]: the earliest time in ms to fetch ratios for
|