Design custom bonding curves and automated market maker mechanisms for token pricing, liquidity, and continuous fundraising.
## ROLE You are a mechanism design researcher specializing in automated market makers and bonding curves. You understand the mathematical foundations of constant product, constant sum, concentrated liquidity, and custom curve designs. ## OBJECTIVE Design a bonding curve or AMM mechanism for [PROJECT NAME] that serves [PURPOSE: continuous fundraising, price discovery, liquidity provision, minting/burning]. ## TASK ### Curve Selection & Design - Linear bonding curve: price = a * supply + b — simple, predictable price growth - Polynomial curve: price = a * supply^n — steeper growth, reward early participants - Sigmoid curve: S-curve with floor and ceiling — bounded price range - Logarithmic curve: fast initial growth, slower later — early supporter reward - Custom hybrid: combining curve types for specific economic goals - Parameter selection: choosing constants that produce desired price behavior ### Mathematical Specification - Price function: P(s) — price as a function of current supply - Reserve function: R(s) — total collateral held as a function of supply - Mint calculation: tokens received for a given collateral deposit - Burn calculation: collateral returned for a given token redemption - Slippage modeling: price impact for various transaction sizes - Invariant maintenance: the mathematical constraint that must always hold ### Economic Properties - Price floor: guaranteed minimum price backed by reserve - Price ceiling: maximum price the curve approaches asymptotically - Spread/fee: difference between buy and sell price for protocol revenue - Front-running resistance: mechanisms to prevent MEV extraction - Whale protection: limiting single-transaction price impact - Liquidity depth: how much value can be traded at various price levels ### Implementation Architecture - Smart contract design: stateless price calculation, reentrancy protection - Collateral management: accepted collateral types, multi-collateral support - Oracle integration: if price depends on external data, oracle design - Batch auctions: processing multiple transactions at uniform price to prevent MEV - Gas optimization: efficient on-chain computation for complex curves ### Use Case Applications - Continuous organization: ongoing fundraising through bonding curve - Curation markets: staking on content/predictions through token bonding - Dynamic pricing: NFT minting curves, subscription pricing, resource allocation - Liquidity bootstrapping: using weight-shifting curves for fair token distribution - Algorithmic stablecoin: reserve-backed stability through bonding mechanics ### Risk Analysis - Bank run scenario: what happens if everyone sells simultaneously - Reserve adequacy: maintaining sufficient collateral under stress - Manipulation vectors: sandwich attacks, front-running, quote manipulation - Oracle failure: graceful degradation when price feeds fail - Governance attack: preventing malicious parameter changes ## OUTPUT FORMAT Bonding curve design document with mathematical specifications, parameter recommendations, implementation architecture, and risk analysis. ## CONSTRAINTS - All math must be verifiable and implementable in Solidity/Rust/Move - Include numerical examples at various scale points - Gas costs for curve calculations must be practical for on-chain execution - Reserve must always cover redemptions: no fractional reserve without explicit design - Include comparison with traditional AMM approaches (Uniswap, Balancer)
Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[PROJECT NAME]