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

Method parse_position

python/ccxt/gate.py:5742–5875  ·  view source on GitHub ↗
(self, position: dict, market: Market = None)

Source from the content-addressed store, hash-verified

5740 return response
5741
5742 def parse_position(self, position: dict, market: Market = None):
5743 #
5744 # swap and future
5745 #
5746 # {
5747 # "value": "4.60516",
5748 # "leverage": "0",
5749 # "mode": "single",
5750 # "realised_point": "0",
5751 # "contract": "BTC_USDT",
5752 # "entry_price": "46030.3",
5753 # "mark_price": "46051.6",
5754 # "history_point": "0",
5755 # "realised_pnl": "-0.002301515",
5756 # "close_order": null,
5757 # "size": 1,
5758 # "cross_leverage_limit": "0",
5759 # "pending_orders": 0,
5760 # "adl_ranking": 5,
5761 # "maintenance_rate": "0.004",
5762 # "unrealised_pnl": "0.00213",
5763 # "user": 5691076,
5764 # "leverage_max": "125",
5765 # "history_pnl": "0",
5766 # "risk_limit": "1000000",
5767 # "margin": "8.997698485",
5768 # "last_close_pnl": "0",
5769 # "liq_price": "0",
5770 # "update_time": 1705034246,
5771 # "update_id": 1,
5772 # "initial_margin": "0",
5773 # "maintenance_margin": "0",
5774 # "open_time": 1705034246,
5775 # "trade_max_size": "0"
5776 # }
5777 #
5778 # option
5779 #
5780 # {
5781 # "close_order": null,
5782 # "size": 1,
5783 # "vega": "5.29756",
5784 # "theta": "-98.98917",
5785 # "gamma": "0.00056",
5786 # "delta": "0.68691",
5787 # "contract": "BTC_USDT-20230602-26500-C",
5788 # "entry_price": "529",
5789 # "unrealised_pnl": "-1.0131",
5790 # "user": 5691076,
5791 # "mark_price": "427.69",
5792 # "underlying_price": "26810.2",
5793 # "underlying": "BTC_USDT",
5794 # "realised_pnl": "-0.08042877",
5795 # "mark_iv": "0.4224",
5796 # "pending_orders": 0
5797 # }
5798 #
5799 # fetchPositionsHistory(swap and future)

Callers 1

fetch_positionMethod · 0.95

Calls 15

safe_marketMethod · 0.95
safe_stringMethod · 0.80
safe_string_2Method · 0.80
string_gtMethod · 0.80
string_ltMethod · 0.80
string_mulMethod · 0.80
string_addMethod · 0.80
string_divMethod · 0.80
safe_timestamp_2Method · 0.80
safe_positionMethod · 0.80
parse_numberMethod · 0.80
safe_numberMethod · 0.80

Tested by

no test coverage detected