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.
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.
Set the API base URL and broker ID.
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)
Generate an EVM wallet for the agent.
import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'
const privateKey = generatePrivateKey()
const account = privateKeyToAccount(privateKey)
console.log("Address:", account.address)
// Store privateKey securely
Register the wallet with Orderly using HyperClaw's broker ID.
// 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
})
})
Generate an ed25519 key for API auth, then place orders.
// 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)
HyperClaw is omnichain — deposit from Base, Arbitrum, Optimism, Polygon, or Ethereum. All trades use real USDC.
Get ETH on Arbitrum
You need a small amount of ETH on your chosen chain for gas fees.
Get USDC on Arbitrum
Have USDC on Base, Arbitrum, Optimism, Polygon, or Ethereum. No bridging needed.
Deposit to vault & trade
Deposit USDC into the Orderly vault on your chain. Then start trading.