Curve swap is for Active Traders, Balance Checks and Safe Exits
Curve swap is the active trader’s lifecycle for entering a Curve pool route, confirming the output-token balance, rebalancing exposure and closing the trade with an enforced minimum amount received. The decisive record isn’t the quote alone; it’s the settled ERC-20 balance on the intended chain, paired with the transaction receipt. Treat each adjustment as a new on-chain trade because pool reserves, route selection and network gas conditions change between signatures.
Minimum output controls the first failure mode
Minimum output is the entry guardrail: Curve executes the route only when the final token amount meets the value encoded in the transaction.
A quote reads a specific reserve state, while signing and block inclusion happen later. Curve StableSwap NG’s exchange call accepts five inputs: the sold-coin index, bought-coin index, input amount, minimum output and receiver. The minimum output becomes an on-chain condition, so a lower result reverts the whole call. Curve Router v1.2 extends that condition across as many as 5 swap legs, storing a route in 11 address slots and five data fields for each leg. Every intermediate step must complete.
Before signing, match the sold token, received token and receiver with the intended trade. Then read the refreshed output and its minimum, since a route through USDC, USDT or WETH might differ from the route displayed moments earlier. The wallet confirmation should express the same final asset as the interface.
No balance change survives a reverted call, although the network still charges gas for the attempted execution.
Did the swap actually settle?
A Curve swap has settled only when its receipt succeeds and the destination-token balance rises at the intended receiving address.
Two records answer different questions. The transaction receipt proves execution, while the ERC-20 balance proves what the address now controls.
Receipt status
On EVM chains, a receipt status value of 1 marks success and 0 marks failure. A transaction hash carries 32 bytes and appears as 66 characters when its 64 hexadecimal characters include the 0x prefix. Read that hash on the same chain where the wallet signed. StableSwap NG’s TokenExchange event records five fields: buyer, sold-coin index, sold amount, bought-coin index and bought amount.
Token balance delta
The ERC-20 Transfer event holds three fields: sender, receiver and value. Compare those logs with balanceOf for the output contract, since the Curve Router may receive an intermediate token before forwarding the final token. MetaMask and Rabby display a convenient balance, while Etherscan and other chain explorers expose the receipt and contract calls. The settled balance, not a pending activity label, becomes the next trade’s starting amount.
Save the receiver, chain ID, output contract and settled amount together. That four-part record prevents a later rebalance from using a similarly named asset on another network.
Chain identity and token precision
Chain identity and token precision determine which Curve balance belongs to the trade and how its raw integer becomes a displayed amount.
A ticker alone doesn’t bind an asset to one contract or network. Read the network coordinate first, then the token contract and decimal scale.
Network coordinates
Ethereum Mainnet uses chain ID 1. Curve has documented router deployments on Arbitrum One, Base, OP Mainnet, Polygon PoS and Gnosis. Their chain IDs are 42161, 8453, 10, 137 and 100 respectively. MetaMask and Rabby keep separate balances for each network even when the account address looks identical. A USDC balance on Base therefore isn’t the USDC balance recorded on Ethereum Mainnet.
Contract address and decimal scale
An EVM account or contract address is 20 bytes, displayed as 40 hexadecimal characters plus the two-character 0x prefix. Native USDC uses 6 decimal places, while DAI and WETH on Ethereum use 18. One displayed USDC equals 1,000,000 base units; one DAI or WETH equals 1,000,000,000,000,000,000 base units. ERC-20 defines decimals as display metadata, so balanceOf still returns an unsigned integer.
Record the full contract address before a rebalance. That 42-character identifier separates the intended token from another ERC-20 carrying the same symbol.
Routine rebalancing from the settled balance
Routine rebalancing starts from the settled wallet balance, sets a new target amount and submits a fresh Curve quote with a fresh minimum.
Pool composition frames the adjustment. StableSwap NG plain pools support up to 8 coins, while its metapools support 2. A trader rebalancing between USDC and USDT still holds two separate ERC-20 balances, even when both assets track the same unit. Use the actual post-trade amounts rather than the original quote.
In this worked example, all changing inputs are hypothetical: the wallet starts with 12,000 USDC, the target USDT share is 25% by nominal token units, the input is 3000 USDC, the quote is 2992 USDT, the minimum is 2985 USDT, the settled output is 2990 USDT and gas is 0.004 ETH. The example labels token-unit allocation, not live market value.
After settlement, the wallet holds 9000 USDC and 2990 USDT. Those balances total 11,990 nominal token units, so USDT represents 24.94%. The exact record is a 3000 USDC decrease, a 2990 USDT increase and a 0.004 ETH gas decrease. Any next adjustment starts with those three settled deltas.
Safe exits from the asset you actually hold
A safe Curve exit converts or withdraws the exact on-chain asset held, then confirms that the unwanted balance reached the chosen endpoint.
Reverse the output token
A reverse swap treats the current output as a new input. Request a new route, inspect the new minimum and send only the amount intended for closure. Returning USDT to USDC doesn’t reproduce the entry price because reserves and routing state have changed. Full closure means the sold-token balance reaches the trader’s chosen remainder, which might be zero or a retained working amount.
Unwrap only when the asset requires it
The neighboring topic is handled in Curve swap intro to guide quick start. Wrapped assets add a conversion step to the exit definition. WETH represents ETH in ERC-20 form, wstETH wraps stETH and sDAI follows the ERC-4626 vault interface. A trader who wants native ETH hasn’t finished at a WETH balance. Record both operations when the selected Curve route performs the swap and wrapper conversion within one transaction.
Close an LP balance separately
An ordinary Curve swap produces the purchased token, not an LP token. A Curve liquidity deposit mints an LP balance, while an existing LP token can also arrive through an ERC-20 transfer. StableSwap NG’s one-coin withdrawal accepts four parameters: LP burn amount, output-coin index, minimum received and receiver. Its proportional withdrawal returns one amount for every pool coin, with the array length matching the pool’s coin count. A plain pool can contain as many as 8 coins.
The exit record ends on the desired token balance and receiver. For example, a WETH-to-ETH route ends on native ETH, not the intermediate WETH amount.
Advanced route and wrapper edge cases
Curve route edge cases matter when an integrator sends tokens directly, handles rebasing balances or combines a swap with an ERC-4626 conversion.
StableSwap NG assigns standard ERC-20 assets type 0, oracle-priced assets such as wstETH type 1, rebasing assets such as stETH type 2 and ERC-4626 shares such as sDAI type 3. Its exchange_received method derives input from the pool’s token-balance increase, so that path is disabled for pools containing rebasing tokens. The implementation accepts token decimal precision up to 18 and normalizes rates internally to 18-digit precision. These rules explain why two routes with the same visible pair don’t always expose the same call sequence.
For a direct wallet trade, the practical endpoint remains compact: one successful receipt, one final token contract and one settled balance on the selected chain.
Curve swap - common questions
-
Does a hardware wallet change the Curve exit process?
- A hardware wallet changes where the transaction is signed, not the Curve settlement rules. The connected interface still builds the route, input amount, minimum output, receiver and chain ID; the device signs the encoded transaction. Ledger and Trezor devices still depend on a connected wallet for the transaction request. After broadcast, use the same receipt and ERC-20 balance checks as with a software wallet.
-
Which gas asset should remain after a Curve exit?
- ETH pays gas for Curve transactions on Ethereum Mainnet, Arbitrum One, Base and OP Mainnet, while POL pays on Polygon PoS and xDAI pays on Gnosis. Keep the gas reserve separate from the token amount selected for the exit. Selecting the full ERC-20 balance as input doesn’t add the native asset to the swap, yet the transaction still spends native gas. Selling native ETH itself requires subtracting both the intended input and gas.
-
When does a stablecoin rotation count as closed?
- A stablecoin rotation is closed when your defined exposure no longer exists, not merely when the Curve route finishes. Swapping USDC to USDT closes a USDC-denominated position but opens a USDT-denominated one. If the trade objective was simply to leave USDC, the lifecycle is complete after the USDT receipt and balance check. If the objective was to leave on-chain dollar exposure, another conversion or transfer step remains.
-
Why can the wallet’s fiat value differ after settlement?
- Wallet fiat value is a market-price display, whereas the Curve receipt records token amounts in contract units. USDC uses 6 decimals and DAI uses 18, but decimal precision says nothing about either token’s live market price. Portfolio software also chooses its own price feed and update cadence. Reconcile the on-chain token balance first, then treat the fiat figure as a separate valuation layer rather than proof of settlement.