> ## 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.

> [card] [Learn more about DAMM v2](https://docs.meteora.ag/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] [DAMM v2 Formulas](https://docs.meteora.ag/core-products/damm-v2/formulas.md)
>
> Formulas and definitions for price, liquidity, fee, and impermanent loss concepts.

## Integration

> [card] [Program Accounts](https://docs.meteora.ag/developer-guides/damm-v2/program/accounts.md)
>
> Account model for configs, pools, position NFTs, rewards, vesting, token badges, and operators.

> [card] [Program Instructions](https://docs.meteora.ag/developer-guides/damm-v2/program/instructions.md)
>
> Instruction families for pool creation, liquidity, swaps, rewards, locks, operator flows, and admin flows.

> [card] [Program Events](https://docs.meteora.ag/developer-guides/damm-v2/program/events.md)
>
> Event families for pool creation, liquidity, swaps, rewards, locks, operator flows, and admin flows.

> [card] [Program Errors](https://docs.meteora.ag/developer-guides/damm-v2/program/errors.md)
>
> Anchor custom error codes, enum names, messages, and common integration causes.

> [card] [TypeScript SDK](https://docs.meteora.ag/developer-guides/damm-v2/typescript-sdk/getting-started.md)
>
> TypeScript SDK for interacting with all public DAMM v2 user flows.

> [card] [Rust Integration](https://docs.meteora.ag/developer-guides/damm-v2/rust-integration/library.md)
>
> Rust integration with DAMM v2 through CPI and the quote library.

> [card] [Go Integration](https://docs.meteora.ag/developer-guides/damm-v2/go-integration/reference.md)
>
> Go examples for reading pools, positions, position NFTs, and unclaimed rewards.

> [card] [DAMM v2 APIs](https://docs.meteora.ag/developer-guides/damm-v2/api-reference/overview.md)
>
> Indexed read-only pool discovery, pool groups, OHLCV, volume, and protocol stats.

## 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` |

> [card] [DAMM v2 Program](https://github.com/MeteoraAg/damm-v2/tree/main/programs/cp-amm)
>
> Public Anchor program source for DAMM v2.

> [card] [DAMM v2 IDL](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] [TypeScript SDK](https://github.com/MeteoraAg/damm-v2-sdk)
>
> Public SDK for transactions, quotes, PDA derivation, and account fetching.

> [card] [Go Examples](https://github.com/MeteoraAg/damm-v2-go)
>
> Public Go examples for reading DAMM v2 state.

> [card] [Pool Fee Configs](https://docs.meteora.ag/developer-guides/damm-v2/pool-fee-configs.md)
>
> Static and dynamic config behavior, fee modes, collect fee modes, and published config keys.

> [!NOTE]
>
> The `cp-amm` source, IDL, TypeScript SDK, Rust quote SDK, and Go examples are public.

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

> [card] [DAMM v2 Changelog](https://docs.meteora.ag/developer-guides/damm-v2/changelog.md)
>
> Program, SDK, event, and quote changes for integration planning.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.