The five rules
Every trade is checked against all five. If any rule fails, the trade is blocked.
Overview
| Rule | What it stops | Default |
|---|---|---|
| Kill switch | Every trade, while it is on | Off |
| Token allowlist | Buying tokens you never approved | WETH, USDC, UNI |
| Max trade size | One oversized trade | 0.5 ETH |
| Daily spend cap | Spending more than you set in a day | 2 ETH |
| Contract check | Tokens with risky or unverified code | High risk blocked |
Merlin checks the rules in the order above and reports the first one that fails as the reason. The decision also lists the result of every rule, so you can see everything that would have failed.
Kill switch
An emergency stop. While it is on, every trade from the agent is blocked, whatever the other rules say. Turn it on the moment something looks wrong, then investigate.
Token allowlist
The agent can only buy tokens on this list. Add tokens by symbol (WETH) or by contract address (0x…), separated by commas. Matching ignores upper and lower case.
Contract addresses are safer than symbols, because anyone can launch a token with the same symbol. Once the API is live, we recommend addresses for every token you allow.
Max trade size
The largest single trade allowed, in ETH. A trade of zero or less is also blocked. Use this to limit the damage of any one mistake.
Daily spend cap
The total ETH the agent can spend in a day. Merlin adds the new trade to what the agent has already spent today (allowed trades since midnight) and blocks it if the total would go over the cap.
Contract check
Before the agent buys a token, Merlin reads the token's verified source code and scans it for red flags, including Uniswap v4 hooks that can:
- change buy or sell fees after launch
- pause transfers or block selling
- give one wallet special powers
Tokens with no verified source code are always blocked, because code that cannot be read cannot be trusted. High-risk tokens are blocked while Block high-risk contracts is on.
Risk levels
| Level | Meaning |
|---|---|
| Low | Verified code, no red flags found |
| Medium | Verified code with something worth checking |
| High | Verified code with a serious red flag, or unverified code |
The decision
Every check returns the same shape:
- Decision: Allow or Block.
- Reason: one line explaining the result.
- Checks: each rule with passed or failed and a short detail.