MCPcopy Create free account
hub / github.com/ccxt/ccxt / fetch_leverages

Method fetch_leverages

python/ccxt/aster.py:2807–2840  ·  view source on GitHub ↗

fetch the set leverage for all markets https://asterdex.github.io/aster-api-website/futures-v3/account%26trades/#position-information-v3-user_data :param str[] [symbols]: a list of unified market symbols :param dict [params]: extra parameters specific to the exchan

(self, symbols: Strings = None, params={})

Source from the content-addressed store, hash-verified

2805 return response
2806
2807 def fetch_leverages(self, symbols: Strings = None, params={}) -> Leverages:
2808 """
2809 fetch the set leverage for all markets
2810
2811 https://asterdex.github.io/aster-api-website/futures-v3/account%26trades/#position-information-v3-user_data
2812
2813 :param str[] [symbols]: a list of unified market symbols
2814 :param dict [params]: extra parameters specific to the exchange API endpoint
2815 :returns dict: a list of `leverage structures <https://docs.ccxt.com/?id=leverage-structure>`
2816 """
2817 self.load_markets_and_sign_in()
2818 response = self.fapiPrivateGetV3PositionRisk(params)
2819 #
2820 # [
2821 # {
2822 # "symbol": "INJUSDT",
2823 # "positionAmt": "0.0",
2824 # "entryPrice": "0.0",
2825 # "markPrice": "0.00000000",
2826 # "unRealizedProfit": "0.00000000",
2827 # "liquidationPrice": "0",
2828 # "leverage": "20",
2829 # "maxNotionalValue": "25000",
2830 # "marginType": "cross",
2831 # "isolatedMargin": "0.00000000",
2832 # "isAutoAddMargin": "false",
2833 # "positionSide": "BOTH",
2834 # "notional": "0",
2835 # "isolatedWallet": "0",
2836 # "updateTime": 0
2837 # }
2838 # ]
2839 #
2840 return self.parse_leverages(response, symbols, 'symbol')
2841
2842 def parse_leverage(self, leverage: dict, market: Market = None) -> Leverage:
2843 #

Callers

nothing calls this directly

Calls 3

parse_leveragesMethod · 0.80

Tested by

no test coverage detected