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

Method parse_margin_modification

python/ccxt/gate.py:6658–6700  ·  view source on GitHub ↗
(self, data: dict, market: Market = None)

Source from the content-addressed store, hash-verified

6656 return self.parse_margin_modification(response, market)
6657
6658 def parse_margin_modification(self, data: dict, market: Market = None) -> MarginModification:
6659 #
6660 # {
6661 # "value": "11.9257",
6662 # "leverage": "5",
6663 # "mode": "single",
6664 # "realised_point": "0",
6665 # "contract": "ETH_USDT",
6666 # "entry_price": "1203.45",
6667 # "mark_price": "1192.57",
6668 # "history_point": "0",
6669 # "realised_pnl": "-0.00577656",
6670 # "close_order": null,
6671 # "size": "1",
6672 # "cross_leverage_limit": "0",
6673 # "pending_orders": "0",
6674 # "adl_ranking": "5",
6675 # "maintenance_rate": "0.005",
6676 # "unrealised_pnl": "-0.1088",
6677 # "user": "1486602",
6678 # "leverage_max": "100",
6679 # "history_pnl": "0",
6680 # "risk_limit": "1000000",
6681 # "margin": "5.415925875",
6682 # "last_close_pnl": "0",
6683 # "liq_price": "665.69"
6684 # }
6685 #
6686 contract = self.safe_string(data, 'contract')
6687 market = self.safe_market(contract, market, '_', 'contract')
6688 total = self.safe_number(data, 'margin')
6689 return {
6690 'info': data,
6691 'symbol': market['symbol'],
6692 'type': None,
6693 'marginMode': 'isolated',
6694 'amount': None,
6695 'total': total,
6696 'code': self.safe_value(market, 'quote'),
6697 'status': 'ok',
6698 'timestamp': None,
6699 'datetime': None,
6700 }
6701
6702 def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
6703 """

Callers 1

modify_margin_helperMethod · 0.95

Calls 4

safe_marketMethod · 0.95
safe_stringMethod · 0.80
safe_numberMethod · 0.80
safe_valueMethod · 0.80

Tested by

no test coverage detected