Developer Portal

Build on HyperClaw

Integrate perpetual trading into your OpenClaw agent using the ClawHub skill, or build directly against Orderly Network's REST API. Every trade routes through HyperClaw's broker.

Getting Started

HyperClaw is a perp DEX built on Orderly Network. All trading goes through Orderly's REST API with our broker ID. Here's how to set up an agent that trades on HyperClaw.

01Configuration

Set the API base URL and broker ID.

config.ts
TypeScript
const ORDERLY_API = "https://api-evm.orderly.org"
const BROKER_ID = "hyper_claw"
const CHAIN_ID = 8453 // Base (or 42161 for Arbitrum, 10 for Optimism)

02Create Wallet

Generate an EVM wallet for the agent.

wallet.ts
TypeScript
import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'

const privateKey = generatePrivateKey()
const account = privateKeyToAccount(privateKey)

console.log("Address:", account.address)
// Store privateKey securely

03Register on Orderly

Register the wallet with Orderly using HyperClaw's broker ID.

register.ts
TypeScript
// 1. Get registration nonce
const nonceRes = await fetch(
  `${ORDERLY_API}/v1/registration_nonce`
)
const { data: { registration_nonce } } = await nonceRes.json()

// 2. Sign EIP-712 registration message
const message = {
  brokerId: BROKER_ID,
  chainId: CHAIN_ID,
  timestamp: Date.now(),
  registrationNonce: registration_nonce
}
// Sign with wallet's EIP-712 signer

// 3. Register account
await fetch(`${ORDERLY_API}/v1/register_account`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    message,
    signature: eip712Signature,
    userAddress: account.address
  })
})

04Create Trading Key & Trade

Generate an ed25519 key for API auth, then place orders.

trade.ts
TypeScript
// After creating an Orderly Key (ed25519):

const response = await fetch(`${ORDERLY_API}/v1/order`, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "orderly-account-id": accountId,
    "orderly-key": `ed25519:${publicKey}`,
    "orderly-signature": signature,
    "orderly-timestamp": String(Date.now())
  },
  body: JSON.stringify({
    symbol: "PERP_BTC_USDC",
    order_type: "MARKET",
    side: "BUY",
    order_quantity: 0.01
  })
})

const result = await response.json()
console.log("Order placed:", result)

Getting Started

HyperClaw is omnichain — deposit from Base, Arbitrum, Optimism, Polygon, or Ethereum. All trades use real USDC.

1

Get ETH on Arbitrum

You need a small amount of ETH on your chosen chain for gas fees.

2

Get USDC on Arbitrum

Have USDC on Base, Arbitrum, Optimism, Polygon, or Ethereum. No bridging needed.

3

Deposit to vault & trade

Deposit USDC into the Orderly vault on your chain. Then start trading.