AMM Design (CPMM)
免責事項: このホワイトペーパーは英語版が正式な文書となります。他言語の翻訳は参照用です。
Overview
Section titled “Overview”PIPO uses a Constant Product Market Maker (CPMM) for warrant price discovery and liquidity provision. This is the same proven model used by Uniswap, adapted for structured product characteristics.
Core Mechanism
Section titled “Core Mechanism”The Constant Product Formula
Section titled “The Constant Product Formula”x × y = k
Where:x = Warrant token reserve in pooly = USDC reserve in poolk = Constant product (invariant)Price Derivation
Section titled “Price Derivation”Spot Price = y / x (USDC per Warrant)
Example:x = 100,000 warrant tokensy = 35,000 USDCk = 3,500,000,000
Spot Price = 35,000 / 100,000 = $0.35 per warrantTrading Mechanics
Section titled “Trading Mechanics”Buy (Swap USDC for Warrants)
Section titled “Buy (Swap USDC for Warrants)”User wants to buy warrants with Δy USDC:
New y' = y + ΔyNew x' = k / y' = k / (y + Δy)Warrants received = x - x' = x - k/(y + Δy)
Example:Buy with $1,000 USDC:├── Initial: x=100,000, y=35,000, k=3.5B├── New y' = 35,000 + 1,000 = 36,000├── New x' = 3,500,000,000 / 36,000 = 97,222├── Warrants received = 100,000 - 97,222 = 2,778├── Effective price = $1,000 / 2,778 = $0.36└── Price impact = ($0.36 - $0.35) / $0.35 = 2.9%Sell (Swap Warrants for USDC)
Section titled “Sell (Swap Warrants for USDC)”User wants to sell Δx warrants:
New x' = x + ΔxNew y' = k / x' = k / (x + Δx)USDC received = y - y' = y - k/(x + Δx)
Example:Sell 2,000 warrants:├── Initial: x=100,000, y=35,000, k=3.5B├── New x' = 100,000 + 2,000 = 102,000├── New y' = 3,500,000,000 / 102,000 = 34,314├── USDC received = 35,000 - 34,314 = $686├── Effective price = $686 / 2,000 = $0.343└── Price impact = ($0.35 - $0.343) / $0.35 = 2.0%Pool Architecture
Section titled “Pool Architecture”Per-Warrant Pools
Section titled “Per-Warrant Pools”Each warrant series has its own pool:
┌─────────────────────────────────────────────────────────────────┐│ PIPO AMM POOLS │├─────────────────────────────────────────────────────────────────┤│ ││ SPACEX-CALL-200B-Q42025 ││ ┌──────────────────────────────────────────────┐ ││ │ Warrants: 500,000 | USDC: 175,000 | k: 87.5B │ ││ │ Price: $0.35 | TVL: $350,000 │ ││ └──────────────────────────────────────────────┘ ││ ││ SPACEX-CALL-180B-Q42025 ││ ┌──────────────────────────────────────────────┐ ││ │ Warrants: 300,000 | USDC: 150,000 | k: 45B │ ││ │ Price: $0.50 | TVL: $300,000 │ ││ └──────────────────────────────────────────────┘ ││ ││ SPACEX-PUT-150B-Q42025 ││ ┌──────────────────────────────────────────────┐ ││ │ Warrants: 200,000 | USDC: 30,000 | k: 6B │ ││ │ Price: $0.15 | TVL: $60,000 │ ││ └──────────────────────────────────────────────┘ ││ │└─────────────────────────────────────────────────────────────────┘Pool Factory
Section titled “Pool Factory”// Simplified pool creationcontract PIPOPoolFactory { function createPool( address warrant, // Warrant token address uint256 initialWarrants, // Initial warrant supply uint256 initialUSDC // Initial USDC liquidity ) external returns (address pool);}Liquidity Provision
Section titled “Liquidity Provision”LP Mechanics
Section titled “LP Mechanics”Liquidity providers deposit both warrant tokens and USDC in the current pool ratio:
LP Deposit Process:├── 1. LP has USDC to deposit├── 2. Platform mints warrants at current ratio├── 3. Both assets deposited to pool├── 4. LP receives LP tokens representing share└── 5. LP earns fees proportional to shareLP Token
Section titled “LP Token”LP Token Value = (Pool TVL × LP Share)
Example:├── Pool TVL: $350,000├── Total LP tokens: 1,000,000├── User LP tokens: 50,000├── User share: 5%└── User value: $17,500Impermanent Loss
Section titled “Impermanent Loss”LP positions are subject to impermanent loss:
IL = 2 × √(price_ratio) / (1 + price_ratio) - 1
Example (price doubles):├── Price ratio = 2├── IL = 2 × √2 / (1 + 2) - 1 = -5.7%└── LP loses 5.7% compared to just holdingFee Structure
Section titled “Fee Structure”Trading Fees
Section titled “Trading Fees”| Fee Type | Rate | Recipient |
|---|---|---|
| Base trading fee | 0.30% | LP + Protocol |
| LP share | 0.25% | Liquidity providers |
| Protocol share | 0.05% | Platform treasury |
Fee Accrual
Section titled “Fee Accrual”Fee Calculation:├── Trade: $1,000 USDC for warrants├── Fee: $1,000 × 0.30% = $3.00├── LP receives: $2.50├── Protocol receives: $0.50└── User receives warrants worth $997Slippage Protection
Section titled “Slippage Protection”User Settings
Section titled “User Settings”┌─────────────────────────────────────────────────────────────────┐│ TRADE SETTINGS │├─────────────────────────────────────────────────────────────────┤│ ││ Slippage Tolerance: [0.5%] [1%] [2%] [Custom: ___%] ││ ││ Transaction Deadline: [10 min] [30 min] [1 hour] ││ ││ Note: Transaction will revert if: ││ • Price moves more than slippage tolerance ││ • Deadline passes before execution ││ │└─────────────────────────────────────────────────────────────────┘Implementation
Section titled “Implementation”function swap( uint256 amountIn, uint256 amountOutMin, // Slippage protection uint256 deadline // Time protection) external { require(block.timestamp <= deadline, "Expired");
uint256 amountOut = getAmountOut(amountIn); require(amountOut >= amountOutMin, "Slippage exceeded");
// Execute swap}Price Impact Visualization
Section titled “Price Impact Visualization”Trade Size vs Impact
Section titled “Trade Size vs Impact”┌─────────────────────────────────────────────────────────────────┐│ PRICE IMPACT CURVE │├─────────────────────────────────────────────────────────────────┤│ ││ Price Impact ││ │ ││ 10% │ ● ││ │ ● ││ 8% │ ● ││ │ ● ││ 6% │ ● ││ │ ● ││ 4% │ ● ││ │ ● ││ 2% │ ● ││ │ ● ││ 1% │ ● ││ │ ● ││ 0.5% │ ● ││ └──────────────────────────────────────────────────────── ││ $100 $500 $1K $5K $10K $25K $50K $100K ││ Trade Size ││ ││ Pool TVL: $350,000 ││ │└─────────────────────────────────────────────────────────────────┘Advanced Features
Section titled “Advanced Features”1. Concentrated Liquidity (Future)
Section titled “1. Concentrated Liquidity (Future)”Reserve CPMM can be enhanced with concentrated liquidity:
Concentrated Liquidity Benefits:├── Higher capital efficiency├── Lower slippage for same TVL├── Custom price ranges for LPs└── Better suited for bounded products (warrants)2. Oracle Integration
Section titled “2. Oracle Integration”AMM prices anchored to oracle:
Oracle-AMM Deviation Check:├── Calculate: deviation = |AMM_price - Oracle_price| / Oracle_price├── If deviation > 10%: Display warning├── If deviation > 20%: Increase fees├── If deviation > 30%: Pause trading└── If deviation < 5%: Green status3. Dynamic Fees
Section titled “3. Dynamic Fees”Fees can adjust based on market conditions:
Dynamic Fee Factors:├── Volatility: Higher vol → Higher fees (protect LPs)├── Volume: Higher volume → Potentially lower fees (reward activity)├── Deviation: High deviation → Higher fees (arbitrage protection)└── Time to expiry: Closer to expiry → Slightly higher feesPool Initialization
Section titled “Pool Initialization”Launch Sequence
Section titled “Launch Sequence”New Warrant Series Launch:├── 1. Oracle Committee approves series├── 2. Platform determines initial price (fair value estimate)├── 3. Platform seeds pool:│ ├── Mints initial warrant supply│ ├── Deposits USDC to set price│ └── k = initial_warrants × initial_usdc├── 4. Pool opens for trading├── 5. External LPs can add liquidity└── 6. Price discovery beginsExample Initialization
Section titled “Example Initialization”SPACEX-CALL-220B-Q22026 Launch:├── Initial warrant supply: 1,000,000 tokens├── Target price: $0.20 (20% probability)├── Initial USDC: 200,000├── k = 1,000,000 × 200,000 = 200,000,000,000├── Opening price: $0.20└── Initial TVL: $400,000Pool Monitoring
Section titled “Pool Monitoring”Health Metrics
Section titled “Health Metrics”| Metric | Target | Alert Threshold |
|---|---|---|
| TVL | > $100K | < $50K |
| Daily Volume | > $10K | < $1K |
| Price Impact (10K) | < 3% | > 10% |
| LP Token Price | Stable | > 5% drop/day |
Dashboard
Section titled “Dashboard”┌─────────────────────────────────────────────────────────────────┐│ POOL HEALTH DASHBOARD │├─────────────────────────────────────────────────────────────────┤│ ││ Pool: SPACEX-CALL-200B-Q42025 ││ ││ Status: 🟢 Healthy ││ ││ Metrics: ││ ├── TVL: $347,500 (🟢 above target) ││ ├── 24h Volume: $45,200 (🟢 healthy) ││ ├── Price Impact (10K): 2.8% (🟢 acceptable) ││ ├── Oracle Deviation: 3.2% (🟢 aligned) ││ └── LP Returns (30d): +4.2% (🟢 positive) ││ ││ Liquidity Providers: 47 ││ Largest LP: 12.5% of pool ││ ││ [View Trades] [Add Liquidity] [Pool Analytics] ││ │└─────────────────────────────────────────────────────────────────┘API Reference
Section titled “API Reference”Get Pool State
Section titled “Get Pool State”const pool = await pipo.getPoolState('SPACEX-CALL-200B-Q42025');
// Response{ poolAddress: '0x...', warrantReserve: 500000, usdcReserve: 175000, k: 87500000000, spotPrice: 0.35, tvl: 350000, volume24h: 45200, fees24h: 135.6, lpTokenSupply: 1000000, lpTokenPrice: 0.35}Add Liquidity
Section titled “Add Liquidity”const tx = await pipo.addLiquidity({ pool: 'SPACEX-CALL-200B-Q42025', usdcAmount: 10000, minLpTokens: 28000, // Slippage protection deadline: Math.floor(Date.now() / 1000) + 600});
// Response{ txHash: '0x...', lpTokensReceived: 28571, warrantsDeposited: 14285, usdcDeposited: 10000, shareOfPool: 2.86}