Skip to main content
GET
/
v2
/
global_markets_perps
/
activity
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_activity(owner="0x01E62835dd7F52173546A325294762143eE4a882")

    # Handle response
    print(res)
{
  "account_value": "1058.32",
  "builder_approval": {
    "approved": true,
    "builder": "0x42e1A5b3F1a17d9B2bC0c5d3f3aFf0d27e1c3Fa0",
    "max_fee_tenth_bps": 50
  },
  "fills": [
    {
      "asset": "AAPL",
      "builder_fee": "0.1062",
      "closed_pnl": "0",
      "fee": "0.5310",
      "order_id": 9182734102,
      "price": "212.40",
      "side": "buy",
      "size": "5.00",
      "time_ms": 1747010983250
    }
  ],
  "open_orders": [
    {
      "asset": "GOLD",
      "limit_price": "2450.00",
      "order_id": 9182734201,
      "reduce_only": false,
      "side": "sell",
      "size": "0.500",
      "time_ms": 1747011100000
    }
  ],
  "owner": "0x1F31bAad9e2adC1Dc8B0FF8B0c2cF7D0e7d1A8c9",
  "partial_errors": [],
  "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"
}

Documentation Index

Fetch the complete documentation index at: https://docs.compasslabs.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Query Parameters

owner
string
default:0x01E62835dd7F52173546A325294762143eE4a882
required

End-user EOA whose activity should be fetched.

builder
string | null

Optional builder address. When provided, the response includes the current builder-fee approval state for this (owner, builder) pair.

Response

Successful Response

Aggregated HL activity for a single end-user.

Any section may be null if its upstream HL call failed — see partial_errors for details. positions/fills/open_orders are always either a populated list or null; an empty list means the user has no activity of that type, not a failure.

owner
string
required

Owner address that was queried (checksummed)

positions
GlobalMarketsPerpsPosition · object[] | null
required

Open positions (null if the upstream call failed)

account_value
string | null
required

Total account value in USDC (null if positions failed)

withdrawable
string | null
required

Withdrawable USDC balance (null if positions failed)

fills
GlobalMarketsPerpsFill · object[] | null
required

Recent fills (null if the upstream call failed)

open_orders
GlobalMarketsPerpsOpenOrder · object[] | null
required

Resting orders (null if the upstream call failed)

builder_approval
GlobalMarketsPerpsBuilderApproval · object

Builder approval state — only present when the builder query parameter was supplied (null on upstream failure).

partial_errors
GlobalMarketsPerpsActivityPartialError · object[]

One entry per section that failed to load.