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

Method fetch_margin_modes

python/ccxt/grvt.py:2389–2416  ·  view source on GitHub ↗

fetches margin mode of the user https://api-docs.grvt.io/trading_api/#get-all-initial-leverage :param str[] symbols: unified market symbols :param dict [params]: extra parameters specific to the exchange API endpoint :returns dict: a list of `margin mode st

(self, symbols: List[Str] = None, params={})

Source from the content-addressed store, hash-verified

2387 }
2388
2389 def fetch_margin_modes(self, symbols: List[Str] = None, params={}) -> MarginModes:
2390 """
2391 fetches margin mode of the user
2392
2393 https://api-docs.grvt.io/trading_api/#get-all-initial-leverage
2394
2395 :param str[] symbols: unified market symbols
2396 :param dict [params]: extra parameters specific to the exchange API endpoint
2397 :returns dict: a list of `margin mode structures <https://docs.ccxt.com/?id=margin-mode-structure>`
2398 """
2399 self.load_markets_and_sign_in()
2400 request = {
2401 'sub_account_id': self.get_sub_account_id(params),
2402 }
2403 response = self.privateTradingPostFullV1GetAllInitialLeverage(self.extend(request, params))
2404 #
2405 # {
2406 # "results": [
2407 # {
2408 # "instrument": "AAVE_USDT_Perp",
2409 # "leverage": "10.0",
2410 # "min_leverage": "1.0",
2411 # "max_leverage": "50.0",
2412 # "margin_type": "CROSS"
2413 # },
2414 #
2415 results = self.safe_list(response, 'results', [])
2416 return self.parse_leverages(results, symbols)
2417
2418 def parse_margin_mode(self, marginMode: dict, market=None) -> MarginMode:
2419 #

Callers

nothing calls this directly

Calls 6

get_sub_account_idMethod · 0.95
safe_listMethod · 0.80
parse_leveragesMethod · 0.80
extendMethod · 0.45

Tested by

no test coverage detected