spec_content = """
Pump Science is a Solana-based protocol implementing an advanced bonding curve mechanism with automated liquidity management and dynamic fee structures. The protocol enables the creation and management of token markets with predictable pricing and liquidity.
The protocol uses a constant product market maker (x * y = k) with the following parameters:
- Virtual Token Reserves: 1,073,000,000,000,000
- Virtual SOL Reserves: 30,000,000,000
- Initial Token Supply: 793,100,000,000,000
- Reserved for Liquidity: 206,900,000,000,000
- Total Supply: 1,000,000,000,000,000
The bonding curve maintains several critical state variables:
- Real token reserves
- Real SOL reserves
- Virtual reserves (for price computation)
- Completion status
- Start time
- Creator address
The protocol implements a three-phase fee structure:
-
Launch Phase (t < 150):
- 99% fixed fee
- Prevents early speculation
-
Transition Phase (150 ≤ t ≤ 250):
- Linear decrease following F(t) = -0.0083 * t + 2.1626
- Gradual reduction in fees
-
Mature Phase (t > 250):
- 1% fixed fee
- Encourages market participation
All fees are collected by the protocol multisig: 3bM4hewuZFZgNXvLWwaktXMa8YHgxsnnhaRfzxJV944P
Automated liquidity provision triggers at 85 SOL threshold:
- Protocol fee extraction
- Meteora AMM pool creation with:
- 206,900,000 tokens
- Remaining SOL (after fees)
- LP token locking with protocol-controlled escrow
- Users can purchase tokens along the bonding curve
- Price increases with supply
- Includes dynamic fee based on phase
- Minimum output amount protection
- Users can sell tokens back to the curve
- Price determined by constant product formula
- Fees deducted from output amount
- Slippage protection via minimum receive amount
- Parameter initialization
- Optional whitelist configuration
- Launch timing settings
- Initial purchase configuration
- Whitelist functionality for controlled launches
- Admin controls for parameter updates
- Multisig requirements for critical operations
The migration phase occurs automatically when the bonding curve reaches completion:
- Mint remaining 206,900,000 tokens
- Extract protocol fees
- Create Meteora AMM pool via CPI
- Lock liquidity with protocol-controlled escrow
-
Access Control
- Role-based permissions
- Multisig requirements for critical operations
- Whitelist capabilities
-
Economic Security
- Dynamic fee structure prevents manipulation
- Virtual reserves maintain price stability
- Automated liquidity management
-
Technical Controls
- Program-owned PDAs for secure state management
- Cross-Program Invocation (CPI) validation
- Comprehensive testing suite
The protocol includes two testing layers:
-
Unit Tests (Rust):
- Bonding curve mathematics
- State transitions
- Fee calculations
-
Integration Tests (Bankrun):
- End-to-end trading scenarios
- Liquidity provision
- Migration process