approve(spender, amount) call, what to check before signing, and how to recover when an approval lands on the wrong contract. For how approvals and permits work conceptually, read Approvals and permit.
When to use this
- The user’s source token is an ERC-20 and you’re about to build a Market transaction, a Delta order, or an AugustusRFQ fill.
- You’re deciding whether to ask the user for a separate
approvetransaction, or whether to bundle apermit/permit2payload into the build call instead. - An earlier swap or order failed with an allowance error and you need to figure out which spender actually needed the approval.
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE (mixed case) for srcToken; Delta moves native ETH as dETH without an approval. See Native ETH (dETH).
The rule (read this first)
Deployed addresses for each spender, per chain: Chains & contracts → Addresses by chain. Delta and AugustusRFQ are not deployed everywhere; code should read availability at runtime via
/resources/contracts.json keyed by chainId.
Agent rules:
- Take the spender from the execution mode of the quote response, not from the user’s natural-language intent. If the quote response carries a top-level
deltaobject, the Delta contract is the spender. If it carries a top-levelmarketobject, Augustus v6.2 is the spender. - If the user asked for a Delta or RFQ flow on a chain without that contract, surface the limitation and offer the available alternatives. Do not silently fall back to a different mode.
Permit and Permit2: agent rules
When the token supports EIP-2612 Permit or Permit2, you can collect a signature instead of a separate on-chainapprove transaction. Approvals and permit covers how the payload is passed into the Delta and Market build calls.
- Detect Permit/Permit2 capability before asking the user for an on-chain
approve; collect the signature instead when supported. - A Permit/Permit2 signature is a user authorization, not a free no-op. Confirm with the user before requesting the signature, the same way you would confirm an on-chain approval.
- Permit/Permit2 signatures bind to a specific spender, amount, deadline, and (for Permit2) nonce. If you requote into a different mode, the existing signature is not transferable: collect a new one for the new spender.
- Delta
LIMITorders and TWAP rest or settle over time, so a permit’s nonce or deadline expires before settlement. Use an on-chain approval for these, not a permit. See Limit Orders and TWAP use on-chain approval.
Allowance checks before signing
Agent rule: never request an approval before the quote response is final and you know the spender. Approvals to the wrong contract are not refunded by the user’s wallet; they leave a stale allowance behind and confuse the next flow.
Failure modes
Examples
Branching by quote response
Switching modes mid-flow
If the user accepts a quote, the approval lands on the matching spender, then they ask to switch from Delta to Market (or vice versa) before signing:- Requote in the new mode.
- Recheck allowance against the new spender. The previous approval does not carry over.
- Either approve again to the new spender, or attach a fresh Permit/Permit2 signature to the new build request.
- Confirm the user understands they’re approving a second contract.
Guardrails
- Take the spender from the quote response shape, not from natural language.
- Never approve Augustus for a Delta order. Never approve the Delta contract for a Market swap.
- Skip ERC-20 approval entirely for native source tokens; use the canonical mixed-case placeholder.
- Detect Permit/Permit2 capability before requesting a separate
approvetransaction. - Use an on-chain approval, never a permit, for Delta
LIMITorders and TWAP. - Re-check allowance against the new spender any time the execution mode changes.
- Treat Permit/Permit2 signatures as one-shot authorizations bound to spender, amount, and deadline; they do not transfer across modes or builds.
- Never assume an infinite allowance to one spender covers another.
Approvals and permit
How approvals and permits work: spenders, Permit vs Permit2, native ETH.
Decision tables
Route user intent and wallet state to the next agent action.
Five-call recipe
The canonical agent loop: quote, build, authorize, submit, track.
Chains & contracts
Per-chain contract addresses for Delta, Augustus v6.2, and AugustusRFQ.