1
Prepare
POST /delegate/prepare with owner, agent, tokensIn (each token, maxPerTrade,
maxTotal), tokensOut and expiry. Optional: recipient, floors (default: 10% under Route’s price now, or set
floorBps 100 to 5000), maxSlippageBps (default 100, at most 300), minInterval. Returns the policy, typedData, and
the Permit2 permits and approvals each input token needs.2
Sign and register
The owner signs
typedData and each permit, then POST /delegate/policies with
{ "policy", "signature", "permits": [{ "message", "signature" }] }. Returns the policy hash.3
Trade
For each trade, the agent calls
GET /delegate/quote?policy=&in=&out=&amountIn=, signs the
returned typedData with the agent key, and sends POST /delegate/execute with
{ "trade", "signature" }. Route’s relayer sends it and returns tx.4
Revoke
DELETE /delegate/policies/<hash> stops Route. The hard stop is revoke(hash) or
bumpEpoch() on RouteDelegate from the owner, or a Permit2 lockdown.Stop rules run by Route
A policy without an agent (agent left out) can carry up to 4 rules in POST /delegate/policies:
{ "type": "stop", "tokenIn", "tokenOut", "amountIn", "triggerRate", "confirm" }. Route sells amountIn when the rate falls to
triggerRate (output per input, raw units, 1e18 scale) or below in confirm distinct blocks (default 3). The pair’s floor is the
worst price it may sell at.
Rules
- Every input token needs a price floor; a pair without one cannot trade.
maxPerTrademust be worth at least 20 gas fees. Expiry is at most 365 days out.- The agent cannot be Route’s relayer.
GET /delegate/policies/<hash>shows trades and how much of eachmaxTotalis spent.