How to Balance Wallet Tokens for a Liquidity Position
Filling a concentrated-liquidity position from mismatched wallet balances means swapping the surplus token until your wallet matches the position’s required deposit ratio. The ratio depends on the current pool price and your chosen range, so a generic 50/50 split can leave you short of one asset.
The range and current price set the deposit ratio.
For a concentrated position, token amounts are functions of the current price and the two range boundaries. Let P be the current price in token1 per token0, and let Pa and Pb be the lower and upper prices. If the current price is inside the range, the amounts for liquidity L are proportional to amount0 = L(√Pb − √P)/(√P√Pb) and amount1 = L(√P − √Pa). Outside the range, the position takes only one token: token0 below the range, token1 above it.
For example, suppose token0 is ETH, token1 is USDC, the pool price is $2,000 per ETH, and the range is $1,600–$2,500. Since $2,000 is the geometric mean of those bounds, the required token values are approximately equal. A wallet with 2 ETH and 1,000 USDC holds about $5,000 total; ignoring fees and gas, swap around 0.75 ETH to end near 1.25 ETH and 2,500 USDC.
Swap only the surplus needed for the position.
Use a routed swap for the conversion because the goal is to fund a specific deposit amount, not trade the whole wallet. I use the ParaSwap protocol here to compare routes for the required ETH-to-USDC amount; the route may split execution across liquidity sources, while its minimum received amount sets the output floor you accept.
First calculate the two required deposit amounts from the position interface or its liquidity math, using the pool’s live price and exact lower and upper ticks. Subtract each required amount from the corresponding wallet balance. If one difference is negative, swap only enough of the surplus asset to cover that deficit, then leave a small margin for price movement and rounding.
For the example, a ParaSwap quote should be requested for roughly 0.75 ETH, not the entire 2 ETH balance. Compare the quoted USDC output after gas and any swap fee against the position’s USDC requirement. If the route output falls short, reduce the intended liquidity or adjust the range; do not assume the interface will source the missing amount automatically.
Check the quote and transaction before approving it.
Before submitting, verify the fields that determine whether the swap can safely fund the deposit:
- Chain and token contract addresses match the position’s network and pair.
- The source amount is only the excess token, and the destination is the token the position lacks.
- The route’s minimum received amount covers the target amount after allowing for the pool’s rounding.
- Price impact and estimated gas are acceptable for the trade size.
Set slippage tolerance from the route’s liquidity and volatility rather than copying a fixed default. Around 0.1–0.5% can be a reasonable starting range for a liquid pair in ordinary conditions; thin pools or fast markets may require more, but increasing tolerance also permits a worse fill. A quote is not a guarantee: if the swap moves beyond its minimum received amount before execution, it should revert, costing gas without producing the needed balance.
Complete the swap, then mint against fresh amounts.
- Read the position requirements. Select the exact pool, fee tier, tick boundaries, and intended liquidity, then record the required amount of each token. The UI may round amounts to token decimals and valid tick spacing.
- Quote the deficit-filling swap. Request an exact-input quote for the surplus amount, using the correct chain and token addresses. Check net output after gas and ensure the minimum received amount still covers the deposit deficit.
- Approve and execute the swap. Approve only the amount needed when the token requires an allowance, then submit the swap. A native asset may need wrapping, and a separate approval or transaction may be required before the position can use the output token.
- Refresh and mint the position. After confirmation, reload wallet balances and recalculate the deposit against the live pool price. Mint with the resulting amounts and the position’s desired slippage bounds; if the price moved and the amounts no longer fit, resize liquidity or make a small second swap.
Swapping first usually means two or more transactions, so the wallet must hold enough of the chain’s gas token for the swap, approvals, and mint. A swap-and-mint flow can save a transaction when the position app supports it, but it adds execution coupling: if the final mint parameters or price guard fail, the combined call may revert. For an ordinary wallet-funded position, a fresh balance check between swap and mint is the more reliable path.
Match the swap to the range-specific deposit ratio, preserve enough output to clear the mint’s minimums, and recalculate after the swap settles.