Meteora DAMM V2Fee Routing Program
Production-ready permissionless fee distribution system for Meteora DAMM V2 (CP-AMM) pools. Fully implemented with real SPL token transfers, distributing quote fees to investors based on Streamflow locked amounts, with 24-hour permissionless crank and complete state management.
Implementation
100%
All features complete
Token Transfers
Live
Real SPL transfers implemented
Build Size
371 KB
Optimized binary
Security
0
Unsafe code blocks
๐ Deployed on Solana Devnet
Live deployment with vanity addresses - 100% verifiable on-chain
๐ Triple-Bundle Testing Strategy
Most submissions test locally only. We test locally, E2E, AND live on devnet.
Including 7 Rust unit tests for mathematical validation
Watch All 54 Tests Pass
Complete walkthrough showing build, deployment, and all test bundles passing in under 3 minutes
The Challenge
Meteora DAMM V2 pools generate trading fees that need to be distributed fairly among investors based on their locked token amounts in Streamflow contracts.
The distribution must be:
- Quote-only (no base token fees)
- Pro-rata based on locked amounts
- Permissionless (anyone can trigger)
- Paginated for large investor lists
Our Solution
A four-instruction Anchor program that creates an honorary quote-only LP position and distributes fees via a 24-hour permissionless crank:
initialize_policy
Creates immutable Policy PDA with distribution configuration
initialize_progress
Creates mutable Progress PDA for daily distribution tracking
initialize_position
Creates PDA-owned honorary position, validates quote-only configuration
distribute_fees
Claims fees, calculates pro-rata shares, distributes with pagination support
See It In Action
Interactive demonstration of the pro-rata fee distribution algorithm
Live Fee Distribution Calculator
Mock Investors (STAR Token)
Calculation Steps
Pro-Rata Distribution
Sent to creator wallet on final pagination page
Interactive demonstration of pro-rata fee distribution algorithm. All values update in real-time as you adjust the sliders.
Mathematical Model
Distribution Formula
Worked Example
Ready to Explore?
Dive into the technical implementation, review comprehensive test results, or check out the complete documentation.