Skip to main content
POST
/
v2
/
global_markets_perps
/
limit_order
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_limit_order(owner="0x06A9aF046187895AcFc7258450B15397CAc67400", asset="AAPL", side="buy", size="10.0", price="190.00", time_in_force="gtc", reduce_only=False)

    # Handle response
    print(res)
{
  "action": {
    "grouping": "na",
    "orders": [
      {
        "a": 12,
        "b": true,
        "p": "213.50",
        "r": false,
        "s": "5.00",
        "t": {
          "limit": {
            "tif": "Gtc"
          }
        }
      }
    ],
    "type": "order"
  },
  "nonce": 1747010983250,
  "typed_data": {
    "domain": {
      "chainId": 1337,
      "name": "Exchange",
      "verifyingContract": "0x0000000000000000000000000000000000000000",
      "version": "1"
    },
    "message": {
      "connectionId": "0xc4e1f04d6b1bf2f2f7a6c0e8a5f3b1d2c9e0a4b7d1c3e5f7a9b1d3e5f7a9e9a2",
      "source": "a"
    },
    "primaryType": "Agent",
    "types": {
      "Agent": [
        {
          "name": "source",
          "type": "string"
        },
        {
          "name": "connectionId",
          "type": "bytes32"
        }
      ],
      "EIP712Domain": [
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "version",
          "type": "string"
        },
        {
          "name": "chainId",
          "type": "uint256"
        },
        {
          "name": "verifyingContract",
          "type": "address"
        }
      ]
    }
  }
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Body

application/json

Request to place a limit order on a global markets perps market.

owner
string
default:0x06A9aF046187895AcFc7258450B15397CAc67400
required

Owner of the global markets perps product account

Example:

"0x06A9aF046187895AcFc7258450B15397CAc67400"

asset
string
default:AAPL
required

Asset ticker symbol (e.g. AAPL, GOLD, EUR)

Example:

"AAPL"

side
string
default:buy
required

Order side: 'buy' or 'sell'

Example:

"buy"

size
string
default:10.0
required

Number of contracts (human-readable)

Example:

"10.0"

price
string
default:190.00
required

Limit price (human-readable)

Example:

"190.00"

time_in_force
string
default:gtc

Time-in-force: 'gtc' (good til cancel) or 'alo' (add liquidity only)

Example:

"gtc"

reduce_only
boolean
default:false

If true, order can only reduce an existing position

Example:

false

client_order_id
integer | null

Optional client order ID for idempotency (uint128)

builder
Builder · object

Optional builder fee. When provided, the order action carries the builder address and fee — the end-user must have already approved this builder via /approve_builder_fee up to at least this rate. Omit (or pass null) to place the order with no builder fee.

Response

Successful Response

Returned by prepare endpoints — contains EIP-712 typed data for the user to sign.

typed_data
Typed Data · object
required

EIP-712 typed data for wallet signing (domain, types, primaryType, message)

action
Action · object
required

Raw Hyperliquid action (passed back to the execute endpoint)

nonce
integer
required

Timestamp-based nonce used during signing