Skip to main content
GET
/
v2
/
global_markets_perps
/
positions
Python (SDK)
from compass_api_sdk import CompassAPI


with CompassAPI(
    api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:

    res = compass_api.global_markets_perps.global_markets_perps_positions(owner="0x06A9aF046187895AcFc7258450B15397CAc67400")

    # Handle response
    print(res)
{
  "account_value": "1058.32",
  "positions": [
    {
      "asset": "AAPL",
      "asset_id": 12,
      "entry_price": "212.40",
      "funding_accrued": "-0.12",
      "leverage": "3",
      "liquidation_price": "180.12",
      "margin_used": "354.00",
      "mark_price": "213.88",
      "side": "long",
      "size": "5.00",
      "unrealized_pnl": "7.40"
    }
  ],
  "withdrawable": "704.32"
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Query Parameters

owner
string
default:0x06A9aF046187895AcFc7258450B15397CAc67400
required

User's EOA address (looks up their global markets perps product account)

asset
string | null

Filter to a specific asset ticker (e.g. AAPL)

Response

Successful Response

List of open global markets perps positions with account balance.

positions
GlobalMarketsPerpsPosition · object[]
required

Open perpetual futures positions

account_value
string
default:0

Total account value in USD (margin + unrealized PnL)

withdrawable
string
default:0

Available USDC balance (withdrawable margin)