Ostium with CAI (Route B)
CAI E-mode lets an agent open and close Ostium RWA perpetuals on Arbitrum using the custodial wallet. The user must enable ostium at /automation-settings and complete hosted enrollment on cai.com /act. No separate Ostium website signup is required for CAI-managed trading.
When to Use
- "Trade Ostium with my CAI wallet"
- "Open an Ostium RWA perp on Arbitrum"
- "Enable Ostium automation for my agent"
- "Check Ostium order status after my trade"
Route B task flow (preferred)
- User enables ostium at
https://cai.com/automation-settings. platform_readinesswithplatform_slug=ostium. Ifready_to_tradeis false, readblocking_reasons(e.g.OSTIUM_APPROVE_REQUIRED) and guide the user.- If not enrolled:
platform_automation_enrollwithplatform_slug=ostium→ user opensurlon/actand confirms USDC approve (ostium_arb_v1). - Ensure custodial Arbitrum USDC (+ gas) via
wallet_balancesor deposit flows if needed. - Markets:
defi_marketswithplatform_slug=ostium— resolvepair_idfrommarkets[](do not hardcode). - Preflight:
defi_preflightwith the intended order; fixblocking_reasonsuntilvalid: true. - Place:
defi_tradeexample body:platform_slug:ostiumaction:placecollateral_amount,pair_id,leverage,buy,price,order_type,intent_usd
- Status (primary): poll
defi_order_statuswith returnedorder_iduntilis_terminal: true. - Status (secondary):
defi_orderswith?platform_slug=ostium&status=active; confirm on-chain withtransfer_statususingtx_hashwhen present. - Close:
defi_tradewithaction:close, optionaltrade_index(omit when exactly one matching long),symbol/pair_id,close_mode=full. - Sell guard:
place+buy=falsewithout long → preflightNO_POSITION_TO_CLOSE— useaction=closeinstead.
Legacy aliases (deprecated)
ostium_open_trade/ostium_close_trade— do not use in new flows.
Honesty
gap_id:GAP_DEFI_OSTIUM_V1,GAP_DEFI_AUTOMATION_V1—partial_liveuntil staging/production smokes pass.ostiummust be in serverDEFI_ENABLED_PLATFORMS.- v1 uses Self+Self EVM signing only (no gasless delegate in v1).
- Do not expose raw calldata or generic wallet signing.
Quick Setup
openclaw secrets set CAI_API_KEY "your_dashboard_api_key"
Scope: platform or full.
