D-07 · The mandate
[D-07]Layers
The mandate
An AI agent trades the owner's money. A contract holds the rules. The agent pays for trying to break them.
How it works#
- 01FundThe owner puts money in a mandate vault and writes the rules.
- 02BondThe agent posts a bond in USDG before it may trade.
- 03TradeEvery trade is checked by the contract, not by the agent.
- 04PayA broken rule costs the agent part of its bond. The owner gets it.
Five skills#
| # | Skill | Rule | In the demo |
|---|---|---|---|
| 01 | ASSETS | Both sides of a trade must be on the owner's list. | USDG, WETH, ETH and NVDA only |
| 02 | SIZE | Each trade stays under a cap per token. | 1,000 USDG or 0.5 WETH per trade |
| 03 | BUDGET | Each token has a daily spending cap, reset at 00:00 UTC. | 2,000 USDG or 1 WETH per day |
| 04 | PRICE | The fill must stay close to the pool's own price. | 1% from the pool; pool fee 1% max; no unknown hooks |
| 05 | WINDOW | Trades happen only in the owner's hours and days. | Weekdays only (UTC) |
The eleven rules#
- 01Only listed assets, on both sides of the trade.
- 02No trade larger than the per-trade cap.
- 03No more than the daily budget per token.
- 04On V2, the minimum output is the pool's quote minus the allowed slippage.
- 05On v4, the contract sets the price limit itself. The agent can't loosen it.
- 06No pool with a fee above 1%, a dynamic fee, or a hook the owner didn't approve.
- 07Trades only inside the trading hours, and on weekdays if the owner says so.
- 08A cooldown between trades, if the owner sets one.
- 09No bond, no trade. Each violation takes 10% of the bond to the owner.
- 10The third violation freezes the agent and sends the rest of the bond to the owner.
- 11Output stays in the vault. Only the owner withdraws, and never the agent's bond.
Try to break it#
The site runs a real mandate contract inside a simulation of the live chain. Pick an attack and watch which rule stops it.
Open Break it