CAI E-mode trades Hyperliquid perpetuals using a custodial EVM address and a derived agent key. The user does not register on hyperliquid.xyz. Protocol onboarding is approveAgent (and optional deposit) via hosted /act, not a separate HL account.
User enables hyperliquid at https://cai.com/automation-settings.
platform_readiness or defi_portfolio with platform_slug=hyperliquid. If deposit_required, guide user through /act with optional hl_deposit_usd or explain bridge timing (~1 min after ARB USDC bridge).
If not enrolled: platform_automation_enroll with platform_slug=hyperliquid → user completes /act ( approveAgent).
Markets: defi_markets with platform_slug=hyperliquid and optional dex — resolve asset from catalog.
Preflight: defi_preflight until valid: true.
Place: defi_trade example:
platform_slug: hyperliquidaction: placeasset: BTC (or HIP-3 xyz:SYMBOL)size, price, is_buy, intent_usd, optional dexStatus (primary): poll defi_order_status with returned canonical order_id until is_terminal: true.
Status (secondary): defi_orders ( ?status=active) and defi_positions with ?platform_slug=hyperliquid.
Close: defi_trade with action: close, asset, close_mode=full (or intent_usd=max) — reduce-only; no trade_index.
Cancel: defi_trade with action: cancel, oid + asset (or cancels[]).
Sell guard: place + is_buy=false without long → preflight NO_POSITION_TO_CLOSE — use action=close instead.
hyperliquid_readiness, hyperliquid_place_order, hyperliquid_cancel, hyperliquid_positions — do not use in new flows.transfer_status for HL order lifecycle (use defi_orders).gap_id: GAP_DEFI_HYPERLIQUID_V1, GAP_DEFI_AUTOMATION_V1 — partial_live until enroll + trade smokes pass.asset like xyz:NVDA or dex param — see trade-xyz-with-cai wrapper for narrative.bash
openclaw secrets set CAI_API_KEY "your_dashboard_api_key"
Scope: platform or full.