> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meteora.ag/llms.txt
> Use this file to discover all available pages before exploring further.

# DAMM v2 Changelog

> Track DAMM v2 release notes, breaking changes, and upgrade guidance for cp-amm, SDKs, events, quotes, and API integrations.

<Tip>
  Track DAMM v2 releases here.
</Tip>

<Update label="cp-amm 0.2.0" description="Compounding Liquidity" rss="DAMM v2 cp-amm 0.2.0 adds Compounding Liquidity, layout version reserve tracking, and collect fee mode updates, with breaking changes for swap quotes, event parsing, fee results, and partner fee handling. SDK 1.3.7.">
  <Info>
    Mainnet deployment for Release 0.2.0 is planned for March 13, 2026, at 11:00 AM UTC+8 (Friday).
  </Info>

  <Warning>
    **Breaking release.** If you build swap instructions manually, run DLMM swap quotes, or index certain DLMM events, please plan an upgrade before mainnet deployment.
  </Warning>

  ## Release summary

  | Component      | Version | PR                                                                    |
  | -------------- | ------- | --------------------------------------------------------------------- |
  | Program        | `0.2.0` | [damm-v2 #187](https://github.com/MeteoraAg/damm-v2/pull/187)         |
  | TypeScript SDK | `1.3.7` | [damm-v2-sdk #101](https://github.com/MeteoraAg/damm-v2-sdk/pull/101) |

  ## What We Shipped

  * Compounding Liquidity

  ## What To Do

  <div style={{overflowX: 'auto', marginBottom: '1.5rem'}}>
    <table>
      <thead>
        <tr>
          <th>Integrators</th>
          <th>What Changed</th>
          <th>What To Do</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td><strong>Swap Routers</strong></td>

          <td>
            <ul>
              <li>Swap quote computation</li>
            </ul>
          </td>

          <td>
            <ul>
              <li>For concentrated pools, update your quote logic to exclude <code>partnerFee</code> from fee calculations</li>
              <li>For compounding pools, update your quote logic to use the constant-product formula <code>x \* y = k</code>. Compute quotes using token\_a\_amount, token\_b\_amount, and liquidity from pool state.</li>
            </ul>
          </td>
        </tr>

        <tr>
          <td><strong>Trading Terminals</strong></td>

          <td>
            <ul>
              <li><code>EvtSwap2</code> event parsing</li>
              <li>Tracking of pool reserves amounts for compounding pools</li>
            </ul>
          </td>

          <td>
            <ul>
              <li>swap\_result.partner\_fee is removed. Total trading fee is now split into claiming\_fee and compounding\_fee. Update event deserialization accordingly.</li>
              <li>Read token\_a\_amount and token\_b\_amount directly from pool state (not derived from liquidity math).</li>
            </ul>
          </td>
        </tr>

        <tr>
          <td><strong>Partners</strong></td>

          <td>
            <ul>
              <li>Swap quote computation</li>
              <li>Pool liquidity derivation</li>
            </ul>
          </td>

          <td>
            <ul>
              <li>Bump your SDK version to <code>@meteora-ag/cp-amm-sdk\@1.3.6.rc.1</code> to start testing.</li>
            </ul>
          </td>
        </tr>
      </tbody>
    </table>
  </div>

  ## Program: `cp-amm` `0.2.0`

  Program ID (mainnet and devnet): `cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG`

  [Program PR #187](https://github.com/MeteoraAg/damm-v2/pull/187)

  ### Added

  * Pool now will track reserves balances `(token_a_amount, token_b_amount)` if `pool.layout_version == 1`. For pool layout\_version 0, operator can call the new endpoint `fix_pool_layout_version` to pump pool version.
  * Add a new `collect_fee_mode (Compounding)`, in the new collect fee mode, fee will be collected in quote token, and a percentage of fee (configurable) will be added in reserves for compounding. In the new collect fee mode, the pool doesn't have concentrated price range, instead following constant-product formula `token_a_amount * token_b_amount = constant`.
  * Endpoints `create_config`, `initialize_customizable_pool` and `initialize_pool_with_dynamic_config` will allow user to create pool with `collect_fee_mode == Compounding`, and config for `compounding_fee_bps`.

  ### Changed

  * Related to event `EvtSwap2`, in `swap_result` field, `partner_fee` will be replaced by `compounding_fee`, now total\_trading\_fee will be calculated as `swap_result.claiming_fee + swap_result.compounding_fee`

  ### Removed

  * Removed `partner` field from Pool struct
  * Removed unused `partner_fee` feature and the `claim_partner_fee` endpoint

  ### Breaking Changes

  * Quote function will be changed by the new fee mode

  ## TypeScript SDK: `@meteora-ag/cp-amm-sdk` `1.3.7`

  [SDK PR #101](https://github.com/MeteoraAg/damm-v2-sdk/pull/101)

  <Tip>
    Early testing: [`@meteora-ag/cp-amm-sdk@1.3.6-rc.1`](https://www.npmjs.com/package/@meteora-ag/cp-amm-sdk/v/1.3.6-rc.1).<br /> Production: [`@meteora-ag/cp-amm-sdk@1.3.7`](https://www.npmjs.com/package/@meteora-ag/cp-amm-sdk/v/1.3.7).
  </Tip>

  ### Added

  * Added new `CollectFeeMode.Compounding` mode — a constant-product (x \* y = k) liquidity mode where a configurable percentage of trading fees are compounded back into pool liquidity (as token B), with the remaining fees available for claiming. Pools with compounding mode do not use price ranges.
  * Added `LiquidityHandler` interface and two implementations: `CompoundingLiquidityHandler` and `ConcentratedLiquidityHandler`, with a `getLiquidityHandler` factory function that dispatches based on `collectFeeMode`.
  * Added `compoundingFeeBps` field to `PoolFeesParams` for configuring the compounding fee split.
  * Added `collectFeeMode` parameter to `getLiquidityDelta`, `getDepositQuote`, `getWithdrawQuote`, and `preparePoolCreationParams`.
  * Added `tokenAAmount`, `tokenBAmount`, and `liquidity` parameters to `getDepositQuote` and `getWithdrawQuote` for compounding liquidity calculations.

  ### Changed

  * Rewrote `swapQuote.ts` to use `LiquidityHandler` abstraction, supporting both concentrated and compounding liquidity modes.
  * Fee structure: `tradingFee` split into `claimingFee` + `compoundingFee` in `SwapResult2`, `FeeOnAmountResult`, and `SplitFees` types.
  * Renamed `PoolVersion` enum to `LayoutVersion`.
  * `PoolFeesParams.padding` changed from `number[]` to `number`.
  * `splitFees` and `getFeeOnAmount` no longer accept `hasPartner` parameter.
  * `getQuote` `totalFee` now computed as `claimingFee + compoundingFee + protocolFee + referralFee`.
  * `getQuote2` return type: `tradingFee` and `partnerFee` replaced with `claimingFee` and `compoundingFee`.
  * `collectFeeMode` comment updated: `0: BothToken, 1: OnlyB, 2: Compounding`.
  * Liquidity delta and amount functions (`getLiquidityDeltaFromAmountA`, `getLiquidityDeltaFromAmountB`, `getAmountAFromLiquidityDelta`, `getAmountBFromLiquidityDelta`) now accept `collectFeeMode` and dispatch to the appropriate handler.

  ### Removed

  * Removed `claimPartnerFee` endpoint and `ClaimPartnerFeeParams` type.
  * Removed `partnerFee` from fee result types (`FeeOnAmountResult`, `SplitFees`, `SwapResult2`).
  * Removed `hasPartner` helper function.
  * Removed `FEE_PADDING` constant.
</Update>
