ccxt 4.4.29__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/abstract/alpaca.py +1 -0
- ccxt/abstract/binance.py +9 -0
- ccxt/abstract/binancecoinm.py +9 -0
- ccxt/abstract/binanceus.py +9 -0
- ccxt/abstract/binanceusdm.py +9 -0
- ccxt/ace.py +36 -12
- ccxt/alpaca.py +113 -28
- ccxt/ascendex.py +65 -30
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +36 -12
- ccxt/async_support/alpaca.py +113 -28
- 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 +564 -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 +29 -21
- ccxt/async_support/bitfinex.py +77 -33
- 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 +198 -132
- 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 +138 -53
- 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 +203 -42
- 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 +90 -39
- 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 +564 -323
- ccxt/bingx.py +208 -108
- ccxt/bit2c.py +34 -12
- ccxt/bitbank.py +42 -14
- ccxt/bitbns.py +29 -21
- ccxt/bitfinex.py +77 -33
- ccxt/bitfinex2.py +116 -44
- ccxt/bitflyer.py +54 -18
- ccxt/bitget.py +277 -145
- ccxt/bithumb.py +39 -14
- ccxt/bitmart.py +198 -132
- 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 +138 -53
- 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 +203 -42
- 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 +90 -39
- 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 +38 -13
- 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/test/tests_helpers.py +2 -2
- 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.29.dist-info → ccxt-4.4.31.dist-info}/METADATA +5 -5
- {ccxt-4.4.29.dist-info → ccxt-4.4.31.dist-info}/RECORD +273 -273
- {ccxt-4.4.29.dist-info → ccxt-4.4.31.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.29.dist-info → ccxt-4.4.31.dist-info}/WHEEL +0 -0
- {ccxt-4.4.29.dist-info → ccxt-4.4.31.dist-info}/top_level.txt +0 -0
ccxt/binance.py
CHANGED
@@ -131,7 +131,7 @@ class binance(Exchange, ImplicitAPI):
|
|
131
131
|
'fetchLongShortRatio': False,
|
132
132
|
'fetchLongShortRatioHistory': True,
|
133
133
|
'fetchMarginAdjustmentHistory': True,
|
134
|
-
'fetchMarginMode':
|
134
|
+
'fetchMarginMode': True,
|
135
135
|
'fetchMarginModes': True,
|
136
136
|
'fetchMarketLeverageTiers': 'emulated',
|
137
137
|
'fetchMarkets': True,
|
@@ -416,6 +416,12 @@ class binance(Exchange, ImplicitAPI):
|
|
416
416
|
'eth-staking/wbeth/history/wrapHistory': 15, # Weight(IP): 150 => cost = 0.1 * 150 = 15
|
417
417
|
'eth-staking/wbeth/history/unwrapHistory': 15, # Weight(IP): 150 => cost = 0.1 * 150 = 15
|
418
418
|
'eth-staking/eth/history/wbethRewardsHistory': 15, # Weight(IP): 150 => cost = 0.1 * 150 = 15
|
419
|
+
'sol-staking/sol/history/stakingHistory': 15,
|
420
|
+
'sol-staking/sol/history/redemptionHistory': 15,
|
421
|
+
'sol-staking/sol/history/bnsolRewardsHistory': 15,
|
422
|
+
'sol-staking/sol/history/rateHistory': 15,
|
423
|
+
'sol-staking/account': 15,
|
424
|
+
'sol-staking/sol/quota': 15,
|
419
425
|
# mining endpoints
|
420
426
|
'mining/pub/algoList': 0.1,
|
421
427
|
'mining/pub/coinList': 0.1,
|
@@ -627,6 +633,8 @@ class binance(Exchange, ImplicitAPI):
|
|
627
633
|
'eth-staking/eth/stake': 15, # Weight(IP): 150 => cost = 0.1 * 150 = 15
|
628
634
|
'eth-staking/eth/redeem': 15, # Weight(IP): 150 => cost = 0.1 * 150 = 15
|
629
635
|
'eth-staking/wbeth/wrap': 15, # Weight(IP): 150 => cost = 0.1 * 150 = 15
|
636
|
+
'sol-staking/sol/stake': 15,
|
637
|
+
'sol-staking/sol/redeem': 15,
|
630
638
|
# mining endpoints
|
631
639
|
'mining/hash-transfer/config': 0.5, # Weight(IP): 5 => cost = 0.1 * 5 = 0.5
|
632
640
|
'mining/hash-transfer/config/cancel': 0.5, # Weight(IP): 5 => cost = 0.1 * 5 = 0.5
|
@@ -661,6 +669,7 @@ class binance(Exchange, ImplicitAPI):
|
|
661
669
|
'simple-earn/locked/redeem': 0.1,
|
662
670
|
'simple-earn/flexible/setAutoSubscribe': 15,
|
663
671
|
'simple-earn/locked/setAutoSubscribe': 15,
|
672
|
+
'simple-earn/locked/setRedeemOption': 5,
|
664
673
|
# convert
|
665
674
|
'dci/product/subscribe': 0.1,
|
666
675
|
'dci/product/auto_compound/edit': 0.1,
|
@@ -2658,9 +2667,11 @@ class binance(Exchange, ImplicitAPI):
|
|
2658
2667
|
def fetch_time(self, params={}):
|
2659
2668
|
"""
|
2660
2669
|
fetches the current integer timestamp in milliseconds from the exchange server
|
2661
|
-
|
2662
|
-
|
2663
|
-
|
2670
|
+
|
2671
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#check-server-time # spot
|
2672
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time # swap
|
2673
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Check-Server-time # future
|
2674
|
+
|
2664
2675
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2665
2676
|
:param str [params.subType]: "linear" or "inverse"
|
2666
2677
|
:returns int: the current integer timestamp in milliseconds from the exchange server
|
@@ -2682,8 +2693,10 @@ class binance(Exchange, ImplicitAPI):
|
|
2682
2693
|
def fetch_currencies(self, params={}) -> Currencies:
|
2683
2694
|
"""
|
2684
2695
|
fetches all available currencies on an exchange
|
2685
|
-
|
2686
|
-
|
2696
|
+
|
2697
|
+
https://developers.binance.com/docs/wallet/capital/all-coins-info
|
2698
|
+
https://developers.binance.com/docs/margin_trading/market-data/Get-All-Margin-Assets
|
2699
|
+
|
2687
2700
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2688
2701
|
:returns dict: an associative dictionary of currencies
|
2689
2702
|
"""
|
@@ -2890,12 +2903,14 @@ class binance(Exchange, ImplicitAPI):
|
|
2890
2903
|
def fetch_markets(self, params={}) -> List[Market]:
|
2891
2904
|
"""
|
2892
2905
|
retrieves data on all markets for binance
|
2893
|
-
|
2894
|
-
|
2895
|
-
|
2896
|
-
|
2897
|
-
|
2898
|
-
|
2906
|
+
|
2907
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#exchange-information # spot
|
2908
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information # swap
|
2909
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Exchange-Information # future
|
2910
|
+
https://developers.binance.com/docs/derivatives/option/market-data/Exchange-Information # option
|
2911
|
+
https://developers.binance.com/docs/margin_trading/market-data/Get-All-Cross-Margin-Pairs # cross margin
|
2912
|
+
https://developers.binance.com/docs/margin_trading/market-data/Get-All-Isolated-Margin-Symbol # isolated margin
|
2913
|
+
|
2899
2914
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2900
2915
|
:returns dict[]: an array of objects representing market data
|
2901
2916
|
"""
|
@@ -3443,14 +3458,16 @@ class binance(Exchange, ImplicitAPI):
|
|
3443
3458
|
def fetch_balance(self, params={}) -> Balances:
|
3444
3459
|
"""
|
3445
3460
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
3446
|
-
|
3447
|
-
|
3448
|
-
|
3449
|
-
|
3450
|
-
|
3451
|
-
|
3452
|
-
|
3453
|
-
|
3461
|
+
|
3462
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-information-user_data # spot
|
3463
|
+
https://developers.binance.com/docs/margin_trading/account/Query-Cross-Margin-Account-Details # cross margin
|
3464
|
+
https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Account-Info # isolated margin
|
3465
|
+
https://developers.binance.com/docs/wallet/asset/funding-wallet # funding
|
3466
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2 # swap
|
3467
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Futures-Account-Balance # future
|
3468
|
+
https://developers.binance.com/docs/derivatives/option/account/Option-Account-Information # option
|
3469
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Balance # portfolio margin
|
3470
|
+
|
3454
3471
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3455
3472
|
:param str [params.type]: 'future', 'delivery', 'savings', 'funding', or 'spot' or 'papi'
|
3456
3473
|
:param str [params.marginMode]: 'cross' or 'isolated', for margin trading, uses self.options.defaultMarginMode if not passed, defaults to None/None/None
|
@@ -3699,10 +3716,12 @@ class binance(Exchange, ImplicitAPI):
|
|
3699
3716
|
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
3700
3717
|
"""
|
3701
3718
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
3702
|
-
|
3703
|
-
|
3704
|
-
|
3705
|
-
|
3719
|
+
|
3720
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#order-book # spot
|
3721
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book # swap
|
3722
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Order-Book # future
|
3723
|
+
https://developers.binance.com/docs/derivatives/option/market-data/Order-Book # option
|
3724
|
+
|
3706
3725
|
:param str symbol: unified symbol of the market to fetch the order book for
|
3707
3726
|
:param int [limit]: the maximum amount of order book entries to return
|
3708
3727
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -3929,7 +3948,9 @@ class binance(Exchange, ImplicitAPI):
|
|
3929
3948
|
def fetch_status(self, params={}):
|
3930
3949
|
"""
|
3931
3950
|
the latest known information on the availability of the exchange API
|
3932
|
-
|
3951
|
+
|
3952
|
+
https://developers.binance.com/docs/wallet/others/system-status
|
3953
|
+
|
3933
3954
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3934
3955
|
:returns dict: a `status structure <https://docs.ccxt.com/#/?id=exchange-status-structure>`
|
3935
3956
|
"""
|
@@ -3952,11 +3973,13 @@ class binance(Exchange, ImplicitAPI):
|
|
3952
3973
|
def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
3953
3974
|
"""
|
3954
3975
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
3955
|
-
|
3956
|
-
|
3957
|
-
|
3958
|
-
|
3959
|
-
|
3976
|
+
|
3977
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics # spot
|
3978
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#rolling-window-price-change-statistics # spot
|
3979
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics # swap
|
3980
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics # future
|
3981
|
+
https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics # option
|
3982
|
+
|
3960
3983
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
3961
3984
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3962
3985
|
:param boolean [params.rolling]:(spot only) default False, if True, uses the rolling 24 hour ticker endpoint /api/v3/ticker
|
@@ -3989,9 +4012,11 @@ class binance(Exchange, ImplicitAPI):
|
|
3989
4012
|
def fetch_bids_asks(self, symbols: Strings = None, params={}):
|
3990
4013
|
"""
|
3991
4014
|
fetches the bid and ask price and volume for multiple markets
|
3992
|
-
|
3993
|
-
|
3994
|
-
|
4015
|
+
|
4016
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-order-book-ticker # spot
|
4017
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker # swap
|
4018
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Order-Book-Ticker # future
|
4019
|
+
|
3995
4020
|
:param str[]|None symbols: unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
|
3996
4021
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3997
4022
|
:param str [params.subType]: "linear" or "inverse"
|
@@ -4021,9 +4046,11 @@ class binance(Exchange, ImplicitAPI):
|
|
4021
4046
|
def fetch_last_prices(self, symbols: Strings = None, params={}):
|
4022
4047
|
"""
|
4023
4048
|
fetches the last price for multiple markets
|
4024
|
-
|
4025
|
-
|
4026
|
-
|
4049
|
+
|
4050
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-price-ticker # spot
|
4051
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker # swap
|
4052
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Price-Ticker # future
|
4053
|
+
|
4027
4054
|
:param str[]|None symbols: unified symbols of the markets to fetch the last prices
|
4028
4055
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4029
4056
|
:param str [params.subType]: "linear" or "inverse"
|
@@ -4120,10 +4147,12 @@ class binance(Exchange, ImplicitAPI):
|
|
4120
4147
|
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
4121
4148
|
"""
|
4122
4149
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
4123
|
-
|
4124
|
-
|
4125
|
-
|
4126
|
-
|
4150
|
+
|
4151
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics # spot
|
4152
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics # swap
|
4153
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics # future
|
4154
|
+
https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics # option
|
4155
|
+
|
4127
4156
|
:param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
4128
4157
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4129
4158
|
:param str [params.subType]: "linear" or "inverse"
|
@@ -4156,8 +4185,10 @@ class binance(Exchange, ImplicitAPI):
|
|
4156
4185
|
def fetch_mark_price(self, symbol: str, params={}) -> Ticker:
|
4157
4186
|
"""
|
4158
4187
|
fetches mark price for the market
|
4159
|
-
|
4160
|
-
|
4188
|
+
|
4189
|
+
https://binance-docs.github.io/apidocs/futures/en/#mark-price
|
4190
|
+
https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
|
4191
|
+
|
4161
4192
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
4162
4193
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4163
4194
|
:param str [params.subType]: "linear" or "inverse"
|
@@ -4186,8 +4217,10 @@ class binance(Exchange, ImplicitAPI):
|
|
4186
4217
|
def fetch_mark_prices(self, symbols: Strings = None, params={}) -> Tickers:
|
4187
4218
|
"""
|
4188
4219
|
fetches mark prices for multiple markets
|
4189
|
-
|
4190
|
-
|
4220
|
+
|
4221
|
+
https://binance-docs.github.io/apidocs/futures/en/#mark-price
|
4222
|
+
https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
|
4223
|
+
|
4191
4224
|
:param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
4192
4225
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4193
4226
|
:param str [params.subType]: "linear" or "inverse"
|
@@ -4275,16 +4308,18 @@ class binance(Exchange, ImplicitAPI):
|
|
4275
4308
|
def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
4276
4309
|
"""
|
4277
4310
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
4278
|
-
|
4279
|
-
|
4280
|
-
|
4281
|
-
|
4282
|
-
|
4283
|
-
|
4284
|
-
|
4285
|
-
|
4286
|
-
|
4287
|
-
|
4311
|
+
|
4312
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#klinecandlestick-data
|
4313
|
+
https://developers.binance.com/docs/derivatives/option/market-data/Kline-Candlestick-Data
|
4314
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data
|
4315
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data
|
4316
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data
|
4317
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data
|
4318
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Kline-Candlestick-Data
|
4319
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-Kline-Candlestick-Data
|
4320
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Mark-Price-Kline-Candlestick-Data
|
4321
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Premium-Index-Kline-Data
|
4322
|
+
|
4288
4323
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
4289
4324
|
:param str timeframe: the length of time each candle represents
|
4290
4325
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
@@ -4648,19 +4683,23 @@ class binance(Exchange, ImplicitAPI):
|
|
4648
4683
|
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
4649
4684
|
"""
|
4650
4685
|
get the list of most recent trades for a particular symbol
|
4651
|
-
|
4652
|
-
|
4653
|
-
|
4654
|
-
|
4655
|
-
|
4656
|
-
|
4657
|
-
|
4658
|
-
|
4659
|
-
|
4660
|
-
|
4661
|
-
|
4662
|
-
|
4663
|
-
|
4686
|
+
Default fetchTradesMethod
|
4687
|
+
|
4688
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#compressedaggregate-trades-list # publicGetAggTrades(spot)
|
4689
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List # fapiPublicGetAggTrades(swap)
|
4690
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Compressed-Aggregate-Trades-List # dapiPublicGetAggTrades(future)
|
4691
|
+
https://developers.binance.com/docs/derivatives/option/market-data/Recent-Trades-List # eapiPublicGetTrades(option)
|
4692
|
+
|
4693
|
+
Other fetchTradesMethod
|
4694
|
+
|
4695
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#recent-trades-list # publicGetTrades(spot)
|
4696
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List # fapiPublicGetTrades(swap)
|
4697
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Recent-Trades-List # dapiPublicGetTrades(future)
|
4698
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#old-trade-lookup # publicGetHistoricalTrades(spot)
|
4699
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup # fapiPublicGetHistoricalTrades(swap)
|
4700
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Old-Trades-Lookup # dapiPublicGetHistoricalTrades(future)
|
4701
|
+
https://developers.binance.com/docs/derivatives/option/market-data/Old-Trades-Lookup # eapiPublicGetHistoricalTrades(option)
|
4702
|
+
|
4664
4703
|
:param str symbol: unified symbol of the market to fetch trades for
|
4665
4704
|
:param int [since]: only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades'
|
4666
4705
|
:param int [limit]: default 500, max 1000
|
@@ -4668,8 +4707,8 @@ class binance(Exchange, ImplicitAPI):
|
|
4668
4707
|
:param int [params.until]: only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades'
|
4669
4708
|
:param int [params.fetchTradesMethod]: 'publicGetAggTrades'(spot default), 'fapiPublicGetAggTrades'(swap default), 'dapiPublicGetAggTrades'(future default), 'eapiPublicGetTrades'(option default), 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', 'publicGetHistoricalTrades', 'fapiPublicGetHistoricalTrades', 'dapiPublicGetHistoricalTrades', 'eapiPublicGetHistoricalTrades'
|
4670
4709
|
: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)
|
4671
|
-
|
4672
|
-
|
4710
|
+
|
4711
|
+
EXCHANGE SPECIFIC PARAMETERS
|
4673
4712
|
:param int [params.fromId]: trade id to fetch from, default gets most recent trades, not used when fetchTradesMethod is 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', or 'eapiPublicGetTrades'
|
4674
4713
|
:returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
|
4675
4714
|
"""
|
@@ -4780,17 +4819,19 @@ class binance(Exchange, ImplicitAPI):
|
|
4780
4819
|
|
4781
4820
|
def edit_spot_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
4782
4821
|
"""
|
4783
|
-
|
4822
|
+
@ignore
|
4784
4823
|
edit a trade order
|
4785
|
-
|
4824
|
+
|
4825
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
|
4826
|
+
|
4786
4827
|
:param str id: cancel order id
|
4787
4828
|
:param str symbol: unified symbol of the market to create an order in
|
4788
4829
|
:param str type: 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP'
|
4789
4830
|
:param str side: 'buy' or 'sell'
|
4790
4831
|
:param float amount: how much of currency you want to trade in units of base currency
|
4791
4832
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
4792
|
-
:param str [params.marginMode]: 'cross' or 'isolated', for spot margin trading
|
4793
4833
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4834
|
+
:param str [params.marginMode]: 'cross' or 'isolated', for spot margin trading
|
4794
4835
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
4795
4836
|
"""
|
4796
4837
|
self.load_markets()
|
@@ -4843,7 +4884,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4843
4884
|
|
4844
4885
|
def edit_spot_order_request(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
4845
4886
|
"""
|
4846
|
-
|
4887
|
+
@ignore
|
4847
4888
|
helper function to build request for editSpotOrder
|
4848
4889
|
:param str id: order id to be edited
|
4849
4890
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -4967,8 +5008,10 @@ class binance(Exchange, ImplicitAPI):
|
|
4967
5008
|
def edit_contract_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
4968
5009
|
"""
|
4969
5010
|
edit a trade order
|
4970
|
-
|
4971
|
-
|
5011
|
+
|
5012
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
5013
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
5014
|
+
|
4972
5015
|
:param str id: cancel order id
|
4973
5016
|
:param str symbol: unified symbol of the market to create an order in
|
4974
5017
|
:param str type: 'market' or 'limit'
|
@@ -5018,9 +5061,11 @@ class binance(Exchange, ImplicitAPI):
|
|
5018
5061
|
def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
5019
5062
|
"""
|
5020
5063
|
edit a trade order
|
5021
|
-
|
5022
|
-
|
5023
|
-
|
5064
|
+
|
5065
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
|
5066
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
5067
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
5068
|
+
|
5024
5069
|
:param str id: cancel order id
|
5025
5070
|
:param str symbol: unified symbol of the market to create an order in
|
5026
5071
|
:param str type: 'market' or 'limit'
|
@@ -5614,10 +5659,13 @@ class binance(Exchange, ImplicitAPI):
|
|
5614
5659
|
def create_orders(self, orders: List[OrderRequest], params={}):
|
5615
5660
|
"""
|
5616
5661
|
*contract only* create a list of trade orders
|
5617
|
-
|
5618
|
-
|
5619
|
-
|
5662
|
+
|
5663
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Place-Multiple-Orders
|
5664
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders
|
5665
|
+
https://developers.binance.com/docs/derivatives/option/trade/Place-Multiple-Orders
|
5666
|
+
|
5620
5667
|
: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
|
5668
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5621
5669
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
5622
5670
|
"""
|
5623
5671
|
self.load_markets()
|
@@ -5688,18 +5736,20 @@ class binance(Exchange, ImplicitAPI):
|
|
5688
5736
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
5689
5737
|
"""
|
5690
5738
|
create a trade order
|
5691
|
-
|
5692
|
-
|
5693
|
-
|
5694
|
-
|
5695
|
-
|
5696
|
-
|
5697
|
-
|
5698
|
-
|
5699
|
-
|
5700
|
-
|
5701
|
-
|
5702
|
-
|
5739
|
+
|
5740
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
5741
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-trade
|
5742
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order
|
5743
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/New-Order
|
5744
|
+
https://developers.binance.com/docs/derivatives/option/trade/New-Order
|
5745
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#sor
|
5746
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-using-sor-trade
|
5747
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Order
|
5748
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order
|
5749
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order
|
5750
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order
|
5751
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Conditional-Order
|
5752
|
+
|
5703
5753
|
:param str symbol: unified symbol of the market to create an order in
|
5704
5754
|
:param str type: 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP'
|
5705
5755
|
:param str side: 'buy' or 'sell'
|
@@ -5780,7 +5830,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5780
5830
|
|
5781
5831
|
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
5782
5832
|
"""
|
5783
|
-
|
5833
|
+
@ignore
|
5784
5834
|
helper function to build the request
|
5785
5835
|
:param str symbol: unified symbol of the market to create an order in
|
5786
5836
|
:param str type: 'market' or 'limit'
|
@@ -6029,7 +6079,9 @@ class binance(Exchange, ImplicitAPI):
|
|
6029
6079
|
def create_market_order_with_cost(self, symbol: str, side: OrderSide, cost: float, params={}):
|
6030
6080
|
"""
|
6031
6081
|
create a market order by providing the symbol, side and cost
|
6032
|
-
|
6082
|
+
|
6083
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
6084
|
+
|
6033
6085
|
:param str symbol: unified symbol of the market to create an order in
|
6034
6086
|
:param str side: 'buy' or 'sell'
|
6035
6087
|
:param float cost: how much you want to trade in units of the quote currency
|
@@ -6046,7 +6098,9 @@ class binance(Exchange, ImplicitAPI):
|
|
6046
6098
|
def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
6047
6099
|
"""
|
6048
6100
|
create a market buy order by providing the symbol and cost
|
6049
|
-
|
6101
|
+
|
6102
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
6103
|
+
|
6050
6104
|
:param str symbol: unified symbol of the market to create an order in
|
6051
6105
|
:param float cost: how much you want to trade in units of the quote currency
|
6052
6106
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6062,7 +6116,9 @@ class binance(Exchange, ImplicitAPI):
|
|
6062
6116
|
def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
6063
6117
|
"""
|
6064
6118
|
create a market sell order by providing the symbol and cost
|
6065
|
-
|
6119
|
+
|
6120
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
6121
|
+
|
6066
6122
|
:param str symbol: unified symbol of the market to create an order in
|
6067
6123
|
:param float cost: how much you want to trade in units of the quote currency
|
6068
6124
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6078,13 +6134,15 @@ class binance(Exchange, ImplicitAPI):
|
|
6078
6134
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
6079
6135
|
"""
|
6080
6136
|
fetches information on an order made by the user
|
6081
|
-
|
6082
|
-
|
6083
|
-
|
6084
|
-
|
6085
|
-
|
6086
|
-
|
6087
|
-
|
6137
|
+
|
6138
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-order-user_data
|
6139
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order
|
6140
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Order
|
6141
|
+
https://developers.binance.com/docs/derivatives/option/trade/Query-Single-Order
|
6142
|
+
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Order
|
6143
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order
|
6144
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Order
|
6145
|
+
|
6088
6146
|
:param str id: the order id
|
6089
6147
|
:param str symbol: unified symbol of the market the order was made in
|
6090
6148
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6141,15 +6199,17 @@ class binance(Exchange, ImplicitAPI):
|
|
6141
6199
|
def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
6142
6200
|
"""
|
6143
6201
|
fetches information on multiple orders made by the user
|
6144
|
-
|
6145
|
-
|
6146
|
-
|
6147
|
-
|
6148
|
-
|
6149
|
-
|
6150
|
-
|
6151
|
-
|
6152
|
-
|
6202
|
+
|
6203
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
6204
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
6205
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
6206
|
+
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
6207
|
+
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
6208
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
6209
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
6210
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
6211
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
6212
|
+
|
6153
6213
|
:param str symbol: unified market symbol of the market orders were made in
|
6154
6214
|
:param int [since]: the earliest time in ms to fetch orders for
|
6155
6215
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -6398,15 +6458,17 @@ class binance(Exchange, ImplicitAPI):
|
|
6398
6458
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
6399
6459
|
"""
|
6400
6460
|
fetch all unfilled currently open orders
|
6401
|
-
|
6402
|
-
|
6403
|
-
|
6404
|
-
|
6405
|
-
|
6406
|
-
|
6407
|
-
|
6408
|
-
|
6409
|
-
|
6461
|
+
|
6462
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#current-open-orders-user_data
|
6463
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders
|
6464
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Current-All-Open-Orders
|
6465
|
+
https://developers.binance.com/docs/derivatives/option/trade/Query-Current-Open-Option-Orders
|
6466
|
+
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Open-Orders
|
6467
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders
|
6468
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Conditional-Orders
|
6469
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders
|
6470
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Conditional-Orders
|
6471
|
+
|
6410
6472
|
:param str symbol: unified market symbol
|
6411
6473
|
:param int [since]: the earliest time in ms to fetch open orders for
|
6412
6474
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
@@ -6479,12 +6541,14 @@ class binance(Exchange, ImplicitAPI):
|
|
6479
6541
|
def fetch_open_order(self, id: str, symbol: Str = None, params={}):
|
6480
6542
|
"""
|
6481
6543
|
fetch an open order by the id
|
6482
|
-
|
6483
|
-
|
6484
|
-
|
6485
|
-
|
6486
|
-
|
6487
|
-
|
6544
|
+
|
6545
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order
|
6546
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Current-Open-Order
|
6547
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order
|
6548
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order
|
6549
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order
|
6550
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order
|
6551
|
+
|
6488
6552
|
:param str id: order id
|
6489
6553
|
:param str symbol: unified market symbol
|
6490
6554
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6680,15 +6744,17 @@ class binance(Exchange, ImplicitAPI):
|
|
6680
6744
|
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
6681
6745
|
"""
|
6682
6746
|
fetches information on multiple closed orders made by the user
|
6683
|
-
|
6684
|
-
|
6685
|
-
|
6686
|
-
|
6687
|
-
|
6688
|
-
|
6689
|
-
|
6690
|
-
|
6691
|
-
|
6747
|
+
|
6748
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
6749
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
6750
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
6751
|
+
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
6752
|
+
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
6753
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
6754
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
6755
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
6756
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
6757
|
+
|
6692
6758
|
:param str symbol: unified market symbol of the market orders were made in
|
6693
6759
|
:param int [since]: the earliest time in ms to fetch orders for
|
6694
6760
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -6707,15 +6773,17 @@ class binance(Exchange, ImplicitAPI):
|
|
6707
6773
|
def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
6708
6774
|
"""
|
6709
6775
|
fetches information on multiple canceled orders made by the user
|
6710
|
-
|
6711
|
-
|
6712
|
-
|
6713
|
-
|
6714
|
-
|
6715
|
-
|
6716
|
-
|
6717
|
-
|
6718
|
-
|
6776
|
+
|
6777
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
6778
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
6779
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
6780
|
+
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
6781
|
+
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
6782
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
6783
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
6784
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
6785
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
6786
|
+
|
6719
6787
|
:param str symbol: unified market symbol of the market the orders were made in
|
6720
6788
|
:param int [since]: the earliest time in ms to fetch orders for
|
6721
6789
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -6734,15 +6802,17 @@ class binance(Exchange, ImplicitAPI):
|
|
6734
6802
|
def fetch_canceled_and_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
6735
6803
|
"""
|
6736
6804
|
fetches information on multiple canceled orders made by the user
|
6737
|
-
|
6738
|
-
|
6739
|
-
|
6740
|
-
|
6741
|
-
|
6742
|
-
|
6743
|
-
|
6744
|
-
|
6745
|
-
|
6805
|
+
|
6806
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
6807
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
6808
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
6809
|
+
https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
6810
|
+
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
6811
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
6812
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
6813
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
6814
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
6815
|
+
|
6746
6816
|
:param str symbol: unified market symbol of the market the orders were made in
|
6747
6817
|
:param int [since]: the earliest time in ms to fetch orders for
|
6748
6818
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -6764,16 +6834,18 @@ class binance(Exchange, ImplicitAPI):
|
|
6764
6834
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
6765
6835
|
"""
|
6766
6836
|
cancels an open order
|
6767
|
-
|
6768
|
-
|
6769
|
-
|
6770
|
-
|
6771
|
-
|
6772
|
-
|
6773
|
-
|
6774
|
-
|
6775
|
-
|
6776
|
-
|
6837
|
+
|
6838
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-order-trade
|
6839
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order
|
6840
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Order
|
6841
|
+
https://developers.binance.com/docs/derivatives/option/trade/Cancel-Option-Order
|
6842
|
+
https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-Order
|
6843
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order
|
6844
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Order
|
6845
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order
|
6846
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Conditional-Order
|
6847
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order
|
6848
|
+
|
6777
6849
|
:param str id: order id
|
6778
6850
|
:param str symbol: unified symbol of the market the order was made in
|
6779
6851
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6843,15 +6915,17 @@ class binance(Exchange, ImplicitAPI):
|
|
6843
6915
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
6844
6916
|
"""
|
6845
6917
|
cancel all open orders in a market
|
6846
|
-
|
6847
|
-
|
6848
|
-
|
6849
|
-
|
6850
|
-
|
6851
|
-
|
6852
|
-
|
6853
|
-
|
6854
|
-
|
6918
|
+
|
6919
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-all-open-orders-on-a-symbol-trade
|
6920
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders
|
6921
|
+
https://developers.binance.com/docs/derivatives/option/trade/Cancel-all-Option-orders-on-specific-symbol
|
6922
|
+
https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-All-Open-Orders
|
6923
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders
|
6924
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders
|
6925
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders
|
6926
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Conditional-Orders
|
6927
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-All-Open-Orders-on-a-Symbol
|
6928
|
+
|
6855
6929
|
:param str symbol: unified market symbol of the market to cancel orders in
|
6856
6930
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6857
6931
|
:param str [params.marginMode]: 'cross' or 'isolated', for spot margin trading
|
@@ -6998,13 +7072,15 @@ class binance(Exchange, ImplicitAPI):
|
|
6998
7072
|
def cancel_orders(self, ids: List[str], symbol: Str = None, params={}):
|
6999
7073
|
"""
|
7000
7074
|
cancel multiple orders
|
7001
|
-
|
7002
|
-
|
7075
|
+
|
7076
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders
|
7077
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Multiple-Orders
|
7078
|
+
|
7003
7079
|
:param str[] ids: order ids
|
7004
7080
|
:param str [symbol]: unified market symbol
|
7005
7081
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7006
|
-
|
7007
|
-
|
7082
|
+
|
7083
|
+
EXCHANGE SPECIFIC PARAMETERS
|
7008
7084
|
:param str[] [params.origClientOrderIdList]: max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma
|
7009
7085
|
:param int[] [params.recvWindow]:
|
7010
7086
|
:returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -7064,10 +7140,12 @@ class binance(Exchange, ImplicitAPI):
|
|
7064
7140
|
def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
7065
7141
|
"""
|
7066
7142
|
fetch all the trades made from a single order
|
7067
|
-
|
7068
|
-
|
7069
|
-
|
7070
|
-
|
7143
|
+
|
7144
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
7145
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
7146
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
7147
|
+
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
7148
|
+
|
7071
7149
|
:param str id: order id
|
7072
7150
|
:param str symbol: unified market symbol
|
7073
7151
|
:param int [since]: the earliest time in ms to fetch trades for
|
@@ -7091,13 +7169,15 @@ class binance(Exchange, ImplicitAPI):
|
|
7091
7169
|
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
7092
7170
|
"""
|
7093
7171
|
fetch all trades made by the user
|
7094
|
-
|
7095
|
-
|
7096
|
-
|
7097
|
-
|
7098
|
-
|
7099
|
-
|
7100
|
-
|
7172
|
+
|
7173
|
+
https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
7174
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
7175
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
7176
|
+
https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
7177
|
+
https://developers.binance.com/docs/derivatives/option/trade/Account-Trade-List
|
7178
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Account-Trade-List
|
7179
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List
|
7180
|
+
|
7101
7181
|
:param str symbol: unified market symbol
|
7102
7182
|
:param int [since]: the earliest time in ms to fetch trades for
|
7103
7183
|
:param int [limit]: the maximum number of trades structures to retrieve
|
@@ -7302,7 +7382,9 @@ class binance(Exchange, ImplicitAPI):
|
|
7302
7382
|
def fetch_my_dust_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
7303
7383
|
"""
|
7304
7384
|
fetch all dust trades made by the user
|
7305
|
-
|
7385
|
+
|
7386
|
+
https://developers.binance.com/docs/wallet/asset/dust-log
|
7387
|
+
|
7306
7388
|
:param str symbol: not used by binance fetchMyDustTrades()
|
7307
7389
|
:param int [since]: the earliest time in ms to fetch my dust trades for
|
7308
7390
|
:param int [limit]: the maximum number of dust trades to retrieve
|
@@ -7436,8 +7518,10 @@ class binance(Exchange, ImplicitAPI):
|
|
7436
7518
|
def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
7437
7519
|
"""
|
7438
7520
|
fetch all deposits made to an account
|
7439
|
-
|
7440
|
-
|
7521
|
+
|
7522
|
+
https://developers.binance.com/docs/wallet/capital/deposite-history
|
7523
|
+
https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History
|
7524
|
+
|
7441
7525
|
:param str code: unified currency code
|
7442
7526
|
:param int [since]: the earliest time in ms to fetch deposits for
|
7443
7527
|
:param int [limit]: the maximum number of deposits structures to retrieve
|
@@ -7536,8 +7620,10 @@ class binance(Exchange, ImplicitAPI):
|
|
7536
7620
|
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
7537
7621
|
"""
|
7538
7622
|
fetch all withdrawals made from an account
|
7539
|
-
|
7540
|
-
|
7623
|
+
|
7624
|
+
https://developers.binance.com/docs/wallet/capital/withdraw-history
|
7625
|
+
https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History
|
7626
|
+
|
7541
7627
|
:param str code: unified currency code
|
7542
7628
|
:param int [since]: the earliest time in ms to fetch withdrawals for
|
7543
7629
|
:param int [limit]: the maximum number of withdrawals structures to retrieve
|
@@ -7950,7 +8036,9 @@ class binance(Exchange, ImplicitAPI):
|
|
7950
8036
|
def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
7951
8037
|
"""
|
7952
8038
|
transfer currency internally between wallets on the same account
|
7953
|
-
|
8039
|
+
|
8040
|
+
https://developers.binance.com/docs/wallet/asset/user-universal-transfer
|
8041
|
+
|
7954
8042
|
:param str code: unified currency code
|
7955
8043
|
:param float amount: amount to transfer
|
7956
8044
|
:param str fromAccount: account to transfer from
|
@@ -8035,7 +8123,9 @@ class binance(Exchange, ImplicitAPI):
|
|
8035
8123
|
def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]:
|
8036
8124
|
"""
|
8037
8125
|
fetch a history of internal transfers made on an account
|
8038
|
-
|
8126
|
+
|
8127
|
+
https://developers.binance.com/docs/wallet/asset/query-user-universal-transfer
|
8128
|
+
|
8039
8129
|
:param str code: unified currency code of the currency transferred
|
8040
8130
|
:param int [since]: the earliest time in ms to fetch transfers for
|
8041
8131
|
:param int [limit]: the maximum number of transfers structures to retrieve
|
@@ -8167,9 +8257,12 @@ class binance(Exchange, ImplicitAPI):
|
|
8167
8257
|
def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
|
8168
8258
|
"""
|
8169
8259
|
fetch the deposit address for a currency associated with self account
|
8170
|
-
|
8260
|
+
|
8261
|
+
https://developers.binance.com/docs/wallet/capital/deposite-address
|
8262
|
+
|
8171
8263
|
:param str code: unified currency code
|
8172
8264
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
8265
|
+
:param str [params.network]: network for fetch deposit address
|
8173
8266
|
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
8174
8267
|
"""
|
8175
8268
|
self.load_markets()
|
@@ -8251,9 +8344,11 @@ class binance(Exchange, ImplicitAPI):
|
|
8251
8344
|
|
8252
8345
|
def fetch_transaction_fees(self, codes: Strings = None, params={}):
|
8253
8346
|
"""
|
8254
|
-
|
8347
|
+
@deprecated
|
8255
8348
|
please use fetchDepositWithdrawFees instead
|
8256
|
-
|
8349
|
+
|
8350
|
+
https://developers.binance.com/docs/wallet/capital/all-coins-info
|
8351
|
+
|
8257
8352
|
:param str[]|None codes: not used by binance fetchTransactionFees()
|
8258
8353
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
8259
8354
|
:returns dict[]: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -8363,7 +8458,9 @@ class binance(Exchange, ImplicitAPI):
|
|
8363
8458
|
def fetch_deposit_withdraw_fees(self, codes: Strings = None, params={}):
|
8364
8459
|
"""
|
8365
8460
|
fetch deposit and withdraw fees
|
8366
|
-
|
8461
|
+
|
8462
|
+
https://developers.binance.com/docs/wallet/capital/all-coins-info
|
8463
|
+
|
8367
8464
|
:param str[]|None codes: not used by binance fetchDepositWithdrawFees()
|
8368
8465
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
8369
8466
|
:returns dict[]: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -8483,7 +8580,9 @@ class binance(Exchange, ImplicitAPI):
|
|
8483
8580
|
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
8484
8581
|
"""
|
8485
8582
|
make a withdrawal
|
8486
|
-
|
8583
|
+
|
8584
|
+
https://developers.binance.com/docs/wallet/capital/withdraw
|
8585
|
+
|
8487
8586
|
:param str code: unified currency code
|
8488
8587
|
:param float amount: the amount to withdraw
|
8489
8588
|
:param str address: the address to withdraw to
|
@@ -8546,11 +8645,13 @@ class binance(Exchange, ImplicitAPI):
|
|
8546
8645
|
def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
|
8547
8646
|
"""
|
8548
8647
|
fetch the trading fees for a market
|
8549
|
-
|
8550
|
-
|
8551
|
-
|
8552
|
-
|
8553
|
-
|
8648
|
+
|
8649
|
+
https://developers.binance.com/docs/wallet/asset/trade-fee
|
8650
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/User-Commission-Rate
|
8651
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/User-Commission-Rate
|
8652
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-UM
|
8653
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-CM
|
8654
|
+
|
8554
8655
|
:param str symbol: unified market symbol
|
8555
8656
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
8556
8657
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch trading fees in a portfolio margin account
|
@@ -8609,10 +8710,12 @@ class binance(Exchange, ImplicitAPI):
|
|
8609
8710
|
def fetch_trading_fees(self, params={}) -> TradingFees:
|
8610
8711
|
"""
|
8611
8712
|
fetch the trading fees for multiple markets
|
8612
|
-
|
8613
|
-
|
8614
|
-
|
8615
|
-
|
8713
|
+
|
8714
|
+
https://developers.binance.com/docs/wallet/asset/trade-fee
|
8715
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
8716
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
8717
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config
|
8718
|
+
|
8616
8719
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
8617
8720
|
:param str [params.subType]: "linear" or "inverse"
|
8618
8721
|
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
|
@@ -8775,9 +8878,11 @@ class binance(Exchange, ImplicitAPI):
|
|
8775
8878
|
|
8776
8879
|
def futures_transfer(self, code: str, amount, type, params={}):
|
8777
8880
|
"""
|
8778
|
-
|
8881
|
+
@ignore
|
8779
8882
|
transfer between futures account
|
8780
|
-
|
8883
|
+
|
8884
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/New-Future-Account-Transfer
|
8885
|
+
|
8781
8886
|
:param str code: unified currency code
|
8782
8887
|
:param float amount: the amount to transfer
|
8783
8888
|
: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
|
@@ -8805,8 +8910,10 @@ class binance(Exchange, ImplicitAPI):
|
|
8805
8910
|
def fetch_funding_rate(self, symbol: str, params={}) -> FundingRate:
|
8806
8911
|
"""
|
8807
8912
|
fetch the current funding rate
|
8808
|
-
|
8809
|
-
|
8913
|
+
|
8914
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price
|
8915
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-and-Mark-Price
|
8916
|
+
|
8810
8917
|
:param str symbol: unified market symbol
|
8811
8918
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
8812
8919
|
:returns dict: a `funding rate structure <https://docs.ccxt.com/#/?id=funding-rate-structure>`
|
@@ -8842,8 +8949,10 @@ class binance(Exchange, ImplicitAPI):
|
|
8842
8949
|
def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
8843
8950
|
"""
|
8844
8951
|
fetches historical funding rate prices
|
8845
|
-
|
8846
|
-
|
8952
|
+
|
8953
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-History
|
8954
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Get-Funding-Rate-History-of-Perpetual-Futures
|
8955
|
+
|
8847
8956
|
:param str symbol: unified symbol of the market to fetch the funding rate history for
|
8848
8957
|
:param int [since]: timestamp in ms of the earliest funding rate to fetch
|
8849
8958
|
:param int [limit]: the maximum amount of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>` to fetch
|
@@ -8909,8 +9018,10 @@ class binance(Exchange, ImplicitAPI):
|
|
8909
9018
|
def fetch_funding_rates(self, symbols: Strings = None, params={}) -> FundingRates:
|
8910
9019
|
"""
|
8911
9020
|
fetch the funding rate for multiple markets
|
8912
|
-
|
8913
|
-
|
9021
|
+
|
9022
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price
|
9023
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-and-Mark-Price
|
9024
|
+
|
8914
9025
|
:param str[]|None symbols: list of unified market symbols
|
8915
9026
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
8916
9027
|
:param str [params.subType]: "linear" or "inverse"
|
@@ -9528,10 +9639,12 @@ class binance(Exchange, ImplicitAPI):
|
|
9528
9639
|
def fetch_leverage_tiers(self, symbols: Strings = None, params={}) -> LeverageTiers:
|
9529
9640
|
"""
|
9530
9641
|
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
9531
|
-
|
9532
|
-
|
9533
|
-
|
9534
|
-
|
9642
|
+
|
9643
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Notional-and-Leverage-Brackets
|
9644
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Notional-Bracket-for-Symbol
|
9645
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/UM-Notional-and-Leverage-Brackets
|
9646
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/CM-Notional-and-Leverage-Brackets
|
9647
|
+
|
9535
9648
|
:param str[]|None symbols: list of unified market symbols
|
9536
9649
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
9537
9650
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch the leverage tiers for a portfolio margin account
|
@@ -9600,7 +9713,7 @@ class binance(Exchange, ImplicitAPI):
|
|
9600
9713
|
|
9601
9714
|
def parse_market_leverage_tiers(self, info, market: Market = None) -> List[LeverageTier]:
|
9602
9715
|
"""
|
9603
|
-
|
9716
|
+
@ignore
|
9604
9717
|
:param dict info: Exchange response for 1 market
|
9605
9718
|
:param dict market: CCXT market
|
9606
9719
|
"""
|
@@ -9628,6 +9741,7 @@ class binance(Exchange, ImplicitAPI):
|
|
9628
9741
|
bracket = brackets[j]
|
9629
9742
|
tiers.append({
|
9630
9743
|
'tier': self.safe_number(bracket, 'bracket'),
|
9744
|
+
'symbol': self.safe_symbol(marketId, market),
|
9631
9745
|
'currency': market['quote'],
|
9632
9746
|
'minNotional': self.safe_number_2(bracket, 'notionalFloor', 'qtyFloor'),
|
9633
9747
|
'maxNotional': self.safe_number_2(bracket, 'notionalCap', 'qtyCap'),
|
@@ -9640,7 +9754,9 @@ class binance(Exchange, ImplicitAPI):
|
|
9640
9754
|
def fetch_position(self, symbol: str, params={}):
|
9641
9755
|
"""
|
9642
9756
|
fetch data on an open position
|
9643
|
-
|
9757
|
+
|
9758
|
+
https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
|
9759
|
+
|
9644
9760
|
:param str symbol: unified market symbol of the market the position is held in
|
9645
9761
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
9646
9762
|
:returns dict: a `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
@@ -9681,7 +9797,9 @@ class binance(Exchange, ImplicitAPI):
|
|
9681
9797
|
def fetch_option_positions(self, symbols: Strings = None, params={}):
|
9682
9798
|
"""
|
9683
9799
|
fetch data on open options positions
|
9684
|
-
|
9800
|
+
|
9801
|
+
https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
|
9802
|
+
|
9685
9803
|
:param str[]|None symbols: list of unified market symbols
|
9686
9804
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
9687
9805
|
:returns dict[]: a list of `position structures <https://docs.ccxt.com/#/?id=position-structure>`
|
@@ -9789,14 +9907,17 @@ class binance(Exchange, ImplicitAPI):
|
|
9789
9907
|
def fetch_positions(self, symbols: Strings = None, params={}):
|
9790
9908
|
"""
|
9791
9909
|
fetch all open positions
|
9792
|
-
|
9793
|
-
|
9794
|
-
|
9795
|
-
|
9796
|
-
|
9910
|
+
|
9911
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
9912
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
9913
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2
|
9914
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
|
9915
|
+
https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
|
9916
|
+
|
9797
9917
|
:param str[] [symbols]: list of unified market symbols
|
9798
9918
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
9799
|
-
:param
|
9919
|
+
:param dict [params.params]: extra parameters specific to the exchange API endpoint
|
9920
|
+
:param str [params.method]: method name to call, "positionRisk", "account" or "option", default is "positionRisk"
|
9800
9921
|
:param bool [params.useV2]: set to True if you want to use the obsolete endpoint, where some more additional fields were provided
|
9801
9922
|
:returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
9802
9923
|
"""
|
@@ -9819,13 +9940,15 @@ class binance(Exchange, ImplicitAPI):
|
|
9819
9940
|
|
9820
9941
|
def fetch_account_positions(self, symbols: Strings = None, params={}):
|
9821
9942
|
"""
|
9822
|
-
|
9943
|
+
@ignore
|
9823
9944
|
fetch account positions
|
9824
|
-
|
9825
|
-
|
9826
|
-
|
9827
|
-
|
9828
|
-
|
9945
|
+
|
9946
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
9947
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
9948
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2
|
9949
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
|
9950
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3
|
9951
|
+
|
9829
9952
|
:param str[] [symbols]: list of unified market symbols
|
9830
9953
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
9831
9954
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch positions in a portfolio margin account
|
@@ -9938,13 +10061,15 @@ class binance(Exchange, ImplicitAPI):
|
|
9938
10061
|
|
9939
10062
|
def fetch_positions_risk(self, symbols: Strings = None, params={}):
|
9940
10063
|
"""
|
9941
|
-
|
10064
|
+
@ignore
|
9942
10065
|
fetch positions risk
|
9943
|
-
|
9944
|
-
|
9945
|
-
|
9946
|
-
|
9947
|
-
|
10066
|
+
|
10067
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2
|
10068
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
|
10069
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-UM-Position-Information
|
10070
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-CM-Position-Information
|
10071
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3
|
10072
|
+
|
9948
10073
|
:param str[]|None symbols: list of unified market symbols
|
9949
10074
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
9950
10075
|
:param boolean [params.portfolioMargin]: set to True if you would like to fetch positions for a portfolio margin account
|
@@ -10104,10 +10229,12 @@ class binance(Exchange, ImplicitAPI):
|
|
10104
10229
|
def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
10105
10230
|
"""
|
10106
10231
|
fetch the history of funding payments paid and received on self account
|
10107
|
-
|
10108
|
-
|
10109
|
-
|
10110
|
-
|
10232
|
+
|
10233
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History
|
10234
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Income-History
|
10235
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History
|
10236
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History
|
10237
|
+
|
10111
10238
|
:param str symbol: unified market symbol
|
10112
10239
|
:param int [since]: the earliest time in ms to fetch funding history for
|
10113
10240
|
:param int [limit]: the maximum number of funding history structures to retrieve
|
@@ -10157,10 +10284,12 @@ class binance(Exchange, ImplicitAPI):
|
|
10157
10284
|
def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
10158
10285
|
"""
|
10159
10286
|
set the level of leverage for a market
|
10160
|
-
|
10161
|
-
|
10162
|
-
|
10163
|
-
|
10287
|
+
|
10288
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Initial-Leverage
|
10289
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Initial-Leverage
|
10290
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Initial-Leverage
|
10291
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Initial-Leverage
|
10292
|
+
|
10164
10293
|
:param float leverage: the rate of leverage
|
10165
10294
|
:param str symbol: unified market symbol
|
10166
10295
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -10199,8 +10328,10 @@ class binance(Exchange, ImplicitAPI):
|
|
10199
10328
|
def set_margin_mode(self, marginMode: str, symbol: Str = None, params={}):
|
10200
10329
|
"""
|
10201
10330
|
set margin mode to 'cross' or 'isolated'
|
10202
|
-
|
10203
|
-
|
10331
|
+
|
10332
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Margin-Type
|
10333
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Margin-Type
|
10334
|
+
|
10204
10335
|
:param str marginMode: 'cross' or 'isolated'
|
10205
10336
|
:param str symbol: unified market symbol
|
10206
10337
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -10253,10 +10384,12 @@ class binance(Exchange, ImplicitAPI):
|
|
10253
10384
|
def set_position_mode(self, hedged: bool, symbol: Str = None, params={}):
|
10254
10385
|
"""
|
10255
10386
|
set hedged to True or False for a market
|
10256
|
-
|
10257
|
-
|
10258
|
-
|
10259
|
-
|
10387
|
+
|
10388
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Position-Mode
|
10389
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Position-Mode
|
10390
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Current-Position-Mode
|
10391
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Current-Position-Mode
|
10392
|
+
|
10260
10393
|
:param bool hedged: set to True to use dualSidePosition
|
10261
10394
|
:param str symbol: not used by binance setPositionMode()
|
10262
10395
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -10303,11 +10436,13 @@ class binance(Exchange, ImplicitAPI):
|
|
10303
10436
|
def fetch_leverages(self, symbols: Strings = None, params={}) -> Leverages:
|
10304
10437
|
"""
|
10305
10438
|
fetch the set leverage for all markets
|
10306
|
-
|
10307
|
-
|
10308
|
-
|
10309
|
-
|
10310
|
-
|
10439
|
+
|
10440
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
10441
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
10442
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail
|
10443
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Account-Detail
|
10444
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config
|
10445
|
+
|
10311
10446
|
:param str[] [symbols]: a list of unified market symbols
|
10312
10447
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
10313
10448
|
:param str [params.subType]: "linear" or "inverse"
|
@@ -10370,7 +10505,9 @@ class binance(Exchange, ImplicitAPI):
|
|
10370
10505
|
def fetch_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
10371
10506
|
"""
|
10372
10507
|
fetches historical settlement records
|
10373
|
-
|
10508
|
+
|
10509
|
+
https://developers.binance.com/docs/derivatives/option/market-data/Historical-Exercise-Records
|
10510
|
+
|
10374
10511
|
:param str symbol: unified market symbol of the settlement history
|
10375
10512
|
:param int [since]: timestamp in ms
|
10376
10513
|
:param int [limit]: number of records, default 100, max 100
|
@@ -10410,7 +10547,9 @@ class binance(Exchange, ImplicitAPI):
|
|
10410
10547
|
def fetch_my_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
10411
10548
|
"""
|
10412
10549
|
fetches historical settlement records of the user
|
10413
|
-
|
10550
|
+
|
10551
|
+
https://developers.binance.com/docs/derivatives/option/trade/User-Exercise-Record
|
10552
|
+
|
10414
10553
|
:param str symbol: unified market symbol of the settlement history
|
10415
10554
|
:param int [since]: timestamp in ms
|
10416
10555
|
:param int [limit]: number of records
|
@@ -10539,7 +10678,9 @@ class binance(Exchange, ImplicitAPI):
|
|
10539
10678
|
def fetch_ledger_entry(self, id: str, code: Str = None, params={}) -> LedgerEntry:
|
10540
10679
|
"""
|
10541
10680
|
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
10542
|
-
|
10681
|
+
|
10682
|
+
https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow
|
10683
|
+
|
10543
10684
|
:param str id: the identification number of the ledger entry
|
10544
10685
|
:param str code: unified currency code
|
10545
10686
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -10574,11 +10715,13 @@ class binance(Exchange, ImplicitAPI):
|
|
10574
10715
|
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
10575
10716
|
"""
|
10576
10717
|
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
10577
|
-
|
10578
|
-
|
10579
|
-
|
10580
|
-
|
10581
|
-
|
10718
|
+
|
10719
|
+
https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow
|
10720
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History
|
10721
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Income-History
|
10722
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History
|
10723
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History
|
10724
|
+
|
10582
10725
|
:param str [code]: unified currency code
|
10583
10726
|
:param int [since]: timestamp in ms of the earliest ledger entry
|
10584
10727
|
:param int [limit]: max number of ledger entries to return
|
@@ -11024,8 +11167,10 @@ class binance(Exchange, ImplicitAPI):
|
|
11024
11167
|
def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
11025
11168
|
"""
|
11026
11169
|
remove margin from a position
|
11027
|
-
|
11028
|
-
|
11170
|
+
|
11171
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin
|
11172
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Isolated-Position-Margin
|
11173
|
+
|
11029
11174
|
:param str symbol: unified market symbol
|
11030
11175
|
:param float amount: the amount of margin to remove
|
11031
11176
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -11036,8 +11181,10 @@ class binance(Exchange, ImplicitAPI):
|
|
11036
11181
|
def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
11037
11182
|
"""
|
11038
11183
|
add margin
|
11039
|
-
|
11040
|
-
|
11184
|
+
|
11185
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin
|
11186
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Isolated-Position-Margin
|
11187
|
+
|
11041
11188
|
:param str symbol: unified market symbol
|
11042
11189
|
:param float amount: amount of margin to add
|
11043
11190
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -11048,7 +11195,9 @@ class binance(Exchange, ImplicitAPI):
|
|
11048
11195
|
def fetch_cross_borrow_rate(self, code: str, params={}) -> CrossBorrowRate:
|
11049
11196
|
"""
|
11050
11197
|
fetch the rate of interest to borrow a currency for margin trading
|
11051
|
-
|
11198
|
+
|
11199
|
+
https://developers.binance.com/docs/margin_trading/borrow-and-repay/Query-Margin-Interest-Rate-History
|
11200
|
+
|
11052
11201
|
:param str code: unified currency code
|
11053
11202
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
11054
11203
|
:returns dict: a `borrow rate structure <https://docs.ccxt.com/#/?id=borrow-rate-structure>`
|
@@ -11076,11 +11225,13 @@ class binance(Exchange, ImplicitAPI):
|
|
11076
11225
|
def fetch_isolated_borrow_rate(self, symbol: str, params={}) -> IsolatedBorrowRate:
|
11077
11226
|
"""
|
11078
11227
|
fetch the rate of interest to borrow a currency for margin trading
|
11079
|
-
|
11228
|
+
|
11229
|
+
https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Fee-Data
|
11230
|
+
|
11080
11231
|
:param str symbol: unified market symbol
|
11081
11232
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
11082
|
-
|
11083
|
-
|
11233
|
+
|
11234
|
+
EXCHANGE SPECIFIC PARAMETERS
|
11084
11235
|
:param dict [params.vipLevel]: user's current specific margin data will be returned if viplevel is omitted
|
11085
11236
|
:returns dict: an `isolated borrow rate structure <https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure>`
|
11086
11237
|
"""
|
@@ -11093,11 +11244,13 @@ class binance(Exchange, ImplicitAPI):
|
|
11093
11244
|
def fetch_isolated_borrow_rates(self, params={}) -> IsolatedBorrowRates:
|
11094
11245
|
"""
|
11095
11246
|
fetch the borrow interest rates of all currencies
|
11096
|
-
|
11247
|
+
|
11248
|
+
https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Fee-Data
|
11249
|
+
|
11097
11250
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
11098
11251
|
:param dict [params.symbol]: unified market symbol
|
11099
|
-
|
11100
|
-
|
11252
|
+
|
11253
|
+
EXCHANGE SPECIFIC PARAMETERS
|
11101
11254
|
:param dict [params.vipLevel]: user's current specific margin data will be returned if viplevel is omitted
|
11102
11255
|
:returns dict: a `borrow rate structure <https://docs.ccxt.com/#/?id=borrow-rate-structure>`
|
11103
11256
|
"""
|
@@ -11135,7 +11288,9 @@ class binance(Exchange, ImplicitAPI):
|
|
11135
11288
|
def fetch_borrow_rate_history(self, code: str, since: Int = None, limit: Int = None, params={}):
|
11136
11289
|
"""
|
11137
11290
|
retrieves a history of a currencies borrow interest rate at specific time slots
|
11138
|
-
|
11291
|
+
|
11292
|
+
https://developers.binance.com/docs/margin_trading/borrow-and-repay/Query-Margin-Interest-Rate-History
|
11293
|
+
|
11139
11294
|
:param str code: unified currency code
|
11140
11295
|
:param int [since]: timestamp for the earliest borrow rate
|
11141
11296
|
:param int [limit]: the maximum number of `borrow rate structures <https://docs.ccxt.com/#/?id=borrow-rate-structure>` to retrieve
|
@@ -11231,7 +11386,9 @@ class binance(Exchange, ImplicitAPI):
|
|
11231
11386
|
def create_gift_code(self, code: str, amount, params={}):
|
11232
11387
|
"""
|
11233
11388
|
create gift code
|
11234
|
-
|
11389
|
+
|
11390
|
+
https://developers.binance.com/docs/gift_card/market-data/Create-a-single-token-gift-card
|
11391
|
+
|
11235
11392
|
:param str code: gift code
|
11236
11393
|
:param float amount: amount of currency for the gift
|
11237
11394
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -11267,7 +11424,9 @@ class binance(Exchange, ImplicitAPI):
|
|
11267
11424
|
def redeem_gift_code(self, giftcardCode, params={}):
|
11268
11425
|
"""
|
11269
11426
|
redeem gift code
|
11270
|
-
|
11427
|
+
|
11428
|
+
https://developers.binance.com/docs/gift_card/market-data/Redeem-a-Binance-Gift-Card
|
11429
|
+
|
11271
11430
|
:param str giftcardCode:
|
11272
11431
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
11273
11432
|
:returns dict: response from the exchange
|
@@ -11292,7 +11451,9 @@ class binance(Exchange, ImplicitAPI):
|
|
11292
11451
|
def verify_gift_code(self, id: str, params={}):
|
11293
11452
|
"""
|
11294
11453
|
verify gift code
|
11295
|
-
|
11454
|
+
|
11455
|
+
https://developers.binance.com/docs/gift_card/market-data/Verify-Binance-Gift-Card-by-Gift-Card-Number
|
11456
|
+
|
11296
11457
|
:param str id: reference number id
|
11297
11458
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
11298
11459
|
:returns dict: response from the exchange
|
@@ -11314,8 +11475,10 @@ class binance(Exchange, ImplicitAPI):
|
|
11314
11475
|
def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[BorrowInterest]:
|
11315
11476
|
"""
|
11316
11477
|
fetch the interest owed by the user for borrowing currency for margin trading
|
11317
|
-
|
11318
|
-
|
11478
|
+
|
11479
|
+
https://developers.binance.com/docs/margin_trading/borrow-and-repay/Get-Interest-History
|
11480
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Margin-BorrowLoan-Interest-History
|
11481
|
+
|
11319
11482
|
:param str [code]: unified currency code
|
11320
11483
|
:param str [symbol]: unified market symbol when fetch interest in isolated markets
|
11321
11484
|
:param int [since]: the earliest time in ms to fetch borrrow interest for
|
@@ -11404,9 +11567,11 @@ class binance(Exchange, ImplicitAPI):
|
|
11404
11567
|
def repay_cross_margin(self, code: str, amount, params={}):
|
11405
11568
|
"""
|
11406
11569
|
repay borrowed margin and interest
|
11407
|
-
|
11408
|
-
|
11409
|
-
|
11570
|
+
|
11571
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay
|
11572
|
+
https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
11573
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay-Debt
|
11574
|
+
|
11410
11575
|
:param str code: unified currency code of the currency to repay
|
11411
11576
|
:param float amount: the amount to repay
|
11412
11577
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -11461,7 +11626,9 @@ class binance(Exchange, ImplicitAPI):
|
|
11461
11626
|
def repay_isolated_margin(self, symbol: str, code: str, amount, params={}):
|
11462
11627
|
"""
|
11463
11628
|
repay borrowed margin and interest
|
11464
|
-
|
11629
|
+
|
11630
|
+
https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
11631
|
+
|
11465
11632
|
:param str symbol: unified market symbol, required for isolated margin
|
11466
11633
|
:param str code: unified currency code of the currency to repay
|
11467
11634
|
:param float amount: the amount to repay
|
@@ -11490,8 +11657,10 @@ class binance(Exchange, ImplicitAPI):
|
|
11490
11657
|
def borrow_cross_margin(self, code: str, amount: float, params={}):
|
11491
11658
|
"""
|
11492
11659
|
create a loan to borrow margin
|
11493
|
-
|
11494
|
-
|
11660
|
+
|
11661
|
+
https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
11662
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Borrow
|
11663
|
+
|
11495
11664
|
:param str code: unified currency code of the currency to borrow
|
11496
11665
|
:param float amount: the amount to borrow
|
11497
11666
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -11524,7 +11693,9 @@ class binance(Exchange, ImplicitAPI):
|
|
11524
11693
|
def borrow_isolated_margin(self, symbol: str, code: str, amount: float, params={}):
|
11525
11694
|
"""
|
11526
11695
|
create a loan to borrow margin
|
11527
|
-
|
11696
|
+
|
11697
|
+
https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
11698
|
+
|
11528
11699
|
:param str symbol: unified market symbol, required for isolated margin
|
11529
11700
|
:param str code: unified currency code of the currency to borrow
|
11530
11701
|
:param float amount: the amount to borrow
|
@@ -11582,8 +11753,10 @@ class binance(Exchange, ImplicitAPI):
|
|
11582
11753
|
def fetch_open_interest_history(self, symbol: str, timeframe='5m', since: Int = None, limit: Int = None, params={}):
|
11583
11754
|
"""
|
11584
11755
|
Retrieves the open interest history of a currency
|
11585
|
-
|
11586
|
-
|
11756
|
+
|
11757
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest-Statistics
|
11758
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Open-Interest-Statistics
|
11759
|
+
|
11587
11760
|
:param str symbol: Unified CCXT market symbol
|
11588
11761
|
:param str timeframe: "5m","15m","30m","1h","2h","4h","6h","12h", or "1d"
|
11589
11762
|
:param int [since]: the time(ms) of the earliest record to retrieve unix timestamp
|
@@ -11643,9 +11816,11 @@ class binance(Exchange, ImplicitAPI):
|
|
11643
11816
|
def fetch_open_interest(self, symbol: str, params={}):
|
11644
11817
|
"""
|
11645
11818
|
retrieves the open interest of a contract trading pair
|
11646
|
-
|
11647
|
-
|
11648
|
-
|
11819
|
+
|
11820
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest
|
11821
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Open-Interest
|
11822
|
+
https://developers.binance.com/docs/derivatives/option/market-data/Open-Interest
|
11823
|
+
|
11649
11824
|
:param str symbol: unified CCXT market symbol
|
11650
11825
|
:param dict [params]: exchange specific parameters
|
11651
11826
|
:returns dict} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure:
|
@@ -11729,11 +11904,13 @@ class binance(Exchange, ImplicitAPI):
|
|
11729
11904
|
def fetch_my_liquidations(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
11730
11905
|
"""
|
11731
11906
|
retrieves the users liquidated positions
|
11732
|
-
|
11733
|
-
|
11734
|
-
|
11735
|
-
|
11736
|
-
|
11907
|
+
|
11908
|
+
https://developers.binance.com/docs/margin_trading/trade/Get-Force-Liquidation-Record
|
11909
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders
|
11910
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Users-Force-Orders
|
11911
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-UM-Force-Orders
|
11912
|
+
https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-CM-Force-Orders
|
11913
|
+
|
11737
11914
|
:param str [symbol]: unified CCXT market symbol
|
11738
11915
|
:param int [since]: the earliest time in ms to fetch liquidations for
|
11739
11916
|
:param int [limit]: the maximum number of liquidation structures to retrieve
|
@@ -11958,7 +12135,9 @@ class binance(Exchange, ImplicitAPI):
|
|
11958
12135
|
def fetch_greeks(self, symbol: str, params={}) -> Greeks:
|
11959
12136
|
"""
|
11960
12137
|
fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
|
11961
|
-
|
12138
|
+
|
12139
|
+
https://developers.binance.com/docs/derivatives/option/market-data/Option-Mark-Price
|
12140
|
+
|
11962
12141
|
:param str symbol: unified symbol of the market to fetch greeks for
|
11963
12142
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
11964
12143
|
:returns dict: a `greeks structure <https://docs.ccxt.com/#/?id=greeks-structure>`
|
@@ -12042,8 +12221,10 @@ class binance(Exchange, ImplicitAPI):
|
|
12042
12221
|
def fetch_position_mode(self, symbol: Str = None, params={}):
|
12043
12222
|
"""
|
12044
12223
|
fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets
|
12045
|
-
|
12046
|
-
|
12224
|
+
|
12225
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Position-Mode
|
12226
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Current-Position-Mode
|
12227
|
+
|
12047
12228
|
:param str symbol: unified symbol of the market to fetch the order book for
|
12048
12229
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
12049
12230
|
:param str [params.subType]: "linear" or "inverse"
|
@@ -12075,10 +12256,12 @@ class binance(Exchange, ImplicitAPI):
|
|
12075
12256
|
def fetch_margin_modes(self, symbols: Strings = None, params={}) -> MarginModes:
|
12076
12257
|
"""
|
12077
12258
|
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
|
12078
|
-
|
12079
|
-
|
12080
|
-
|
12081
|
-
|
12259
|
+
|
12260
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
12261
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
12262
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config
|
12263
|
+
|
12264
|
+
:param str[] symbols: unified market symbols
|
12082
12265
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
12083
12266
|
:param str [params.subType]: "linear" or "inverse"
|
12084
12267
|
:returns dict: a list of `margin mode structures <https://docs.ccxt.com/#/?id=margin-mode-structure>`
|
@@ -12161,6 +12344,46 @@ class binance(Exchange, ImplicitAPI):
|
|
12161
12344
|
assets = response
|
12162
12345
|
return self.parse_margin_modes(assets, symbols, 'symbol', 'swap')
|
12163
12346
|
|
12347
|
+
def fetch_margin_mode(self, symbol: str, params={}) -> MarginMode:
|
12348
|
+
"""
|
12349
|
+
fetches the margin mode of a specific symbol
|
12350
|
+
|
12351
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config
|
12352
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
12353
|
+
|
12354
|
+
:param str symbol: unified symbol of the market the order was made in
|
12355
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
12356
|
+
:param str [params.subType]: "linear" or "inverse"
|
12357
|
+
:returns dict: a `margin mode structure <https://docs.ccxt.com/#/?id=margin-mode-structure>`
|
12358
|
+
"""
|
12359
|
+
self.load_markets()
|
12360
|
+
market = self.market(symbol)
|
12361
|
+
subType = None
|
12362
|
+
subType, params = self.handle_sub_type_and_params('fetchMarginMode', market, params)
|
12363
|
+
response = None
|
12364
|
+
if subType == 'linear':
|
12365
|
+
request: dict = {
|
12366
|
+
'symbol': market['id'],
|
12367
|
+
}
|
12368
|
+
response = self.fapiPrivateGetSymbolConfig(self.extend(request, params))
|
12369
|
+
#
|
12370
|
+
# [
|
12371
|
+
# {
|
12372
|
+
# "symbol": "BTCUSDT",
|
12373
|
+
# "marginType": "CROSSED",
|
12374
|
+
# "isAutoAddMargin": "false",
|
12375
|
+
# "leverage": 21,
|
12376
|
+
# "maxNotionalValue": "1000000",
|
12377
|
+
# }
|
12378
|
+
# ]
|
12379
|
+
#
|
12380
|
+
elif subType == 'inverse':
|
12381
|
+
fetchMarginModesResponse = self.fetch_margin_modes([symbol], params)
|
12382
|
+
return fetchMarginModesResponse[symbol]
|
12383
|
+
else:
|
12384
|
+
raise BadRequest(self.id + ' fetchMarginMode() supports linear and inverse subTypes only')
|
12385
|
+
return self.parse_margin_mode(response[0], market)
|
12386
|
+
|
12164
12387
|
def parse_margin_mode(self, marginMode: dict, market=None) -> MarginMode:
|
12165
12388
|
marketId = self.safe_string(marginMode, 'symbol')
|
12166
12389
|
market = self.safe_market(marketId, market)
|
@@ -12180,7 +12403,9 @@ class binance(Exchange, ImplicitAPI):
|
|
12180
12403
|
def fetch_option(self, symbol: str, params={}) -> Option:
|
12181
12404
|
"""
|
12182
12405
|
fetches option data that is commonly found in an option chain
|
12183
|
-
|
12406
|
+
|
12407
|
+
https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics
|
12408
|
+
|
12184
12409
|
:param str symbol: unified market symbol
|
12185
12410
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
12186
12411
|
:returns dict: an `option chain structure <https://docs.ccxt.com/#/?id=option-chain-structure>`
|
@@ -12266,8 +12491,10 @@ class binance(Exchange, ImplicitAPI):
|
|
12266
12491
|
def fetch_margin_adjustment_history(self, symbol: Str = None, type: Str = None, since: Num = None, limit: Num = None, params={}) -> List[MarginModification]:
|
12267
12492
|
"""
|
12268
12493
|
fetches the history of margin added or reduced from contract isolated positions
|
12269
|
-
|
12270
|
-
|
12494
|
+
|
12495
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Position-Margin-Change-History
|
12496
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Get-Position-Margin-Change-History
|
12497
|
+
|
12271
12498
|
:param str symbol: unified market symbol
|
12272
12499
|
:param str [type]: "add" or "reduce"
|
12273
12500
|
:param int [since]: timestamp in ms of the earliest change to fetch
|
@@ -12321,7 +12548,9 @@ class binance(Exchange, ImplicitAPI):
|
|
12321
12548
|
def fetch_convert_currencies(self, params={}) -> Currencies:
|
12322
12549
|
"""
|
12323
12550
|
fetches all available currencies that can be converted
|
12324
|
-
|
12551
|
+
|
12552
|
+
https://developers.binance.com/docs/convert/market-data/Query-order-quantity-precision-per-asset
|
12553
|
+
|
12325
12554
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
12326
12555
|
:returns dict: an associative dictionary of currencies
|
12327
12556
|
"""
|
@@ -12373,7 +12602,9 @@ class binance(Exchange, ImplicitAPI):
|
|
12373
12602
|
def fetch_convert_quote(self, fromCode: str, toCode: str, amount: Num = None, params={}) -> Conversion:
|
12374
12603
|
"""
|
12375
12604
|
fetch a quote for converting from one currency to another
|
12376
|
-
|
12605
|
+
|
12606
|
+
https://developers.binance.com/docs/convert/trade/Send-quote-request
|
12607
|
+
|
12377
12608
|
:param str fromCode: the currency that you want to sell and convert from
|
12378
12609
|
:param str toCode: the currency that you want to buy and convert into
|
12379
12610
|
:param float amount: how much you want to trade in units of the from currency
|
@@ -12407,7 +12638,9 @@ class binance(Exchange, ImplicitAPI):
|
|
12407
12638
|
def create_convert_trade(self, id: str, fromCode: str, toCode: str, amount: Num = None, params={}) -> Conversion:
|
12408
12639
|
"""
|
12409
12640
|
convert from one currency to another
|
12410
|
-
|
12641
|
+
|
12642
|
+
https://developers.binance.com/docs/convert/trade/Accept-Quote
|
12643
|
+
|
12411
12644
|
:param str id: the id of the trade that you want to make
|
12412
12645
|
:param str fromCode: the currency that you want to sell and convert from
|
12413
12646
|
:param str toCode: the currency that you want to buy and convert into
|
@@ -12449,7 +12682,9 @@ class binance(Exchange, ImplicitAPI):
|
|
12449
12682
|
def fetch_convert_trade(self, id: str, code: Str = None, params={}) -> Conversion:
|
12450
12683
|
"""
|
12451
12684
|
fetch the data for a conversion trade
|
12452
|
-
|
12685
|
+
|
12686
|
+
https://developers.binance.com/docs/convert/trade/Order-Status
|
12687
|
+
|
12453
12688
|
:param str id: the id of the trade that you want to fetch
|
12454
12689
|
:param str [code]: the unified currency code of the conversion trade
|
12455
12690
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -12519,7 +12754,9 @@ class binance(Exchange, ImplicitAPI):
|
|
12519
12754
|
def fetch_convert_trade_history(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Conversion]:
|
12520
12755
|
"""
|
12521
12756
|
fetch the users history of conversion trades
|
12522
|
-
|
12757
|
+
|
12758
|
+
https://developers.binance.com/docs/convert/trade/Get-Convert-Trade-History
|
12759
|
+
|
12523
12760
|
:param str [code]: the unified currency code
|
12524
12761
|
:param int [since]: the earliest time in ms to fetch conversions for
|
12525
12762
|
:param int [limit]: the maximum number of conversion structures to retrieve
|
@@ -12698,8 +12935,10 @@ class binance(Exchange, ImplicitAPI):
|
|
12698
12935
|
def fetch_funding_intervals(self, symbols: Strings = None, params={}) -> FundingRates:
|
12699
12936
|
"""
|
12700
12937
|
fetch the funding rate interval for multiple markets
|
12701
|
-
|
12702
|
-
|
12938
|
+
|
12939
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Info
|
12940
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Get-Funding-Info
|
12941
|
+
|
12703
12942
|
:param str[] [symbols]: list of unified market symbols
|
12704
12943
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
12705
12944
|
:param str [params.subType]: "linear" or "inverse"
|
@@ -12737,8 +12976,10 @@ class binance(Exchange, ImplicitAPI):
|
|
12737
12976
|
def fetch_long_short_ratio_history(self, symbol: Str = None, timeframe: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LongShortRatio]:
|
12738
12977
|
"""
|
12739
12978
|
fetches the long short ratio history for a unified market symbol
|
12740
|
-
|
12741
|
-
|
12979
|
+
|
12980
|
+
https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Long-Short-Ratio
|
12981
|
+
https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Long-Short-Ratio
|
12982
|
+
|
12742
12983
|
:param str symbol: unified symbol of the market to fetch the long short ratio for
|
12743
12984
|
:param str [timeframe]: the period for the ratio, default is 24 hours
|
12744
12985
|
:param int [since]: the earliest time in ms to fetch ratios for
|