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

Method set_margin_mode

python/ccxt/async_support/pacifica.py:2387–2415  ·  view source on GitHub ↗

set margin mode(symbol) https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-margin-mode :param str marginMode: margin mode must be either [isolated, cross] :param str symbol: unified market symbol of the market the position is held in, default is

(self, marginMode: str, symbol: Str = None, params={})

Source from the content-addressed store, hash-verified

2385 })
2386
2387 async def set_margin_mode(self, marginMode: str, symbol: Str = None, params={}):
2388 """
2389 set margin mode(symbol)
2390
2391 https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-margin-mode
2392
2393 :param str marginMode: margin mode must be either [isolated, cross]
2394 :param str symbol: unified market symbol of the market the position is held in, default is None
2395 :param dict [params]: extra parameters specific to the exchange API endpoint
2396 :param int [params.expiryWindow]: time to live in milliseconds
2397 :returns dict: response from the exchange
2398 """
2399 operationType = 'update_margin_mode'
2400 if symbol is None:
2401 raise ArgumentsRequired(self.id + ' setMarginMode() requires a symbol argument')
2402 await self.load_markets()
2403 market = self.market(symbol)
2404 isIsolated = (marginMode == 'isolated')
2405 sigPayload = {
2406 'symbol': market['id'],
2407 'is_isolated': isIsolated,
2408 }
2409 request = self.post_action_request(operationType, sigPayload, params)
2410 params = self.omit(params, ['expiryWindow'])
2411 response = await self.privatePostAccountMargin(request)
2412 # {
2413 # "success": True
2414 # }
2415 return response
2416
2417 async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
2418 """

Callers

nothing calls this directly

Calls 6

post_action_requestMethod · 0.95
ArgumentsRequiredClass · 0.90
load_marketsMethod · 0.45
marketMethod · 0.45
omitMethod · 0.45

Tested by

no test coverage detected