PrimerPadDocs

Protocol

DBC mechanics

Meteora DBC prices a launch along a configured curve. Two quantities are easy to confuse: the virtual reserves that define the price, and the real quote reserve that traders actually deposit. Graduation is decided by the real one.

Virtual reserves vs real quote reserve

Virtual reservesPricing parameters. A DBC config defines a start sqrt price and up to 16 curve points, each a sqrt price and a liquidity value. Inside a segment, liquidity L and the current sqrt price behave like constant-product reserves. Nobody holds these amounts; they shape the price.
Real quote reserveActual quote tokens contributed by traders. Stored as quoteReserve on the pool account and held in the pool's quote vault. It starts at zero and grows by the post-fee amount of every buy.
Real base supplyThe full base supply (1,000,000,000 under Primer Standard v1) is minted into the pool's base vault at launch and sold out of it along the curve.

SOURCE CODEDBC SDK math, curve.ts

Step by step: HOUSE / USDX

  1. HOUSE launches. Price starts at the configured start price; the real quote reserve is 0 USDX. The start price comes from the config, not from any deposit.
  2. Alice buys HOUSE with 100 USDX. After the fee, about 98.4 USDX enters the curve and the real quote reserve becomes that amount.
  3. Bob buys with 500 USDX. The real quote reserve grows again; the price has moved up along the curve.
  4. When the real quote reserve reaches the migration threshold, swaps stop at the migration price and the market can migrate.
  5. The resulting DAMM v2 pool holds the real base and real quote tokens: an actual HOUSE / USDX pair.

Quote vault vs quote reserve

The quote vault also holds accrued fees until they are claimed, so its balance exceeds quoteReserve. On the USDX fork run, at curve completion the reserve was 2.685606 USDX and the vault held 2.72937 USDX. FORK PROOF

Curve math

DBC stores prices as square roots in Q64.64 fixed point. Within one curve segment with liquidity L, moving the sqrt price from √Pa to √Pb exchanges exact amounts of each token.

Δquote = L · (√Pb − √Pa)
Quote tokens that enter (buy) or leave (sell) the curve when the sqrt price moves across a segment. More liquidity means more quote is needed to move the price.
Δbase = L · (1/√Pa − 1/√Pb)
Base tokens that leave (buy) or enter (sell) the base vault across the same move.
xvirtual = L / √P,    yvirtual = L · √P,    P = yvirtual / xvirtual
The virtual reserves at the current price. Their ratio is the price; neither amount is deposited anywhere.
graduation % = quoteReserve / migrationQuoteThreshold × 100
Graduation progress is the real quote reserve over the configured threshold.
market cap = P × base supply
Market cap in the quote asset: price per base token times total base supply.

Worked example: HOUSE / USDX

SIMULATIONSIMULATION: Primer Standard v1 production config for USDX, Meteora DBC SDK quote math, steady-state fee

The numbers below come from the Meteora DBC SDK quote functions run against the Primer Standard v1 production config for USDX. Start market cap $5,000, migration market cap $60,000, migration threshold 13,440.55 USDX.

Start price 0.000005000 USDX. Base vault after trader C: 854,992,337 of 1,000,000,000 HOUSE. Only the curve allocation is sold along the curve; the migration allocation stays in the vault and seeds DAMM v2.
TraderUSDX inHOUSE receivedAverage pricePrice afterReal quote reserveGraduationBase sold total
Trader A10019,326,4380.0000051740.00000518298.3750.73%19,326,438
Trader B25045,447,2830.0000055010.000005651344.31252.56%64,773,721
Trader C50080,233,9410.0000062320.000006651836.18756.22%145,007,663

Price vs real quote reserve

0.0µ15.9µ31.8µ47.7µ63.6µ03,3606,72010,08013,441real USDX reserve (quote side of the curve)price per token (USDX, µ = 10⁻⁶)launch50%90%migration thresholdearly trades A, B, C
Hover the curve to read reserve, graduation and price.

The curve is steepest late: each additional USDX near the threshold moves the price more than at launch. The green points are the three early trades from the table.

Migration threshold

0%0 USDX
25%3,360 USDX
50%6,720 USDX
75%10,080 USDX
100%13,441 USDX
Real quote reserve vs the migration threshold of the Primer Standard v1 production config (USDX).
  • migrationQuoteThreshold is fixed in the config. A swap that would cross it is filled only up to the migration price; PrimerPad uses the SDK's PartialFill swap mode for the final buy so the curve completes exactly. FORK PROOF
  • Once quoteReserve ≥ migrationQuoteThreshold, the pool is curve complete and migration to DAMM v2 becomes possible. The instruction is permissionless. SOURCE CODE
  • Thresholds are normalised per quote asset: the Primer Standard targets market caps in USD and converts them at the quote's raw-unit price. See graduation feasibility for why some Primitives use a scaled profile.

See also: Launch lifecycle, Glossary: virtual reserve