05The rules
How Mandate works
What the contracts check, what the servers do, and what no key can do at all. The figures in the tables are the current values from the contracts.
The mandate in the contract
A desk's rules are written into its vault (the DeskVault contract) when it is created and never change after that. The contract checks them on every trade, and a trade that breaks them does not go through:
- Position size. A position's cost is capped at a share of the vault's capital. The cap applies to the whole position, so topping it up cannot get around it.
- Number of positions. No more than set, and never more than 10, so a withdrawal in tokens always fits in gas.
- Hold. A position cannot be sold before the minimum time after its last buy.
- Price. A minimum output is required and must be no worse than the spot price of every pool on the route, less the allowed slippage.
- Daily turnover. Buys within a UTC day are capped at a share of capital.
- Thesis. Every trade points to a committed thesis of this desk; one thesis, one vault trade.
- Route. Up to 4 Uniswap v4 pools; each pool either has no hook or a hook from the allowed list.
- Stop. If NAV falls from its peak by more than the allowed drawdown, the vault stops trading.
The runner checks the same rules before it sends a trade, and writes the reason for a refusal to the ledger as "Mandate rejected".
The thesis before the trade
Before trading, a desk writes the hash of its thesis to the ThesisRegistry contract: keccak256(abi.encode(payload, salt)), where the payload is the token, side, size and text. Until the thesis is revealed nobody knows its text — the Mandate API does not serve it either, or the desk's intent would be visible before the trade.
After the trade the desk publishes the text and the salt. On Verify a thesis the hash is recomputed in your browser and checked against the contract over a public RPC, so you do not have to trust Mandate's server. The contract stores the commit time; the commit, trade and reveal blocks are in the ledger.
Risk Gate
Before a buy, the token goes through Risk Gate. It checks the hook permissions of every pool on the route and simulates a "buy, then sell" round trip with real token transfers — through a state override in eth_call, with no gas and no real trade. That catches tokens that cannot be sold and hidden taxes: the pools' declared fees are subtracted from the round-trip loss, and whatever is left is an unexplained fee.
The verdict is PASS, WARN, FAIL or UNCHECKED. Which verdicts a desk may buy is written into its mandate (the Risk Gate row in the table above); no desk buys FAIL or UNCHECKED. $MANDATE goes through the same check — its result is on the $MANDATE page.
Vault: deposit, NAV, withdrawal
- Deposit. You send ETH and receive shares at the latest NAV. The entry fee stays in the vault. If the NAV is older than 15 minutes, deposits are closed; the TVL cap limits the size of the vault.
- NAV. The keeper computes and signs it: the vault's ETH plus positions at pool spot. A NAV is published only if every material position (1% of assets or more) agrees with a second price from DexScreener within 5%. The contract rejects a NAV below the ETH it holds, and a jump of more than 20% in one report freezes deposits.
- Withdrawals always work — when the vault is paused, stopped or its NAV is stale. You get your share of the ETH and of every token in the vault. If a token cannot be moved (say its Stock Token issuer paused it), your share is credited to you to claim later, and the rest is paid out at once.
- Performance fee is taken as shares on NAV growth above the high-water mark. Those shares go to the $MANDATE buyback reserve, not to the desk or the keeper. The high-water mark never resets.
FOMO accounts
Besides its vault, every desk has an account on FOMO. Its money comes from the desk treasury (MandateVault) in tranches, and only to that account's wallet; changing the wallet takes a 24-hour delay. The mandate caps each tranche and the daily amount.
The account's results are counted in units, like fund shares: the first tranche buys units at 1.0, every later one at the current price. New money therefore neither creates profit nor hides a drawdown. The keeper publishes the account's equity and records mandate violations in the contract.
$MANDATE
An ERC-20 of 1,000,000,000 tokens with no owner, mint, tax, blacklist or pause. It trades in a Uniswap v4 ETH/MANDATE pool with its own hook. The pool fee is always taken from the ETH side of a swap and split between the desk treasury and the buyback. For the first three minutes of trading the fee is higher — from 25% down to the base — and the surcharge goes to the desk treasury.
Anyone can trigger the split with distribute(), so no ETH sits in anyone's hands. The buyback reserve buys $MANDATE and sends it to 0x…dEaD. The hook owner can only lower the fee.
Who can do what
Mandate's services work with three roles. Here is what each could do if its key were stolen, and what none of them can ever do — the contract code rules it out.
| Role | Can | Cannot |
|---|---|---|
| EXECUTOR executes trades | make bad trades inside the mandate: buy a weak token up to the position and daily limits, sell through a thin pool | withdraw ETH or tokens to its own address; get around the hold, the limits or the hook list |
| KEEPER NAV, tranches, account equity | move the NAV by up to 20% per report — that affects the deposit price and the performance fee, which goes to the buyback anyway; stop a desk | set the NAV below the ETH in the vault; take any money |
| GUARDIAN administrator | pause, manage the allowed hook list, sell positions to ETH inside the vault in an emergency, manage roles | withdraw deposits — there is no such function |
The contracts have not had an external audit. That is why the vaults have a small TVL cap.
Contracts
Addresses appear once the API responds.