docs start
How it works
Every decision moves through the same four steps. The order is enforced by the contracts and the runtime: nothing executes before it is committed.
01
Delegate
Approve a trade-only agent wallet on Hyperliquid and record the delegation, with your limits hashed, on Elysium.
DelegationRegistry.delegate()02
Commit
Before any order is sent, the runtime writes the decision hash to IntentLog. No commit, no order.
IntentLog.commit()03
Execute
The agent wallet places the orders the risk guard approved. It can trade. It cannot withdraw.
Hyperliquid order04
Record
The result hash is posted. Anyone can recompute both hashes from the published payloads.
IntentLog.postResult()
1. Delegate
You approve a Hyperliquid agent wallet derived for your delegation (named cm-<base36 agentId>-<base36 index>, at most 16 characters) and a maximum builder fee. Then you call DelegationRegistry.delegate(agentId, agentWallet, riskLimitsHash, validUntil). The agent's performance fee is snapshotted at this moment. An agent wallet can be bound to exactly one delegation, forever.
Your risk limits are hashed (keccak256 of their canonical JSON) and only the hash goes onchain. The plaintext limits go to the indexer, which accepts them only if they hash to the onchain riskLimitsHash. The runtime refuses to trade a delegation whose stored limits do not match that hash.
2. Commit
Each tick the runtime takes a market and account snapshot, asks the strategy for a proposal and runs the deterministic risk guard over it. The decision payload records all of it:
| Field | Meaning |
|---|---|
v | Payload version, 1 |
delegationId, agentId, nonce | Which delegation and which decision |
ts | Decision time |
strategyHash, modelId | The committed strategy and model |
snapshotHash, accountHash | Hashes of the market snapshot and account state the strategy saw |
proposal | Orders, cancels and rationale proposed by the strategy |
verdict | Risk guard result: approved, adjusted, rejected (with reason), cancels, breach flags |
The runtime then calls IntentLog.commit(delegationId, nonce, decisionHash). A (delegationId, nonce) pair can be committed once and never overwritten. commit reverts if the delegation has expired or the agent is not Active. If the commit fails, the decision is stored as SKIPPED_NO_COMMIT and no order is sent. By default no-op decisions are committed too, so a quiet tick is also on the record.
3. Execute
Approved orders go to Hyperliquid from the agent wallet. Each order carries a deterministic client order id, bytes16(keccak256(abi.encode(delegationId, nonce, orderIndex))), so fills can be matched to the decision without local state.
4. Record
After execution the runtime builds the result payload (placeResults, cancelResults, fills, errors) and calls IntentLog.postResult(delegationId, nonce, resultHash, outcome, filledNotional). A result can only be posted for a committed intent, and only once. Outcomes: NoOp, RiskBlocked, Submitted, Filled, PartiallyFilled, Rejected, Failed, Cancelled.
Periodically the runtime also posts checkpoint(delegationId, cumRealizedPnl, equity, evidenceHash). Performance fees are settled against these checkpoints.
Verifying a decision
- Fetch the payloads:
GET /intents/:delegationId/:nonce/payloadon the indexer. - Compute
keccak256over the UTF-8 bytes of the canonical JSON of each payload (hashCanonicalin@commitry/core). - Compare with
decisionHashandresultHashfrom theIntentCommittedandResultPostedevents, orIntentLog.getIntent.
The Record tab on every agent page does this in your browser with the Verify action. A match reads "Hash matches". A difference reads "Hash mismatch" and is never hidden.
What the record does not prove
PnL in checkpoints is reported by the runner. evidenceHash commits to the Hyperliquid fills behind it so it can be audited, but the chain does not verify it. Fees can never exceed the escrow you deposited, so a wrong report is bounded by that amount.