docs guides
For builders
An agent is a strategy definition, committed by hash in AgentRegistry, that the runtime executes for every delegation. You operate it from your own wallet; the platform runner signs its commits.
Create an agent
The Create flow has six steps: Basics, Strategy, Limits, Fees, Preview and register, and an optional Montra launch.
- Write the name and description shown in the registry.
- Choose a rule or LLM strategy, its parameters and the tick interval.
- Set the default limits new delegations start from, and the maximum limits a delegator may not exceed.
- Set the performance fee and where fees go.
- Preview: the indexer validates the definition (
POST /agents/draft) and returnsstrategyHash,modelIdHashand the normalized strategy. Registering sendsAgentRegistry.registerAgentwith these hashes, the runner address, the fee config and the metadata URI.
Strategy definition
The schema is StrategyDefinitionSchema in @commitry/core (zod, strict: unknown keys are rejected).
| Field | Type | Notes |
|---|---|---|
id | string | Non-empty identifier |
kind | "llm" or "rule" | |
systemPrompt | string, optional | LLM strategies only |
params | object | Strategy parameters |
defaultLimits | RiskLimits | Limits new delegations start from |
maxLimits | RiskLimits, optional | Upper bound a delegator may not exceed |
tickIntervalSec | integer, 30 to 86400 | Seconds between decisions |
modelId | string, at most 128 chars | rule:<id>, anthropic:<model> or openai:<model>; LLM models must be on the runtime's allowlist |
decisionTimeoutMs | integer, at most 60000 | Default 20000 |
systemPrompt is capped at 16,000 characters and params at 8,192 characters of JSON. Each agent has a daily LLM token budget on the runtime; when it is spent, decisions are committed as no-ops until the next UTC day.
strategyHash is keccak256(canonicalJson(definition)) after defaults are applied. modelId onchain is keccak256(utf8(modelId)). The runtime refuses to start a worker unless the stored definition hashes to the onchain strategyHash.
{
"id": "ping-pong",
"kind": "rule",
"params": { "sizeUsd": 12, "slippageBps": 10 },
"defaultLimits": {
"maxNotionalUsd": 200, "maxOrderNotionalUsd": 50, "maxLeverage": 2,
"allowedAssets": ["ETH"], "maxDailyLossUsd": 10, "maxOrdersPerMinute": 4,
"maxPriceDeviationBps": 100, "reduceOnlyOnBreach": true
},
"tickIntervalSec": 60,
"modelId": "rule:ping-pong",
"decisionTimeoutMs": 20000
}
Rule or LLM
Rule strategies are deterministic and built into the runtime:
modelId | Behavior | Params (defaults) |
|---|---|---|
rule:noop | Never trades | none |
rule:ping-pong | Alternates a small IOC buy and sell on the first allowed asset, closing an open position first | sizeUsd (11), slippageBps (10) |
rule:sma-cross | Long when the fast SMA is above the slow SMA, flat otherwise, per allowed asset | fast (10), slow (30), targetNotionalUsd (100), slippageBps (10) |
LLM strategies use anthropic:<model> or openai:<model>. Your systemPrompt is followed by a fixed operating contract the runtime appends. Each tick the model can call getMarketSnapshot, getPositions and getRiskBudget, and must finish by calling proposeOrders once (at most 20 orders and 50 cancels, with a rationale). The loop is capped at 8 model calls. An empty proposal is a valid decision. The runtime needs the provider's API key; without it the agent cannot start.
Either way, the strategy only proposes. The risk guard decides.
Risk guard rules
DefaultRiskGuard is pure and deterministic. Orders are checked in proposal order against a worst-case book: current positions plus every open order on the account (resting, trigger, and the user's own manual orders) at full size, each side valued at the higher of its order price and the mid. Orders approved earlier in the same proposal join that book, so exposure cannot be stacked across ticks. The first failing rule wins.
| # | Reason | Rule |
|---|---|---|
| 1 | ASSET_NOT_ALLOWED | Asset not in allowedAssets, or no market metadata |
| 2 | INVALID_PRICE / INVALID_SIZE | Unparseable, non-positive, or rounds to zero under Hyperliquid tick and lot rules |
| 3 | DUPLICATE | Same asset, side, price, size and reduce-only flag as an earlier order |
| 4 | DAILY_LOSS / REDUCE_ONLY_REQUIRED | After a breach only exposure-reducing orders pass; trigger (TP/SL) orders must always be reduce-only |
| 5 | PRICE_DEVIATION | Limit price further from mid than maxPriceDeviationBps (non-trigger orders) |
| 6 | MIN_ORDER_VALUE | Price times size below 10 USD |
| 7 | ORDER_NOTIONAL | Above maxOrderNotionalUsd: size is clipped, rejected if the clip falls below the minimum |
| 8 | GROSS_NOTIONAL | Projected gross above maxNotionalUsd: clipped or rejected; reducing orders pass |
| 9 | LEVERAGE | Projected gross over equity above the lower of maxLeverage and the asset's max leverage |
| 10 | RATE_LIMIT | More approved orders than remain this minute, or more than 20 resting orders for this delegation |
Cancels are scoped too: an agent can only cancel orders this delegation placed (matched by client order id or order id in the runtime's records) on its allowed assets. The user's own orders and other agents' orders are never cancelled, also not by the cancel-all on pause or revoke.
Sizes are always truncated toward zero. Prices round conservatively: buys down, sells up, so an order is never more aggressive than proposed.
Metadata
registerAgent takes a metadataURI. The indexer accepts ipfs://, https:// (no private hosts) and inline data:application/json URIs, base64 or URL-encoded, up to 256 KiB. The Create flow uses the data: option, so nothing is hosted.
{
"name": "Ping-pong ETH (testnet)",
"description": "Reference rule agent.",
"modelId": "rule:ping-pong",
"strategy": { "id": "ping-pong", "kind": "rule", "...": "full StrategyDefinition" }
}
name and description are shown in the registry. strategy and modelId are published only if they hash to the onchain strategyHash and modelId; otherwise the strategy is treated as private. Default and maximum limits come from the verified strategy, or from top-level defaultLimits and maxLimits in the metadata when the strategy is private. Without default limits the agent cannot accept delegations.
Fees and Montra routes
perfFeeBps is at most 5000 (50.00%) and applies to delegations created after a change. Fees accrue in FeeRouter and anyone can call forward(agentId) to push them to the recipient:
recipientKind | Value | Route on forward |
|---|---|---|
Address | 0 | Native HYPE transfer to feeRecipient |
MontraToken | 1 | Native transfer to the agent's token, then token.distribute() |
Splitter | 2 | Native transfer to feeRecipient (the splitter is not called) |
forward is atomic: if the transfer or distribute() reverts, the claimable balance is kept. Changing the recipient also redirects fees accrued but not yet forwarded.
Montra launch is available on Elysium mainnet (chain 99901) only. The Create flow uploads the token metadata, calls the Montra launch factory with your fee split between your wallet and token holders, then links the token with AgentRegistry.setToken. Running an agent does not require a token.
Operating an agent
setStatus(agentId, Paused | Retired)stops new commits for every delegation of the agent.updateStrategycommits a new strategy hash and bumps the version.setRunner,setFeeConfig,setTokenandtransferOperatorare operator-only.