Goal
Verify that trading fees accumulate in the pool and are distributed proportionally to LP token holders upon withdrawal.
Scenario
- LP Alice deposits 10,000 USDC, receives 10,000 GM tokens
- LP Bob deposits 10,000 USDC, receives 10,000 GM tokens (same price, equal shares)
- Trader opens and closes a position, generating 200 USDC in fees
- Alice withdraws all 10,000 GM tokens
- Bob withdraws all 10,000 GM tokens
Assertions
- Alice receives ≈10,100 USDC (10,000 principal + 100 fee share)
- Bob receives ≈10,100 USDC
- Total withdrawn = 20,200 USDC (20,000 principal + 200 fees)
- GM token supply = 0 after both withdrawals
- Pool amounts = 0
Acceptance Criteria
Goal
Verify that trading fees accumulate in the pool and are distributed proportionally to LP token holders upon withdrawal.
Scenario
Assertions
Acceptance Criteria
tests/lp_fee_distribution.rs