How meteoraag/cpi-examples works
Project type and purpose
• This is a set of Anchor/Solana smart-contract examples demonstrating “Cross-Program Invocation” (CPI) to three external programs (DLMM, Dynamic AMM, M3M3).
• It is not a full application but an on-chain library of instruction handlers plus a local test harness and deployment scripts.
File structure
• Top-level:
• idls/ – JSON interfaces for each target program (dlmm.json, dynamic_amm.json, m3m3.json)
• migrations/ – a TypeScript script (deploy.ts) that deploys the CPI example to a local or test Solana cluster
• programs/cpi-example/ – the Anchor program source in Rust, organized by instruction group:
– instructions/dlmm_cpi/…, dynamic_amm_cpi/…, m3m3_cpi/…
– lib.rs and Cargo.toml for building the on-chain program
• tests and fixtures under programs/cpi-example/tests/ – integration tests that run against a localnet
• package.json, tsconfig.json – manage the TypeScript migration environment
• Anchor.toml, Cargo.* – Anchor and Rust configuration
README for additional insights
• Confirms the repository is exclusively example code for CPI into DLMM and Dynamic AMM (and one M3M3)
• Lists the specific instruction handlers implemented, which map 1:1 to examples in the Rust source
• Notes the required toolchain versions (Anchor, Solana CLI, Rust)