Smart contract architecture
The program's accounts and instructions.
The program is written with Anchor. Its accounts are simple and public:
Vault— PDA at seeds["vault"]: token mint, total shares, deposits flag.Position— PDA derived from your first PQ key: current LMS key, next one-time key, sequence, balance. Holds its own SOL.SignatureBuffer— temporary PDA that stages the 2.5 KB signature; closed (rent refunded) after use.
Instructions
An instruction is marked live only after its integration tests pass on a local validator against the real external programs. The Liquidity Vault instructions also need the LP vault to exist on the cluster you are connected to.
| Instruction | Purpose | Status |
|---|---|---|
initialize | Creates the vault config. Upgrade authority only; refuses mainnet. | live |
register_position | Creates a position controlled by an LMS (RFC 8554) public key. | live |
deposit | Permissionless SOL deposit into a position PDA (capped per position). | live |
signature buffer | Stages a 2.5 KB post-quantum signature across transactions. | live |
withdraw | Verifies an LMS signature on-chain, consumes the key, pays the signed destination. | live |
transfer_to_position | PQ-authorized move into another position. | live |
rotate_key | Replaces the key; last leaf reserved for rotation. | live |
deposit_liquidity | Atomic SOL zap into the Meteora DAMM v2 pool; shares = liquidity added. | live |
withdraw_liquidity | LMS-authorized redemption of LP shares (wallet or Safe Vault). | live |
harvest_lp_fees | Permissionless claim of actual DAMM trading fees. | live |
claim_lp_fees | LMS-authorized fee claim; zeroed before payment. | live |
compound_lp_fees | LMS-authorized reinvestment with a signed minimum. | live |
allocate_creator_fees | Permissionless 80/20 split of SOL contributed to permanent liquidity. | live |
deploy_permanent_liquidity | Permissionless deployment into a permanently locked DAMM position. | live |
harvest_permanent_fees | Recycles locked-position fees into further permanent liquidity. | live |