> ## 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 Developer Guide

> Learn how to build DAMM v2 integrations with the cp-amm program, TypeScript SDK, Rust guides, Go readers, Data API, and release notes.

DAMM v2 is Meteora's configurable constant-product AMM on Solana. To learn more about DAMM v2, including fee behavior, formulas, Token 2022 support, NFT positions, liquidity mining, and LP strategy, read the following product documentations.

<CardGroup cols={2}>
  <Card title="Learn more about DAMM v2" icon="book-open" iconType="solid" href="/core-products/damm-v2/what-is-damm-v2">
    Overview of DAMM v2, fee behavior, Token 2022 support, NFT positions, liquidity mining, and LP strategy.
  </Card>

  <Card title="DAMM v2 Formulas" icon="calculator" iconType="solid" href="/core-products/damm-v2/formulas">
    Formulas and definitions for price, liquidity, fee, and impermanent loss concepts.
  </Card>
</CardGroup>

## Integration

<CardGroup cols={2}>
  <Card title="Program Accounts" icon="table-cells" iconType="solid" href="/developer-guides/damm-v2/program/accounts">
    Account model for configs, pools, position NFTs, rewards, vesting, token badges, and operators.
  </Card>

  <Card title="Program Instructions" icon="list" iconType="solid" href="/developer-guides/damm-v2/program/instructions">
    Instruction families for pool creation, liquidity, swaps, rewards, locks, operator flows, and admin flows.
  </Card>

  <Card title="Program Events" icon="list" iconType="solid" href="/developer-guides/damm-v2/program/events">
    Event families for pool creation, liquidity, swaps, rewards, locks, operator flows, and admin flows.
  </Card>

  <Card title="Program Errors" icon="triangle-exclamation" iconType="solid" href="/developer-guides/damm-v2/program/errors">
    Anchor custom error codes, enum names, messages, and common integration causes.
  </Card>

  <Card title="TypeScript SDK" icon="code" iconType="solid" href="/developer-guides/damm-v2/typescript-sdk/getting-started">
    TypeScript SDK for interacting with all public DAMM v2 user flows.
  </Card>

  <Card title="Rust Integration" icon="terminal" iconType="solid" href="/developer-guides/damm-v2/rust-integration/library">
    Rust integration with DAMM v2 through CPI and the quote library.
  </Card>

  <Card title="Go Integration" icon="golang" iconType="solid" href="/developer-guides/damm-v2/go-integration/reference">
    Go examples for reading pools, positions, position NFTs, and unclaimed rewards.
  </Card>

  <Card title="DAMM v2 APIs" icon="database" iconType="solid" href="/developer-guides/damm-v2/api-reference/overview">
    Indexed read-only pool discovery, pool groups, OHLCV, volume, and protocol stats.
  </Card>
</CardGroup>

## Program IDs

The `cp_amm` program ID is the same on mainnet and devnet:

| Network      | Program ID                                    |
| ------------ | --------------------------------------------- |
| Mainnet Beta | `cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG` |
| Devnet       | `cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG` |

The pool authority PDA used by the program is:

| Authority      | Address                                        |
| -------------- | ---------------------------------------------- |
| Pool Authority | `HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC` |

<CardGroup cols={2}>
  <Card title="DAMM v2 Program" icon="code" href="https://github.com/MeteoraAg/damm-v2/tree/main/programs/cp-amm">
    Public Anchor program source for DAMM v2.
  </Card>

  <Card title="DAMM v2 IDL" icon="file-code" href="https://github.com/MeteoraAg/damm-v2-sdk/blob/main/src/idl/cp_amm.json">
    Published Anchor IDL used by generated clients and the TypeScript SDK.
  </Card>

  <Card title="TypeScript SDK" icon="node-js" iconType="solid" href="https://github.com/MeteoraAg/damm-v2-sdk">
    Public SDK for transactions, quotes, PDA derivation, and account fetching.
  </Card>

  <Card title="Go Examples" icon="golang" iconType="solid" href="https://github.com/MeteoraAg/damm-v2-go">
    Public Go examples for reading DAMM v2 state.
  </Card>
</CardGroup>

<CardGroup cols={1}>
  <Card title="Pool Fee Configs" icon="gear" iconType="solid" href="/developer-guides/damm-v2/pool-fee-configs">
    Static and dynamic config behavior, fee modes, collect fee modes, and published config keys.
  </Card>
</CardGroup>

<Note>
  The `cp-amm` source, IDL, TypeScript SDK, Rust quote SDK, and Go examples are public.
</Note>

## Commands

| Task                       | Command                                                       |
| -------------------------- | ------------------------------------------------------------- |
| Build TypeScript SDK       | `cd damm-v2-sdk && pnpm install && pnpm run build`            |
| Run TypeScript SDK tests   | `cd damm-v2-sdk && pnpm test`                                 |
| Run TypeScript type checks | `cd damm-v2-sdk && pnpm run check-types`                      |
| Run Rust quote SDK tests   | `cd damm-v2 && cargo test -p rust-sdk`                        |
| Build `cp-amm` program     | `cd damm-v2 && anchor build`                                  |
| Run Go examples            | `cd damm-v2-go && go mod tidy && go run examples/get_pool.go` |

## Stay Updated

<CardGroup cols={1}>
  <Card title="DAMM v2 Changelog" icon="newspaper" iconType="solid" href="/developer-guides/damm-v2/changelog">
    Program, SDK, event, and quote changes for integration planning.
  </Card>
</CardGroup>
