Curve swap

Curve swap is a Wallet Approval Failure Recovery Workflow

Curve swap is a wallet-confirmed DeFi transaction whose recovery starts by separating the ERC-20 approval call from the swap transaction. A quote selects the input token, output token, amount, route and minimum output before the wallet signs the required on-chain calls. When approval fails, check the network, native gas balance, spender address and existing allowance before retrying. Once the swap confirms, verify its receipt and output-token balance rather than treating a wallet notification as settlement.

Two signatures and the actual transaction cost

Two on-chain transactions cover a fresh ERC-20 approval and the Curve swap, while a sufficient existing allowance reduces the sequence to one.

The approval writes an allowance for the prepared spender; the swap then calls that spender with the quoted route and minimum output. Both consume the network’s native gas token. Ethereum, Arbitrum One, OP Mainnet and Base charge ETH, while Polygon PoS charges POL. Those network costs sit beside the pool fee that the quote already incorporates into expected output.

One hypothetical worked example labels every changing input: the approval uses 50,000 gas, the swap uses 180,000 gas and both use a 20 gwei gas price. The combined gas is (50,000 + 180,000) × 20 gwei = 4,600,000 gwei, which equals 0.0046 ETH. The arithmetic shows the method; it isn’t a live fee quote.

If the approval reverts, the swap never broadcasts. If approval succeeds and the later swap reverts, the allowance remains attached to 1 approved spender.

Allowance boundaries before another attempt

Three values define every ERC-20 allowance used by a Curve swap: the token owner, the spender contract and the approved amount.

ERC-20 represents an approval amount as uint256, a 256-bit unsigned integer whose maximum value is 2^256 − 1. An exact-amount approval caps the available allowance at the planned input, while a maximum approval avoids another approval for later swaps through the same spender. Calling approve again replaces the recorded value for that owner-spender pair.

Ethereum USDT adds a specific recovery branch because its token contract rejects a nonzero approval when a nonzero allowance already exists. Set the allowance to 0 first, let that transaction confirm and then submit the intended nonzero value. This creates 2 approval calls before the swap. A changed Curve route can also name a different spender, so an old allowance won’t satisfy the new call. Match the spender address to the prepared transaction in MetaMask or Rabby, which is discussed in Using Curve swap.

Why does the wallet approval fail?

Four checks resolve most Curve approval failures: active chain, native gas balance, token allowance state and the spender encoded by the prepared transaction.

A Curve wallet approval must match the network that supplied the quote. Ethereum mainnet uses chain ID 1, Arbitrum One uses 42161, OP Mainnet uses 10, Base uses 8453 and Polygon PoS uses 137. A ticker alone can’t prove that match because USDC, USDT and DAI exist as separate contracts across networks. Compare the active chain, token contract and account with the prepared call. MetaMask and WalletConnect present the request; they don’t rewrite its chain, token or spender.

Rejecting the prompt before broadcast creates no transaction hash and consumes no gas. Correct the displayed account or network, then request a fresh approval.

Low native-token balance can stop simulation or submission before the chain sees the call. Reserve enough ETH or POL for the wallet’s displayed limit, without subtracting gas from an ERC-20 input such as USDC.

An earlier pending transaction from the same account can also block the approval. Replace or cancel that earlier transaction with its original nonce, wait for 1 receipt and only then resubmit. A mined approval carrying receipt status 0 failed on-chain. Its decoded revert data should lead to exactly 1 corrected approval.

Route selection and minimum output

Five swap steps fit inside Curve Router v1.2, which executes an off-chain selected route as 1 on-chain transaction with a final minimum output.

Curve Router encodes the path in 11 address slots: input token, pool or zap, output token and the same alternating pattern for later steps. Its swap-parameter matrix contains 5 rows of 5 values covering coin indexes, swap type, pool type and coin count. The off-chain quote estimates final output, while the transaction supplies 1 minimum-output value. If execution would return less, the call reverts. Re-quoting can change the route or bound without changing an allowance already granted to the same token and spender. Curve Router v1.2 stops after 5 swaps.

Pending, replaced, reverted and confirmed states

Four transaction states matter during Curve swap recovery: pending, replaced, reverted and confirmed, each requiring a different next action from the connected wallet.

A pending Ethereum type 2 transaction has 2 fee controls, max fee per gas and max priority fee per gas, plus 1 account nonce.

  • Pending means no receipt exists yet; monitor the original hash and avoid creating a second nonce problem.
  • Replaced means another transaction used the same nonce; follow the replacement hash shown by MetaMask, Rabby or the chain explorer.
  • Reverted means the chain included the call with receipt status 0; the account pays gas and the swap’s state changes roll back.
  • Confirmed means the receipt reports status 1; next inspect the destination, output token and transferred amount.

Nonce order matters because an account’s later transaction can’t settle before an earlier pending nonce. A wallet cancellation creates a replacement transaction from the same account with that nonce, commonly transferring 0 native units back to the sender. When a swap reverts after a separate approval confirmed, the prior allowance remains on-chain because the failed swap can’t undo an earlier receipt. Track both hashes.

In day-to-day use, Curve recovery finishes when the output check agrees with receipt status 1.

Recovery discipline for active DeFi traders

Three records close a Curve swap recovery cleanly: the transaction receipt, the output token’s Transfer event and the wallet’s final token balance.

ERC-20’s Transfer event contains 3 arguments: sender, recipient and amount; the first 2 addresses are indexed. Compare the recipient with your wallet and the token contract with the quoted output asset. Explorers such as Etherscan, Arbiscan and BaseScan expose the receipt and logs, while the wallet balance provides a separate display check. If the token doesn’t appear in MetaMask, adding its correct contract to the asset list changes only the display. The on-chain balance already exists; that display action doesn’t create, reverse or repeat the Curve transaction.

Token decimals explain many apparent output mismatches. Ethereum USDC and USDT use 6 decimals, while DAI, WETH and CRV use 18. The receipt records base units; the interface formats them for reading. This recovery routine suits active DeFi traders who separate approval state, transaction state and balance state before trying again. Ledger and Safe add signing steps, yet the same 3 records close the workflow for 18-decimal CRV.

Helpful answers about Curve swap

Does rejecting a Curve approval in MetaMask spend gas?

No, rejecting an approval before MetaMask broadcasts it spends no gas and produces no transaction hash. The request never reaches the network, so the token allowance remains unchanged. If a hash already exists, the situation differs: the wallet broadcast the call and a mined revert consumes gas. Check the activity record for a hash before deciding whether to reopen Curve and create another approval.

Which native token pays for a Curve approval outside Ethereum mainnet?

The active network’s native gas token pays for the approval, even when the input is USDC or another ERC-20 token. Arbitrum One, OP Mainnet and Base use ETH for gas; Polygon PoS uses POL. The wallet must hold the gas token on that same chain. A balance on Ethereum mainnet can’t fund an approval on Arbitrum One because each network maintains separate account state.

When should an unused Curve allowance be reset to zero?

Reset an unused allowance to 0 after abandoning a route when you don’t expect to use that token-spender pair again. The reset is a separate on-chain approval transaction, so it requires native gas and a wallet confirmation. It doesn’t reverse any completed swap. If a later Curve transaction uses another router or pool contract, that old allowance wouldn’t authorize the new spender anyway.

Could a Safe account complete the same approval-retry sequence?

Yes, a Safe account follows the same on-chain allowance and swap sequence, but its configured signing threshold governs execution. The approval must reach execution before the swap can spend the token, so 2 queued Safe transactions still need correct nonce order. A failed proposal that never executes creates no token allowance. After execution, inspect the Safe transaction hash, the network receipt and the Curve swap output separately.

Does adding the output token to MetaMask repeat the swap?

No, adding an output token to MetaMask changes the wallet’s asset display and doesn’t repeat any Curve transaction. The token balance already belongs to the connected address if the confirmed receipt transferred it there. Use the exact output token contract and correct network when adding the asset. A duplicate symbol on another chain can display a different balance, which is why the contract address matters more than the ticker.

Will switching wallet apps repair an on-chain allowance?

No, switching from MetaMask to Rabby won’t change an allowance recorded for the same owner, token and spender addresses. Both apps read the same chain state when they control the same account. A different account starts with its own balance, nonce and allowance, so it requires a new approval. Fix the network or spender mismatch in the prepared call rather than expecting a wallet interface change to rewrite contract state.

Which contract should receive approval for a routed Curve swap?

The approval should name the exact spender encoded by the routed transaction that Curve prepares. A Curve Router contract commonly receives approval for a routed swap, while a direct pool interaction can name the pool contract instead. Don’t infer the spender from the token symbol or a previous trade. Compare the approval’s spender field with the subsequent swap call on the same chain before signing.

Why does an exact Curve allowance disappear after one swap?

An exact allowance decreases when the spender calls ERC-20 transferFrom to move the approved input into the swap. If the approved amount equals the spent amount, the remaining allowance reaches 0 after successful execution. A reverted swap rolls back that call’s state changes, so it doesn’t consume allowance during the failed transaction. The earlier approval transaction still exists, and its remaining value determines whether the next attempt needs another approval.