Add Anchor CPI example for pool initialization with tests #163
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds a complete example project,
cpi-example-damm-v2, demonstrating how to initialize a Meteora DAMM v2 pool via CPI (Cross-Program Invocation) on Solana devnet using Anchor and TypeScript. The changes include Rust and TypeScript source code, configuration files, dependencies, a comprehensive README, and test scripts to provide a ready-to-use template for similar integrations.The most important changes are:
Core Program and Integration:
programs/cpi-example-damm-v2/src/lib.rs) that exposes acpi_initialize_poolinstruction, allowing CPI into the Meteora DAMM v2 protocol to initialize a pool, with all required account validations and cross-program invocation logic.tests/damm_v2.test.ts) that demonstrates end-to-end pool initialization and state verification using the Anchor and Meteora SDKs.Project Setup and Configuration:
Anchor.toml,Cargo.toml, andpackage.jsonto specify toolchain, dependencies, build scripts, and workspace members for both Rust and TypeScript environments. [1] [2] [3] [4] [5] [6]migrations/deploy.ts) as a template for Anchor migrations.Documentation:
README.mdwith setup instructions, prerequisites, test and deployment steps, and troubleshooting tips for running the example on Solana devnet.