Dodo PMM Pricing Curves and Pool Inventory
Dodo PMM combines a guide price, token reserves, and inventory targets to calculate swap prices along a configurable curve. PMM means Proactive Market Maker. Its slippage factor, k, determines how strongly an inventory shortage changes the marginal price, which is the price for the next small trade. A larger trade spans more of that curve. The pool implementation controls how the guide price and targets change, so the same algorithm can support different liquidity strategies.
Reading Buy and Sell Quotes From One Pool
Consider interpreting buy and sell quotes from a V2 PMM pool when its guide-price update mechanism is initially unknown. That missing input prevents judging how closely the curve follows the wider market. Establish its update mechanism before treating either quote as market tracking. The base token is the asset priced in quote-token units.
Request a quote that buys base with quote tokens, and one that sells base for quote tokens. Express both exchange rates in quote-token units per base-token unit. Each request's trade size still determines its average rate. Buying base removes base inventory; selling it replenishes base while consuming quote inventory.
- Use the same guide price, k, reserve snapshot, and adjusted targets for both requests.
- Identify the asset that each direction removes and whether the trade crosses equilibrium.
- Separate curve movement from fee deductions already included in the quoted output.
- For an executed trade, reconcile the recipient's output with the pool's updated reserves.
A quote leaves balances unchanged. Execution transfers the output and updates reserves; the recipient's actual token receipt establishes what arrived.
Does Every PMM Pool Follow an Oracle?
An external oracle is not a universal PMM requirement; the pool implementation determines how its guide price enters the curve. V1 used oracle-guided pricing, while V2 includes configured-price designs and adjustable private pools. A fixed guide price can remain unchanged while inventory movements alter the marginal price. It therefore does not, by itself, refresh the pool toward the wider market. Most V1 non-stablecoin pools were gradually deprecated and migrated to newer versions, so their historical behavior should not define every PMM pool.
Guide Price, Reserves, and Inventory Targets
Four symbols describe the classic curve's settings: i, k, B0, and Q0. The guide price i expresses base value in quote-token units, after appropriate decimal normalization. The factor k shapes inventory sensitivity. B and Q describe actual base and quote reserves, while B0 and Q0 describe the corresponding equilibrium targets. A target is a pricing reference, not an extra balance that the pool can transfer.
The equilibrium targets do not require the two token holdings to have equal market value. They also need not equal the assets originally deposited. Some implementations recompute a target from current reserves and other parameters. In particular, the V2 Vending Machine (DVM) computes its base target while using a zero quote target. A raw target field therefore cannot explain the quote without its pool's target-adjustment rule.
Inventory Shortages and Equilibrium Crossings
A shortage of base inventory raises the classic PMM marginal price above its guide price when k is positive. That higher price makes further base purchases more expensive and can attract trades that replenish base.
For the base-shortage branch, the marginal-price formula is
P = i * (1 - k + k * (B0 / B)^2).
Here, P measures quote-token units per base-token unit. The inventory ratio is dimensionless.
When quote inventory is short, the corresponding expression is
P = i / (1 - k + k * (Q0 / Q)^2). With positive k, the base price falls below i. Selling base then consumes an increasingly scarce quote reserve, while buying base replenishes that reserve.
Replenishing trades can stop before equilibrium, land on it, or cross into the opposite inventory state. The classic V2 pricing library handles those outcomes separately. A crossing trade combines the return-to-equilibrium portion with the remaining quantity on the other curve branch. That calculation can happen within one swap.
These branches describe the classic state-based model. A pool that constructs a specialized state may use only a particular branch. Interpreting its reserve ratio without that construction can misidentify the inventory target or the relevant price formula.
What Does the K Parameter Change?
The parameter k changes how strongly the pricing curve reacts to inventory displacement, with its normalized range running from 0 to 1. Holding the guide price and relative inventory imbalance fixed, a smaller k keeps the marginal price closer to i. The curve can then exchange more inventory before producing a comparable price deviation. A larger k creates stronger resistance to inventory depletion under those same conditions.
At k = 0, the curve quotes a constant price before fees, subject to available inventory. At k = 1, its base-shortage segment has the inverse-square shape of a constant-product automated market maker (AMM). Intermediate settings concentrate more liquidity around the guide price. Flattening the curve exposes more inventory to a mispriced guide, so low price impact does not establish low risk for the liquidity supplier.
Trade Size, Average Price, and Fees
A trade's average execution price reflects the complete curve segment between its starting and ending inventories, with the relevant branch changing at equilibrium. The pricing calculation integrates over the inventory change to determine the exchanged amount. Removing more of an already scarce asset generally moves farther into a less favorable region.
Pool fees change the output separately from that curve calculation. In the V2 Vending Machine, the quote deducts a liquidity-provider fee and a maintainer fee from the calculated output. Network execution costs form another expense and do not determine the PMM curve's slope. The slippage limit governs acceptable execution relative to a quote; it does not change k. Crowdpooling can establish launch liquidity, whose later trading prices depend on the resulting pool's pricing rules.
Inventory Rebalancing and Realized Gains and Losses
Inventory rebalancing relies on trades that move reserves toward their targets; an attractive price does not force those trades to occur. Arbitrage can encourage that flow when the pool differs from another available market after costs. A stale or unsuitable guide price can also let arbitrageurs acquire inventory at unfavorable terms for the pool. Concentrated liquidity increases capital efficiency around its guide only while the pricing relationship remains useful.
Target regression recalculates the equilibrium reference when relevant parameters change. Under the PMM long-regression rule, the excess side anchors the adjustment and the shortage-side target can change. That reset can recognize a gain or a loss rather than restore the original token holdings.
V1's oracle-following design did not eliminate impermanent loss. Fee income can offset inventory losses, although its sufficiency depends on the pool's trading income and exposure.
Public Liquidity and Private Curve Controls
Public and private V2 pools apply the PMM framework under different funding and control rules. The Vending Machine supports an initially single-token setup, with purchases building quote-side reserves. Its configured curve can also serve other pool arrangements. The Stable Pool (DSP) concentrates liquidity around an anchored exchange rate and uses two-token deposits and withdrawals. An anchored design retains exposure to a breakdown in the relationship between those assets.
A Private Pool (DPP) restricts liquidity provision to its creator and allows authorized adjustments to price, k, fees, and capital. Those controls let a market maker change the quoted strategy without waiting solely for trades to reshape reserves. Parameter changes and liquidity movements can both affect the executable quote. A public pool's participation rules do not grant the same control, and single-token initialization does not establish universal single-token deposit or withdrawal support.
How Do V3 Bid and Ask Curves Differ?
V3 constructs bid and ask PMM curves for each asset, with maker-set price bounds, quantities, and separate kBid and kAsk factors. An internal virtual USD valuation links the input asset's bid curve with the output asset's ask curve. That accounting step does not require receiving an intermediate token. The bid and ask curves are independent: consuming one side does not automatically replenish the other. Cumulative trading consumes the quoted capacity, with no liquidity beyond each curve's configured price bounds. Actual reserves can constrain output further. Oracle protection and vault collateral checks add separate execution conditions where applicable. A V2 reserve-based curve alone therefore cannot reproduce a V3 quote.
Everyday questions about Dodo PMM
Why Can a Raw PMM Guide Price Differ From the Displayed Rate?
A raw V2 guide price uses fixed-point scaling and both tokens' decimal units, so its stored integer does not directly equal a whole-token exchange rate. The conversion must account for base decimals, quote decimals, and the contract's price scale. Reserve and target integers also follow token units. A mismatch in those conversions can make a correctly configured curve appear mispriced.
How Should the V2 R Field Be Interpreted?
R represents a discrete inventory-state label in the V2 pricing struct, while the mathematical expression P = iR uses a continuous price multiplier. The enum distinguishes the classic model's equilibrium, base-shortage, and quote-shortage branches. Treating its encoded value as that multiplier gives the wrong price. The price helper derives the actual marginal price from k and the branch's reserves and target.
Does a PMM Curve Store Individual Buy and Sell Orders?
A PMM pool calculates prices from inventory and curve parameters without maintaining an order book of individual user limit orders. Its bid and ask curves describe the prices at which inventory can trade. Those labels express market-making directions. They do not make every point on the curve an order that a trader can independently amend or cancel.
Can the Trader Address Change a V2 Pool's Net Quote?
The supplied trader address can affect a V2 Vending Machine quote when its maintainer-fee model assigns address-dependent rates. Its quote functions pass that address to the fee model before deducting the maintainer fee. The underlying curve calculation can remain identical. A quote constructed with another address can therefore differ from the applicable fee-adjusted output even when reserves and k match.
When Will a V2 Private Pool Reject a Parameter Reset?
A V2 private-pool reset can revert when reserves at execution fall below the submitted reserve minimums. The proxy interface uses separate minimums for base and quote reserves, alongside an execution deadline. These constraints protect a price update against changes while it waits for execution. A pending reset therefore does not establish that the new curve settings have taken effect.
Updated ·