Agent intents
The agentswap intent command signs and announces an open intent, while
intent list, intent status, and policy read and display intent state.
These commands apply on the V6 chains: Base 8453, Arbitrum One 42161, BNB Smart
Chain 56, Robinhood Chain 4663, and Arc 5042. The V6 bindings for
UserProxyFactoryV6, IntentSettlerV3, and IntentLensV3 are listed on the
intent addresses page.
Safety model
Section titled “Safety model”Placing an intent can announce commitments that move user funds. Three safety rails govern signing and submission.
Signing and execution require --allow-trade
Section titled “Signing and execution require --allow-trade”Without --allow-trade, intent place is forced to dry-run. --dry-run forces
the same preview even when --allow-trade is set.
--max-amount bounds input before signing
Section titled “--max-amount bounds input before signing”--max-amount (AGENTSWAP_TRADE_MAX_AMOUNT) sets an upper bound on raw amountIn.
The CLI checks this limit before signing: if --amount exceeds the cap, the CLI
refuses to sign or submit.
Exactly one submission mode
Section titled “Exactly one submission mode”A live placement needs exactly one of --relay, --self-submit, or --broadcast.
Passing two or more is refused, in a dry run as well.
RPC endpoints and lookback limits
Section titled “RPC endpoints and lookback limits”Placing an intent, reading intent history, inspecting live status, and reading agent
policies all query an EVM JSON-RPC endpoint. Before any of them, the CLI reads the
endpoint’s chain id and refuses an RPC that answers a different chain than --chainid.
| Variable | Purpose |
|---|---|
AGENTSWAP_RPC_URL_<chainId> |
Target RPC for a specific chain (e.g. AGENTSWAP_RPC_URL_8453) |
AGENTSWAP_RPC_URL |
Global fallback RPC for all chains |
Built-in public RPCs and default log lookback windows:
| Chain | ID | Built-in public RPC | Default lookback |
|---|---|---|---|
| Base | 8453 |
https://mainnet.base.org |
200,000 blocks |
| Arbitrum One | 42161 |
https://arb1.arbitrum.io/rpc |
200,000 blocks |
| BNB Smart Chain (BSC) | 56 |
https://bsc-rpc.publicnode.com |
9,000 blocks |
| Robinhood Chain | 4663 |
https://rpc.mainnet.chain.robinhood.com |
200,000 blocks |
| Arc | 5042 |
https://rpc.mainnet.arc.io |
200,000 blocks |
BSC lookback limit. Public BSC RPC nodes restrict log query ranges. On BSC,
the CLI defaults to 9,000 blocks with the built-in endpoint. Setting
AGENTSWAP_RPC_URL_56 or AGENTSWAP_RPC_URL restores the 200,000-block default;
--lookback-blocks <U64> sets the window on any read command.
intent place
Section titled “intent place”intent place constructs a 12-field Order, checks it against the owner’s proxy
and the settler, and on the live path signs an IntentAuthorization and wraps it in
an authorization envelope (kind = 1).
Token symbols (USDC, WETH) are resolved from the local registry. Raw contract
addresses (0x...) are also accepted; the CLI confirms a raw token address answers
decimals(), and amounts are given as unsigned decimal integers in the token’s
smallest unit, never scaled by token decimals.
1. Dry run (preview first)
Section titled “1. Dry run (preview first)”Run without --allow-trade or with --dry-run to preview the order and the
authorization digest without signing:
agentswap intent place \ --chainid 8453 \ --proxy-owner 0x1111111111111111111111111111111111111111 \ --from USDC \ --to WETH \ --amount 100000000 \ --start-out 40000000000000000 \ --end-out 35000000000000000 \ --dry-run \ --key-file ./agent-signer.txtDry run and live placement both check, in order:
- A raw token address answers
decimals(). - A proxy is deployed for
--proxy-owner. - The order’s
amountIndoes not exceed--max-amount. - A random agent nonce is confirmed unused via
isAgentNonceUsed. - The local order id equals
IntentSettlerV3.orderHash, and the local authorization digest equals the proxy’shashIntentAuthorization.
The live path then signs the digest and requires the proxy’s isIntentAuthorized to
accept the order and envelope before it submits.
2. Relay submission
Section titled “2. Relay submission”--relay hands the signed order and envelope to the AgentSwap relay, which publishes
it to the off-chain stream or announces it on chain:
agentswap --allow-trade \ --max-amount 200000000 \ intent place \ --chainid 8453 \ --proxy-owner 0x1111111111111111111111111111111111111111 \ --from USDC \ --to WETH \ --amount 100000000 \ --start-out 40000000000000000 \ --end-out 35000000000000000 \ --relay \ --key-file ./agent-signer.txtThe relay client always posts to https://app.agentswap.co, not to --url. A relay
error exits 1. After a relay HTTP 502 or 504 the error names the intent, which may be
live; after any relay error, check intent list --agent before placing again.
3. Self-submit announce
Section titled “3. Self-submit announce”--self-submit sends IntentSettlerV3.announce from the --key-file wallet, which
pays the gas:
agentswap --allow-trade \ --max-amount 200000000 \ intent place \ --chainid 8453 \ --proxy-owner 0x1111111111111111111111111111111111111111 \ --from USDC \ --to WETH \ --amount 100000000 \ --start-out 40000000000000000 \ --end-out 35000000000000000 \ --self-submit \ --key-file ./agent-signer.txtThe CLI prints the transaction hash on stderr before sending, then waits a bounded
time for the receipt. Exit statuses 3 and 4 (below) report a revert or an unread
receipt.
4. Off-chain broadcast
Section titled “4. Off-chain broadcast”--broadcast publishes the signed order and envelope to the off-chain broadcast
network under the standard agentswap-v6, with the chain’s IntentSettlerV3 address.
No transaction is sent:
agentswap --allow-trade \ --max-amount 200000000 \ intent place \ --chainid 8453 \ --proxy-owner 0x1111111111111111111111111111111111111111 \ --from USDC \ --to WETH \ --amount 100000000 \ --start-out 40000000000000000 \ --end-out 35000000000000000 \ --broadcast \ --key-file ./agent-signer.txtBefore publishing, stderr prints the intent id, chain, standard, settler, and stream
origin. A broadcast error exits 1 and leaves admission unknown: a missing history
record does not prove rejection, and re-running signs a new intent that may duplicate
one still active. Look the printed intent id up with intent status first.
Options and exit statuses
Section titled “Options and exit statuses”| Option | Default | Purpose |
|---|---|---|
--duration-secs |
600 |
Intent window in seconds from now |
--decay-secs |
Equal to the window | Seconds over which output decays from --start-out to --end-out; capped at the window, must be greater than zero |
--deadline-secs |
The window’s endTime |
Agent authorization deadline; a value ending before endTime is refused |
| Exit status | Meaning |
|---|---|
0 |
Success |
1 |
The command failed, and no --self-submit transaction was sent |
2 |
Invalid arguments |
3 |
A --self-submit transaction was mined and reverted |
4 |
A --self-submit transaction was sent but its receipt was not read, so it may still be mined |
With 3 and 4, the output, --json included, carries the transaction hash and its
status. Look the hash up before sending again. The same statuses apply to
trade --self-submit.
intent list
Section titled “intent list”intent list with --owner reads the intent index first, which also holds intents
published only to the off-chain stream. With --agent, or when the index does not
answer, it scans IntentAnnounced event logs across the lookback window. Before
decoding records, it requires IntentLensV3.PREVIEW_LAYOUT() to equal 3, then reads
the lens preview for each order.
You must pass either --owner or --agent (the two options conflict).
# List intents placed for an owneragentswap intent list --chainid 8453 --owner 0x1111111111111111111111111111111111111111
# List intents placed by a specific agent with custom lookbackagentswap intent list --chainid 42161 \ --agent 0x2222222222222222222222222222222222222222 \ --lookback-blocks 50000Each record displays:
ID: bytes32 intent identifier (the order hash).Placed By: authorized agent address, or owner address if placed directly.Pair: input and output token addresses.Amount: input token amount.Window: start and end UNIX timestamps.Exclusive:exclusive_window, whether the order is in its exclusive window.Floor:floor_now, the current floor in raw token units.Fee:fee_now, the current fee in raw token units.Required:required_now, the current required amount in raw token units.Outsider Floor:floor_for_outsider, the outsider floor in raw token units.Outsider Required:required_for_outsider, the outsider required amount in raw token units.Status: evaluated live against the chain.
| Status | Reason |
|---|---|
open |
The lens reports the order in-window. Inside the exclusive window (before startTime), the system solver fills at the floor; an outsider pays floor + 25 bps, and the required amounts include the 3 bps fee. |
filled |
Settler marked filled |
cancelled |
Settler cancellation |
dead |
Proxy not deployed, killed by owner, or owner nonce spent |
expired |
The lens reports inWindow = false; the order window is closed. |
intent status
Section titled “intent status”intent status inspects a single intent by its 32-byte order hash. It reads the
intent index first, so an intent published only to the off-chain stream resolves;
then it searches IntentAnnounced event logs within the lookback window; with
neither, it reports the settler’s filled or cancelled state for the id. It requires
IntentLensV3.PREVIEW_LAYOUT() == 3 before decoding the lens preview.
agentswap intent status --chainid 8453 \ --id 0x9b54c86dfd54fcf85a86df0cf0e4a7a8cf68079bf970df44dbd3f749e7b2f67aIf the index does not hold the intent and it was announced earlier than the default
lookback window, increase the span with --lookback-blocks:
agentswap intent status --chainid 56 \ --id 0x9b54c86dfd54fcf85a86df0cf0e4a7a8cf68079bf970df44dbd3f749e7b2f67a \ --lookback-blocks 100000policy
Section titled “policy”policy reads an agent’s permissions and spending caps from the owner’s User Proxy.
agentswap policy --chainid 8453 \ --owner 0x1111111111111111111111111111111111111111 \ --agent 0x2222222222222222222222222222222222222222Token addresses come from AgentCapSet events within the lookback window; current
budgets are read from the proxy. Pass --token <address>, repeatable, for a token
whose cap event is older than the lookback.
The command reports:
- Proxy address: the owner’s execution proxy.
- Expiry: UNIX timestamp when agent authorization expires.
- Epoch length: budget window length in seconds.
- Action mask: bitmask of permitted proxy actions.
- Generation: policy revision counter (invalidates prior signatures on increment).
- Token budgets: token address, spending cap per epoch, amount spent in current epoch, and whether the token is allowed.