Swapping Without Permit2
The Uniswap Trading API supports an alternative swap flow that does not require Permit2 signatures. This option is available for integrators that cannot support Permit2 signing flows due to infrastructure constraints. In this flow, the swapping wallet grants a standard ERC-20 approval directly to a proxy contract, which then routes the swap through the Universal Router. This allows integrators to maintain a traditional approve —> swap transaction flow without generating a Permit2 signature. However, we strongly recommend using the Permit2 flow whenever possible, as it provides better security and a more flexible approval model for users.When to Use Proxy Approval
The no-Permit2 flow may be appropriate if:- Your infrastructure requires a strict approve —> swap transaction sequence
- Your system cannot generate Permit2 signatures
- Your wallet or signing system does not support EIP-712 signing
How The Proxy Approval Flow Works
Instead of using Permit2 approvals, users approve a proxy contract that forwards the swap to the Universal Router. The transaction flow becomes:- User approves the proxy contract for the input token
- The swap transaction is sent to the proxy contract
- The proxy contract forwards execution to the Universal Router
/check_approval, /quote, and /swap requests:
- Your application calls
/check_approvalwithx-permit2-enabled: falsein the header - The API returns an approval transaction for the proxy contract (if necessary)
- The swapping wallet (your user) signs the transaction and you broadcast it
- Your application calls
/quotewithx-permit2-enabled: falsein the header - The API returns a quote and route.
permitDatais alwaysnull - Your application calls
/swapwithx-permit2-enabled: falsein the header to generate a final swap calldata - The swapping wallet (your user) signs the swap transaction and you broadcast it
Enabling the Proxy Approval Flow
The Trading API exposes a request header that disables Permit2 behavior:x-permit2-enabled: false
When this header is included, the API switches to the proxy approval model. This affects three endpoints:
| Endpoint | Behavior |
|---|---|
| /check_approval | Returns ERC-20 approve calldata targeting the proxy contract |
| /quote | Does not include permitData |
| /swap | Swap transaction targets the proxy contract instead of Permit2 |
0x02E5be68D46DAc0B524905bfF209cf47EE6dB2a9.
Approval & Simulation Behavior
When using the proxy approval flow, the approval and simulation path differs from the standard Permit2 integration. In the Permit2 flow, the API simulates three calls to account for the wallet’s approval state:- approve(token —> Permit2)
- Permit2 approve —> Universal Router
- Swap execution
- approve(token —> proxy)
- Swap execution via the proxy contract
x-permit2-enabled: false
The Trading API will automatically adjust approval checks, simulation behavior, and gas estimation to match the proxy-based swap flow.
Transaction Flow comparison
Both flows ultimately execute swaps through the Universal Router, but the approval model differs as shown below:Permit2 Flow (recommended)
- Wallet approves Permit2 for token spend (token —> Permit2)
- Permit2 message signature sets amount of token Permit2 can spend in a transaction
- swap via Universal Router
Proxy Approval Flow
- Wallet approves proxy contract for token spend (token —> proxy)
- swap via proxy —> Universal Router
Why We Recommend Permit2 Over Proxy Approval
Permit2 provides important security and usability advantages over the proxy approval workflow.1. Reduced Approval Risk
Traditional ERC-20 approvals (e.g. proxy approval) grant persistent unlimited token allowances to a contract. If a contract is compromised, those approvals remain active. This is the most common attack vector for malicious actors to drain victim wallets. Permit2 enables signature-based approvals that are scoped to a specific swap, reducing long-lived approval risk.2. Fewer Wallet Transactions
Permit2 allows approval and swap authorization to be combined into a single transaction flow. This improves user experience by reducing unnecessary approval transactions. One long-lived Permit2 approval can be reused with new off-chain (e.g. non-transaction) signatures for each subsequent swap.3. More Flexible Permissioning
Permit2 supports:- Token allowances scoped to specific contracts
- Expiring approvals
- Signature-based authorization
4. Better Handling of Fee-on-Transfer Tokens
Permit2 also avoids an extra token transfer that occurs in the no-Permit2 proxy flow.- In the standard Permit2 flow, tokens move directly from the wallet to the Universal Router in a single transfer.
- In the proxy approval flow, tokens are first transferred from the wallet to the proxy contract, and then forwarded to the Universal Router.