VORDIUM DOCS
Trading Infrastructure

Agents & Caps

Native agent model — session keys with owner-set, opt-in caps.

An agent on Vordium is not a separate contract or a registered record — it is simply an owner account operated through a session key (see Session Keys). The owner can optionally attach caps and a mode that VordCore enforces natively on every order the session key places. Caps are opt-in: with no caps set, the session key trades the owner's account freely (bounded by vault balance); once the owner sets caps, they are enforced on-chain.

Caps & mode

Caps are per-owner and integer-only. Mode gates whether the session key may trade: 0=OFF, 1=REDUCE_ONLY, 2=ACTIVE. Once caps are set, an order is rejected unless mode is permissive and the order is within every cap.

AgentCaps \{ max_leverage u64 // bps (e.g. 200000 = 20x) allowed_order_types u32 // bitmask; bit i set => order_type i allowed max_input_per_trade u128 // USDC margin per trade, 6 decimals max_total_position u128 // |net position| size, 18 decimals \} mode: 0 OFF | 1 REDUCE_ONLY | 2 ACTIVE

Set caps / mode (owner-signed EIP-712) The owner submits SetAgentCaps / SetAgentMode to the native agent API — proxied at rpc.vordium.com/agent/*, served on each validator's port 9001 (same host as the session API). Both are owner-signed EIP-712 under the shared VordCore domain (verifyingContract 0x…1002); u128 caps are sent as decimal strings.

`# Set caps (opt in to enforcement) POST https://rpc.vordium.com/agent/caps Body: { "owner":"0x...", "max_leverage":200000, "allowed_order_types":2, "max_input_per_trade":"10000000", "max_total_position":"5000000000000000000", "signature":"0x..." } # -> 200 submitted (401 if sig missing/invalid)

Set mode (0 OFF / 1 REDUCE_ONLY / 2 ACTIVE)

POST https://rpc.vordium.com/agent/mode Body: { "owner":"0x...", "mode":2, "signature":"0x..." } # -> 200 (400 if mode>2)

Read caps (mirror) via the 0x080B read-precompile: agentCaps(owner)

returns (mode, caps_set, max_leverage_bps, allowed_order_types, max_input, max_total)`

EIP-712 types: SetAgentCaps(address owner,uint64 maxLeverage,uint32 allowedOrderTypes,uint128 maxInputPerTrade,uint128 maxTotalPosition) and SetAgentMode(address owner,uint8 mode). Signature is 64-byte r‖s (v stripped), same convention as sessions.