Skip to content
Reading depth

Each view includes the earlier layers; the complete engineer or auditor page is shown by default.

A liquidity pool holds assets under shared accounting and trading rules so participants can exchange against available reserves.

Opposed arrows category cue

A liquidity pool holds shared inventory under contract rules so traders can exchange against available reserves and providers can account for their positions.

An order-driven market needs makers to maintain individual quotes. A pool makes inventory reusable: a pricing mechanism can offer trades whenever reserves and rules permit. The pool is the asset container and accounting system; the automated market maker is the rule that prices or accepts trades. Keeping those concepts separate exposes more bugs.

Dealer inventory or a pooled market-making fund is a useful analogy. Unlike one dealer’s balance sheet, a smart-contract pool can expose its inventory through a public rule. Depositors normally receive a changing claim on reserves, not a promise to return the exact quantities deposited.

Liquidity providers contribute assets. Traders change reserve composition. Pool and position-manager contracts account for inventory and claims. Pricing logic determines permissible trades. Governance, hooks, or fee recipients may change or receive part of the economic flow.

Reserve tokens are pool assets. A pool share, NFT position, or internal balance is the provider’s pooled share, represented as a claim token or account-bound claim. Separately accrued fees can be another entitlement.

Step-by-step pool lifecycle and state changes

Section titled “Step-by-step pool lifecycle and state changes”
  1. Initialize the pool with its first accountable reserves, price or range state, and provider position.
  2. Accept later liquidity only under the share, range, fee, and rounding rules that preserve existing claims.
  3. Execute swaps by taking input, paying output, charging fees, and updating reserve and price state atomically.
  4. Accrue fees or incentives to the entitled positions without confusing them with unowned token balances.
  5. Burn or reduce a provider claim before releasing its proportional or range-specific reserves and fees.
  6. Reconcile actual balances, recorded reserves, active liquidity, claims, fees, and donations after every event.

A reference-value view can be written as poolValue = Σ(reserveAmount_i × referencePrice_i). Each reserve amount is in its token unit and each reference price uses one declared valuation currency. That valuation is external analysis, not necessarily contract state.

Capital flow follows deposits, trades, withdrawals, and fees. Claim flow follows position minting, transfer, and burning. Return flow starts with trader-paid fees or explicit incentives. Risk flow reaches providers through inventory, token, accounting, contract, range, and governance failures; traders bear execution loss within their authorized bounds.

Pools do not manufacture return. Traders pay fees; token issuers or governance may fund incentives; reserve prices create gains or losses in the valuation currency. Providers absorb inventory changes, adverse selection, and shortfalls unless an explicit junior reserve or guarantor takes the first loss.

Reconcile actual balances, recorded reserves, shares, liquidity, fee growth, ranges, and donations. Test initialization, proportional deposits, unbalanced deposits, zero liquidity, rounding, minimum locked liquidity, callbacks, reentrancy, unusual token transfers, emergency controls, and withdrawal limits. No trade should make accountable reserves negative or bypass pricing and fees.

The Uniswap v2 pair contract is one concrete pool implementation with mint, burn, swap, reserve, and LP-token accounting. Uniswap’s pool documentation explains that version’s model. These references do not define concentrated, multi-asset, managed, stable-swap, or hook-based pools. Both references were reviewed 2026-08-10.

  • “The pool is the pricing formula.” Inventory/accounting and pricing are separate review surfaces.
  • “LPs own their original deposit quantities.” Their claim normally follows the current reserves and position rules.
  • “Contract balance equals available liquidity.” Ranges, claims, fees, locks, or accounting exclusions can make some balances inactive or unavailable.

Continue with the liquidity-provider position.

Machine-readable model

Key equations

Canonical expressions come from the structured concept record. KaTeX renders the notation, while the plain-text expression and variable table keep its meaning and units inspectable without JavaScript. Read the narrative above for the model's domain, assumptions, and rounding rules.

  1. Equation 1

    Plain-text equation: poolValue = sum(reserveAmount_i * referencePrice_i)

Assurance contract

Security properties

These structured statements define desired behavior. Their stable IDs can bind tests, invariants, specifications, audit findings, or proof results without turning descriptive review advice into an assurance claim.

Desired · not evaluated: No test, audit, or proof result is implied until scoped evidence is linked to this property.

  1. Recorded reserves reconcile with accountable token balances under the selected accounting model

  2. Deposits and withdrawals mint or burn claims without transferring more value than the accounting rule permits

  3. Trades cannot make accountable reserves negative or bypass the pool's pricing and fee constraints

  4. Uncollected fees, donations, rounding, and inactive liquidity are handled explicitly

Knowledge check

Quiz

Answer in your own words, then open the model answer.

What problem does Liquidity pool exist to address?

Model answer

Liquidity pools replace or supplement individually posted orders with reusable inventory that a pricing mechanism can quote and settle against continuously.