What Is a Token Approval in DeFi? Before You Swap
A token approval in DeFi lets a named contract spend up to a set amount of one ERC-20 token, so know what a swap allowance exposes and how to revoke it.
By Web3 Report Editorial5 min read
A token approval in DeFi lets a specific contract move up to a set amount of one ERC-20 token from your wallet, provided the token has an allowance for that contract. For a comparison of KyberSwap and Uniswap as swap options, see kyberswap vs uniswap, which covers how the two fit this choice. The allowance exists because a contract needs permission set with approve before it can use transferFrom to take tokens from your wallet.
Think of it like authorising a particular service to charge your card up to a limit: the approval names the spender and sets the maximum amount. It is not the swap itself. That distinction matters because a contract with an active allowance may be able to spend from it later, until the allowance is used up or set to zero.
An approval gives one contract a token-specific spending limit
An ERC-20 approval sets a spender and a maximum amount for one token on one chain. It does not grant access to every asset in your wallet, or automatically follow you to another network. The spender is usually a contract address, such as a router contract that coordinates a swap.
On a USDC swap through the KyberSwap Aggregator, the router is the spender: you approve it to use some amount of your USDC, then the swap transaction can spend from that allowance. The pools and liquidity sources used along the route do not each receive separate approvals from you. The router handles the route; your approval names the contract that can pull the approved token amount.
This is the part that is easy to miss when the swap draws on several liquidity sources. A route may involve multiple pools, but the allowance is set for the router, not for each pool. That makes the spender address the key thing to understand when reviewing an approval.
The allowance can be less than your wallet balance, equal to the amount you plan to swap, or unlimited. With an exact-amount approval, the router can spend no more than that amount of the token under the allowance. An unlimited allowance saves future approval transactions and their gas, but it leaves more available to that contract if the contract is compromised. Approval does not mean the contract has already taken the tokens; it sets the amount it may draw.
Native ETH does not need an ERC-20 approval because it is not an ERC-20 token. Wrapped ETH and tokens such as USDC do: they are ERC-20 assets held by contracts, and the router needs an allowance to transfer them from your wallet.
Choose the allowance with the trade-off in mind
A limited approval caps the amount the spender can draw under that allowance; an unlimited approval reduces repeat approval transactions. Neither choice removes the need to check which contract is named as spender. If you are new to approvals, approving only what you expect to use keeps the allowance’s potential exposure smaller.
Suppose you planned to swap 100 USDC but changed the amount to 40 before approving. The amount you approve can change with your plan, and a 40 USDC allowance limits what the router can draw from that allowance. What stays the same is the spender: the approval still names the router, not the pools in the route.
Approval and swap transactions are often confused because both can appear around the same trade. They differ visibly: an approval transaction changes the token allowance, while a swap transaction exchanges tokens and uses the allowance to move them. Treating the approval as the swap can lead you to assume the trade is complete, or to approve a larger amount than intended just to get past the first transaction.
EIP-2612 offers another way to grant an allowance: a permit is an off-chain signature that can be submitted to set the allowance, rather than a separate on-chain approval transaction signed directly as a transaction. It changes how the permission is authorised, not the basic idea that a spender receives an allowance. A permit signature still deserves care: signing one can grant token spending permission.
Related questions
How to revoke a token approval
You can revoke an old allowance by setting it to zero with a transaction. Etherscan’s approval checker and Revoke.cash let you review allowances and submit revocations. Look at the token and spender together: an allowance is specific to both, and a revocation for one spender does not clear allowances granted to others.
Is an unlimited approval safe
An unlimited approval is convenient, but it leaves the named contract able to draw up to the token’s full available allowance. That increases the amount exposed if the contract is compromised. A limited approval reduces that exposure, though it may mean approving again for a later swap.
Why does a swap need two transactions
A swap may need two transactions because one sets the ERC-20 allowance and the next performs the trade. The approval authorises token spending; the swap uses that permission to exchange tokens. Some token flows can use a signed permit instead of a separate approval transaction.
Two questions readers ask next
Does revoking an approval cost gas?
Yes, revoking an on-chain allowance requires a transaction, which uses gas on that chain. The transaction sets the allowance to zero; reviewing allowances is free, but changing one is an on-chain action.
Can a signed permit be misused by phishing sites?
Yes, a permit signature can be misused if you sign a malicious request that grants an allowance. Read what token, spender, amount and expiry the signature covers before signing, and treat permit requests as spending permissions even when no on-chain approval transaction appears first.