For the complete documentation index, see llms.txt. This page is also available as Markdown.

Exchange Methods

Reference for HyperLink's unified POST /exchange endpoint: request format, action families, and Hyperliquid-compatible order and query examples used.

Every HyperLink action and read query is a POST /exchange request. There is no separate /info host. This page covers the request format and the action families; the pages below it list each method's full request and response schema.

HyperLink is a prime broker for Hyperliquid and mirrors Hyperliquid's /exchange action format and signing, so existing trading tooling can point at the HyperLink base URL.

Request format

Each request uses the standard envelope: an action, an EIP-712 signature, and a millisecond nonce. Two signing domains apply: agent-signed for trading and queries, user-signed for withdrawals and transfers. See Authentication & Keys.

  • Write actions return a status wrapper.

  • Read queries return raw JSON.

Example: place a limit order

A GTC limit buy of 0.1 of asset index 0, agent-signed. Order fields use Hyperliquid's short-form names (a asset, b buy, p price, s size, r reduceOnly, t type, c client order id). HyperLink requires a c (cloid) on every order.

curl -X POST https://api.hyperlink.xyz/exchange \
  -H "Content-Type: application/json" \
  -d '{
  "action": {
    "type": "order",
    "orders": [
      { "a": 0, "b": true, "p": "50000", "s": "0.1", "r": false, "t": { "limit": { "tif": "Gtc" } }, "c": "0x1234567890abcdef1234567890abcdef" }
    ],
    "grouping": "na"
  },
  "nonce": 1712140800000,
  "signature": { "r": "0x...", "s": "0x...", "v": 27 }
}'

A resting order returns its order ID:

Larger client batches are accepted and split automatically; each internal batch carries up to 256 orders. HyperLink enforces no minimum order size; Hyperliquid enforces a notional minimum (~$10). See the order method below for the full schema.

Action families

Each method below has its full schema and examples.

Trading

Action
Purpose

order

Place limit or trigger orders.

cancel

Cancel resting orders by order ID (oid).

cancelByCloid

Cancel resting orders by client order ID (cloid).

Margin

Leverage is per-asset (no single global cap); margin mode cannot change with an open position.

Action
Purpose

updateLeverage

Set leverage and margin mode (is_cross).

updateIsolatedMargin

Add or remove isolated margin.

topUpIsolatedOnlyMargin

Set isolated margin to a target leverage.

Transfers & withdrawals

Withdrawals are user-signed and gasless: you sign the request, HyperLink submits it on-chain for you. Agents cannot withdraw. See Deposits & Withdrawals.

Action
Signing
Purpose

withdraw

User

Request a gasless on-chain withdrawal.

sendAsset

User

Transfer funds between your own DEX balances (spot, perp).

usdClassTransfer

User

Move funds between spot and perp balances (legacy; prefer sendAsset).

agentSendAsset

Agent

Transfer assets with agent authorization.

Builder codes

Applications routing orders can charge a user-approved per-order fee. See Builder Codes.

Action
Signing
Purpose

approveBuilderFee

User

Approve a maximum builder fee rate for a builder.

claimRewards

Agent

Claim accrued builder fees to your spot balance.

Queries (raw JSON, agent-signed)

Query
Returns

clearinghouseState

Perp positions, margin summary, withdrawable.

spotClearinghouseState

Spot balances.

openOrders

Open orders.

userFills

Recent fills.

portfolio

Account value and PnL history.

userHistoricalOrders

Historical orders.

userFundings

Funding payments.

userNonFundingLedgerUpdates

Deposits, withdrawals, transfers.

userRateLimit

Rate-limit usage.

activeAssetData

Per-asset leverage and margin context.

extraAgents

Approved agents.

maxBuilderFee

Approved builder fee rate for one builder, in tenths of a basis point.

approvedBuilders

Builder addresses the account has approved.

Streaming

For real-time data and signed actions over a persistent connection, use the WebSocket API instead of polling.

Last updated