rust-sdk crate when you need Rust tooling around DAMM v2 quotes and initial pool math.
Install
If your project is in the same workspace asdamm-v2, depend on the local crate by path:
rust-sdk and cp-amm revisions aligned so account structs, fee logic, and quote math match. The Rust library reads cp-amm account structs and math directly.
What It Provides
Program ID
The public DAMM v2 program ID is the same on mainnet and devnet:cp-amm 0.2.0.
Quote Inputs
Rust quote helpers expect a deserializedcp_amm::state::Pool and current chain context:
Use the on-chain account data for transaction-critical quotes. API data is useful for discovery and charts, but the pool account is the source of truth for execution.
The quote modules return the same
SwapResult2 shape used by the program and TypeScript SDK, including claiming_fee, compounding_fee, protocol_fee, referral_fee, included_fee_input_amount, excluded_fee_input_amount, output_amount, next_sqrt_price, and amount_left.
Initial Price Helpers
Use the initial-price helpers when preparing pool creation inputs in Rust:
For transaction construction, use the TypeScript SDK unless your Rust stack owns signing, simulation, and account planning.

