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

Method parse_position

python/ccxt/coinbase.py:4593–4726  ·  view source on GitHub ↗
(self, position: dict, market: Market = None)

Source from the content-addressed store, hash-verified

4591 return self.parse_position(position, market)
4592
4593 def parse_position(self, position: dict, market: Market = None):
4594 #
4595 # {
4596 # "product_id": "1r4njf84-0-0",
4597 # "product_uuid": "cd34c18b-3665-4ed8-9305-3db277c49fc5",
4598 # "symbol": "ADA-PERP-INTX",
4599 # "vwap": {
4600 # "value": "0.6171",
4601 # "currency": "USDC"
4602 # },
4603 # "position_side": "POSITION_SIDE_LONG",
4604 # "net_size": "20",
4605 # "buy_order_size": "0",
4606 # "sell_order_size": "0",
4607 # "im_contribution": "0.1",
4608 # "unrealized_pnl": {
4609 # "value": "0.074",
4610 # "currency": "USDC"
4611 # },
4612 # "mark_price": {
4613 # "value": "0.6208",
4614 # "currency": "USDC"
4615 # },
4616 # "liquidation_price": {
4617 # "value": "0",
4618 # "currency": "USDC"
4619 # },
4620 # "leverage": "1",
4621 # "im_notional": {
4622 # "value": "12.342",
4623 # "currency": "USDC"
4624 # },
4625 # "mm_notional": {
4626 # "value": "0.814572",
4627 # "currency": "USDC"
4628 # },
4629 # "position_notional": {
4630 # "value": "12.342",
4631 # "currency": "USDC"
4632 # },
4633 # "margin_type": "MARGIN_TYPE_CROSS",
4634 # "liquidation_buffer": "19.677828",
4635 # "liquidation_percentage": "4689.3506",
4636 # "portfolio_summary": {
4637 # "portfolio_uuid": "018ebd63-1f6d-7c8e-ada9-0761c5a2235f",
4638 # "collateral": "20.4184",
4639 # "position_notional": "12.342",
4640 # "open_position_notional": "12.342",
4641 # "pending_fees": "0",
4642 # "borrow": "0",
4643 # "accrued_interest": "0",
4644 # "rolling_debt": "0",
4645 # "portfolio_initial_margin": "0.1",
4646 # "portfolio_im_notional": {
4647 # "value": "12.342",
4648 # "currency": "USDC"
4649 # },
4650 # "portfolio_maintenance_margin": "0.066",

Callers 1

fetch_positionMethod · 0.95

Calls 6

safe_stringMethod · 0.80
safe_dictMethod · 0.80
safe_numberMethod · 0.80
safe_positionMethod · 0.80
safe_symbolMethod · 0.80
safe_marketMethod · 0.45

Tested by

no test coverage detected