aibank
API ReferenceTrading

Hyperliquid Trading

Single action-based endpoint for Hyperliquid perpetual futures trading.

Hyperliquid Trading

All Hyperliquid operations go through this single endpoint. The action field determines the operation.

Authentication

Requires X-API-Key header.

Request body

Additional parameters depend on the action.

Info actions (read-only)

These proxy to Hyperliquid's info API and do not require signatures.

ActionDescriptionParameters
statusFull account state--
positionsOpen positions--
ordersOpen orders--
fillsRecent fills--
marketsMarket metadata--
tickerMid pricessymbol (optional)
orderbookL2 order booksymbol (default: "ETH")
fundingFunding rates--

Example: Get positions

curl -X POST http://localhost:4000/v1/trading/hyperliquid \
  -H "X-API-Key: ak_your_key" \
  -H "Content-Type: application/json" \
  -d '{"walletId": "wallet-uuid", "action": "positions"}'
{
  "action": "positions",
  "positions": [...],
  "wallet_id": "wallet-uuid",
  "address": "0x742d35Cc...",
  "transaction_id": "audit-uuid"
}

Example: Get ticker

curl -X POST http://localhost:4000/v1/trading/hyperliquid \
  -H "X-API-Key: ak_your_key" \
  -H "Content-Type: application/json" \
  -d '{"walletId": "wallet-uuid", "action": "ticker", "symbol": "ETH"}'
{
  "action": "ticker",
  "symbol": "ETH",
  "mid_price": "3000.50",
  "wallet_id": "wallet-uuid",
  "address": "0x742d35Cc..."
}

Exchange actions (write -- not yet implemented)

These actions require EIP-712 typed signatures and currently return 501 Not Implemented with the payload that would be sent.

ActionDescriptionParameters
orderPlace limit ordersymbol, side, price, amount, tif
cancelCancel ordersymbol, orderId
cancel_allCancel all orderssymbol
set_leverageSet leveragesymbol, leverage, cross
withdrawWithdraw from HLamount, destination
transferInternal USD transferamount, destination

Example: Place order (returns 501)

curl -X POST http://localhost:4000/v1/trading/hyperliquid \
  -H "X-API-Key: ak_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "walletId": "wallet-uuid",
    "action": "order",
    "symbol": "ETH",
    "side": "buy",
    "price": "3000.00",
    "amount": "0.1",
    "tif": "Gtc"
  }'

Spending controls are enforced on exchange actions -- if the amount exceeds limits, the request is rejected with 403.

Errors

StatusCodeDescription
400INVALID_INPUTMissing walletId, action, or unknown action
403variesSpending control violation
404NOT_FOUNDWallet not found
501NOT_IMPLEMENTEDExchange actions pending EIP-712 implementation
502HYPERLIQUID_ERRORUpstream Hyperliquid API error

On this page