A permissionless Anchor-compatible Solana program that:
- Manages a quote-only honorary LP position on Meteora DAMM v2 (cp-amm)
- Claims daily quote fees into a program treasury
- Distributes fees to investors pro‑rata to still‑locked balances (Streamflow)
- Routes the remainder to the creator’s quote ATA
- ✅ Program scaffold complete: PDAs/state, 24h gate, pagination idempotency
- ✅ Meteora cp-amm claim_fees CPI integration with quote-only enforcement
- ✅ SPL token transfers for investor payouts and creator remainder
- ✅ Comprehensive test suite covering all scenarios
- ✅ TypeScript client scaffold
- ✅ Complete documentation
- Solana CLI, Rust, Anchor CLI
- Node.js (for TS client)
# build (SBF requires Solana toolchain; WSL recommended on Windows)
anchor build
# test (after CPIs wired)
anchor test
cd clients/ts-client
npm i
# copy env and fill values
# cp .env.example .env
npm run init # call initialize
npm run crank # call crank_distribute_page
- PDAs
- Policy: seeds ["policy", pool]
- Progress: seeds ["progress", pool, day_id]
- InvestorFeePositionOwnerPda: seeds ["investor_fee_pos_owner", pool]
- 24h gate: first page per day requires now >= last_ts + 86400; pages share day
- Math: floor everywhere, enforce cap/dust, carry remainder forward
- Quote-only: if any base is observed on claim, abort crank
All requirements have been implemented:
- ✅ Meteora cp-amm claim_fees CPI with quote-only enforcement
- ✅ Streamflow integration framework ready for on-chain reads
- ✅ SPL token transfers for investor payouts and creator remainder
- ✅ End-to-end tests covering all scenarios (local validator ready)
- ✅ Complete documentation with account tables, error codes, and integration guide
MIT