Curve StableSwap-NG’s get_virtual_price reports the pool invariant D per LP token, scaled by 10^18. D uses rate-normalized balances and the current amplification value. A proportional withdrawal returns a basket of tokens; a single-coin withdrawal needs a separate quote. The virtual price alone establishes neither output in one chosen token nor a dollar value.
A display reading 2.00 can tempt a reader to multiply an LP balance by two and attach a familiar currency symbol. The missing step is identifying what those two units represent. Following one pool snapshot through the invariant, the ownership fraction and the withdrawal method makes that distinction visible.
Give the getter a unit
This explanation uses the Curve StableSwap-NG plain-pool source at commit 3332cd4. It describes that reference snapshot, rather than every deployed Curve pool. Its get_virtual_price implementation obtains the current precise amplification value, normalizes the balances with the applicable rates, calculates D and divides by LP supply:
virtual price = floor(D × 10^18 / LP supply)
Both D and LP supply use 18-decimal integer conventions here. Dividing the returned getter value by 10^18 produces normalized invariant units per displayed LP token.
The word “price” does not supply an external market price. Curve’s pool-deployment guidance distinguishes a token’s redemption or exchange rate from a market-price feed. A rate-bearing token might normalize into units of its underlying asset. Those units could be associated with ETH or another reference asset rather than dollars.
Keep the three questions separate. D measures the invariant under the pool’s normalization rules. An LP ownership fraction identifies a proportional basket. A market valuation applies explicitly chosen prices to token quantities. Each calculation needs its own inputs.
Follow a 10-LP burn through the ledger
Consider an explicitly hypothetical existing two-token pool. Both A and B have 18 decimals. The accounted balances are 1,000 A and 800 B, after excluding any accrued admin claims. A normalizes at 1 unit per token; B normalizes at 1.25. The current precise amplification value is 10,000, with A_PRECISION equal to 100. There are 1,000 displayed LP tokens outstanding.
These are stipulated snapshot inputs. The supply does not describe an initial deposit or imply a historical return. Assume ordinary token transfers and no intervening swaps, rate updates, rebases or network costs.
| Snapshot item | A | B |
|---|---|---|
| Accounted token balance | 1,000 | 800 |
| Normalized units per token | 1 | 1.25 |
| Normalized balance, xp | 1,000 | 1,000 |
| Tokens for a 1% proportional exit | 10 | 8 |
| Normalized units in that exit | 10 | 10 |
The normalized balances are equal. For this balanced construction, the invariant calculation returns D = 2,000 normalized units. This equality with the sum of xp is a property of the balanced example; it is not a shortcut for arbitrary imbalanced pools.
The virtual price is therefore 2,000 / 1,000 = 2 normalized units per LP. The getter returns the integer 2,000,000,000,000,000,000.
Burning 10 LP removes 10 / 1,000 = 1% of each accounted token balance. The proportional basket is 10 A plus 8 B. Its normalization gives 10 × 1 + 8 × 1.25 = 20 units, matching 10 LP × 2 invariant units per LP.
Curve’s plain-pool withdrawal documentation describes this proportional route through remove_liquidity. The fraction is applied to each token balance, with integer division and minimum amounts for the individual outputs.
After this illustrative exit, the pool holds 990 A and 792 B. Each remaining normalized balance is 990, so D becomes 1,980. LP supply becomes 990. Virtual price remains 1,980 / 990 = 2. The unchanged ratio is consistent with a proportional reduction of the pool and its outstanding claims.
The LP-token ownership guide explains the underlying share concept. The extra step here is retaining the normalization units. Twenty B would normalize to 25 units at the stipulated rate. Attaching “B” to the number 20 changes the claim.
Requesting only B changes the calculation
Suppose the same hypothetical holder wants B alone. Dividing the 20-unit invariant reduction by B’s 1.25 rate gives 16 B. That conversion identifies a useful reference quantity, but it does not solve the single-coin withdrawal.
The documented calc_withdraw_one_coin path reduces the target invariant, solves for the remaining selected-token balance, applies its imbalance-fee calculation and converts back to token units with conservative rounding. In this exact-divisibility example, a proportional exit leaves relative inventory unchanged; a B-only exit leaves A in the pool while reducing B.
To check the difference, reproduce the pinned integer calculation from the opening snapshot. Keep the precise amplification at 10,000. For the fee-bearing case, stipulate fee = 4,000,000 on a 10^10 denominator, equivalent to a 0.04% base fee, and an off-peg multiplier of 50,000,000,000. These are illustrative parameters, not a report of a deployed pool’s settings.
The withdrawal path derives its own fee input: fee × N / (4 × (N − 1)), with N equal to the coin count and integer division. For two coins, the chosen stored fee first becomes 2,000,000. The dynamic multiplier then gives 2,000,010 for each expected balance deviation in this example, before a second invariant solve. It is not a direct 0.04% deduction from 16 B. Curve’s single-coin fee calculation.
| Burn 10 LP from the opening state | Output A | Output B |
|---|---|---|
| Proportional basket | 10 | 8 |
| B-only, zero fee | 0 | 15.999199919992080032 |
| B-only, chosen fee settings | 0 | 15.996000384026473520 |
The calculation reduces D from 2,000 to 1,980 for the single-coin target. Even the zero-fee result is slightly below 16 B because preserving that invariant with a changed inventory is a different problem from scaling both balances down together. The fee-bearing result then reflects the specified withdrawal-fee path and integer rounding.
These are checked arithmetic reproductions of a constructed state, not live transaction simulations. A real quote needs the actual coin index, current state, rates, amplification and fee parameters. The base-fee versus off-peg-fee guide shows how the multiplier changes a fee; use the withdrawal-specific inputs above when applying that mechanism here.
A wallet sending a proportional withdrawal and then swapping A into B would create yet another route. Its total B receipt would depend on the subsequent swap and its costs. Save the operation sequence alongside the expected output; “redeem 10 LP” is insufficient to distinguish those routes.
Mark the basket separately from the invariant
Hold the original hypothetical pool snapshot fixed and introduce two constructed external-price scenarios. These prices are independent marks, not updates to the normalization rates.
| External-price scenario | A price | B price | Value of 10 A plus 8 B |
|---|---|---|---|
| First mark | $0.98 | $1.20 | $19.40 |
| Second mark | $0.80 | $1.00 | $16.00 |
The first value is 10 × $0.98 + 8 × $1.20. The second is 10 × $0.80 + 8 × $1.00. The basket and virtual price remain unchanged by construction, while its marked dollar value falls by $3.40.
This isolates the missing valuation input. A normalization rate can express a redemption relationship even when the token trades at a different market price. It also leaves practical conversion questions: whether redemption is available, which asset it delivers, how long it takes and which costs apply.
Virtual-price growth alone likewise cannot establish a wallet’s net return. Save opening capital, LP quantities, external flows, price marks and paid costs. The pool-fees versus net-return ledger shows how to reconcile that broader account without counting embedded fees twice.
Check the accounting state before trusting the display
Curve’s NG integration guide distinguishes standard, oracle, rebasing and ERC-4626 token handling. Those choices affect the balances and rates used internally. A token label in a wallet is insufficient evidence that the expected accounting path applies.
The pinned getter also warns about donation-style behavior when the implementation contains rebasing tokens. That qualification matters when interpreting a sudden change. A positive movement should trigger an explanation of which input changed before it is classified as earned income or safe collateral value. Historical audit findings also need their version and resolution status: the MixBytes NG report records an earlier donation issue as fixed, which does not establish identical behavior across implementations.
A reproducible withdrawal worksheet can stay compact:
| Save | Check before interpreting the result |
|---|---|
| Chain, pool and implementation | The selected source describes this deployment and pool type |
| Block and timestamp | Balances, supply, rates and precise A refer to the same snapshot |
| Token order and decimals | Coin indices identify the intended output and raw amounts display correctly |
| Accounted balances and admin claims | The inventory belongs to LP accounting rather than an unadjusted wallet balance |
| Rate sources and units | Each multiplier’s reference asset, precision and update rule are understood |
| Burn amount and route | Proportional, single-coin and later swaps have distinct expected receipts |
| Minimum outputs and recipient | Transaction bounds and destination match the intended token quantities |
| External prices and costs | Dollar marks, network charges and later conversions are recorded separately |
Several common errors then become visible. Mixing yesterday’s LP supply with today’s balances fabricates a ratio that was never observed. Replacing precise A with a scheduled target changes the invariant inputs. Treating every token transfer to the pool as immediately recognized liquidity can mix physical holdings with the accounting state; the exchange versus exchange_received guide follows that input-recognition boundary.
Before accepting a virtual-price display, write its unit as “normalized invariant units per LP.” Then calculate the selected withdrawal’s token quantities and apply any external valuation separately. The completed record should name the pool state, the burn amount, the route and the expected assets reaching the recipient.
