Transfer amount exceeds allowance: why your swap failed and fix it
What does transfer amount exceeds allowance mean on your swap? The router tried to pull more tokens than you approved; confirm and raise the allowance, then retry.
Merkle Street Newsroom#4c853d3 min read
“Transfer amount exceeds allowance” means the swap’s router tried to pull more of your token than you approved, so the swap reverted. The token contract checks the router’s allowance before moving tokens through transferFrom; when the requested amount is too large, the check fails and no tokens leave your wallet.
An allowance is permission for a specific spender to transfer a specified amount of your token from your wallet. When you approve a swap, you grant that permission to the router that handles the token swap. The approval does not move the tokens; it sets the limit the router can later use.
The swap follows a short chain:
- You submit a swap with an input amount.
- The router calls the token’s transferFrom function to take that amount from your wallet.
- The token compares the amount with your allowance for that router.
- If the amount exceeds the allowance, the token reverts the call and the swap fails.
The allowance check happens before the token transfer. It is like a spending limit: a request above the limit is declined, and the transfer does not go through.
Why the swap amount can exceed your approval
Your swap can fail when the router requests more tokens than the approved amount. Say you approve 50 USDC to a router, then try to swap 80 USDC. The router asks the token to transfer 80, but the allowance is only 50, so the check fails and the swap reverts.
This can happen after editing the approval amount in your wallet before signing. Set it below the amount you intend to swap, and the later transfer request can exceed the limit. It can also happen when you increase the swap amount after approving, or when an earlier swap used up an exact approval.
SyncSwap’s router-based token swaps make this allowance flow concrete. The zksync defi topic is a useful example because a router must pull the input token to carry out a swap. The approval needs to cover the amount the router will pull for that transaction.
The message is associated with OpenZeppelin’s ERC-20 implementation: versions before v5 revert with this text when the requested amount exceeds the allowance. OpenZeppelin v5 instead raises the ERC20InsufficientAllowance error. The wording may vary by token implementation, but the underlying allowance check is the same.
How to clear the allowance error and retry
To clear the error, make sure the approval has confirmed and covers at least the amount you plan to swap. Check the amount in your wallet’s approval request before signing. If it is too low, approve the router for a sufficient amount, wait for that approval transaction to confirm, then submit the swap again.
Approval and swap are separate transactions. Sending the swap before the approval confirms can leave the router with the old allowance when it tries to pull your tokens. Waiting for confirmation ensures the new permission is recorded before the swap begins.
A failed allowance check stops the token transfer, so your swap input remains in your wallet. You lose only the gas spent on the failed attempt. Once the confirmed allowance covers the swap amount, resubmit the swap.