Documentation Index
Fetch the complete documentation index at: https://docs.geode.ag/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Geocurve is Geode’s token launch mechanism. It provides price discovery for new tokens from block zero — no upfront liquidity, no presales, no hidden allocations. When enough ETH is raised, the curve automatically graduates into a permanent Uniswap v4 AMM pool.Think of it as: A bonding curve that acts as a bootstrap market. It starts at a low price, rises as demand increases, and eventually hands off to a real AMM with seeded liquidity.
How It Works
The Bonding Curve
The Geocurve uses a virtual constant-product formula — the samex × y = k math as Uniswap, but with virtual reserves that anchor the curve:
- Vt = virtual token reserve (immutable, set at launch, ≥ totalSupply)
- Ve = virtual ETH reserve (immutable, set at launch)
- S = cumulative tokens distributed to buyers
- E = cumulative real ETH raised from sales
- K = invariant constant (Vt × Ve)
Starting Price
At launch (S = 0, E = 0), the price is simply:Price Movement
Buys dispense tokens from the curve. As tokens leave (S increases), the effective token-side reserve shrinks, and the price rises:Curve Math
ETH Cost to Buy
How much ETH does it cost to buyΔs tokens from the current state?
Δs approaches (Vt - S), the price approaches infinity — you can never buy the entire virtual supply.
Tokens for ETH
How many tokens do you get for spendingethIn ETH?
ETH Return on Sell
How much ETH do you get back for sellingΔs tokens?
Launch Flow
Deploy
The deployer calls
GeodeFactory.launch() with:- Token name and symbol
- Total supply (e.g., 1 billion tokens, 18 decimals)
- Virtual reserves (Vt, Ve) that define the curve shape
- Deployer royalty (up to 50% of surplus)
- Graduation ETH threshold (default: 85 ETH)
GeodeToken ERC20, mints the entire supply to the hook contract, and registers the bonding curve. All in one transaction.Active Trading
The pool enters the Active phase. During this phase:
- All trading goes through the Geocurve (no AMM — the v4 pool isn’t even initialized yet)
- Direct swaps are blocked (only intent-based batch settlement)
- Buy intents dispense tokens from the hook’s reserve
- Sell intents absorb tokens back
- Settlement fees work the same as standard mode (0.1% from each intent’s input)
- The deployer earns royalties from surplus
Graduation Triggered
When both conditions are met, the phase transitions to PendingGraduation:
ethReserve ≥ graduationEthThreshold(default: 85 ETH)cumulativeSupplyDistributed ≥ 95%of curveSupply
GraduationTriggered event is emitted with the terminal curve price.Graduation Finalized
Anyone can call
finalizeGraduation():- The Uniswap v4 pool is initialized at the terminal curve price
- Remaining tokens + accumulated ETH are used to seed permanent full-range LP
- Any unsold tokens are sent to the dead address (
0x...dEaD) - Phase → Graduated
- The pool now operates in standard Geode mode with real AMM liquidity
Lifecycle Phases
| Phase | Trading | Direct Swaps | AMM |
|---|---|---|---|
| Active | Curve only (via intents) | Blocked | Not initialized |
| PendingGraduation | Blocked (awaiting finalization) | Blocked | Not initialized |
| Graduated | Standard mode (intents + direct) | Allowed | Live with seeded LP |
Batch Settlement on the Curve
During the Active phase, batch settlement usesConstantProductCurveLib.computeLaunchSettlement() instead of the standard clearing price algorithm. The key differences:
- Clearing price = current curve price (not AMM spot price)
- Internal matching works the same way — opposing flow crosses at the curve price
- Residual flow routes to/from the hook’s reserve via the curve (no AMM swap)
- Net buy residual → hook dispenses tokens, ETH goes to
launchEthReserve - Net sell residual → hook absorbs tokens, ETH returns from
launchEthReserve
GeodeFactory
The factory contract handles the one-transaction launch:- Deploy
GeodeTokenERC20 (full supply to hook) - Compute the PoolKey deterministically (pool NOT initialized in v4 yet)
- Call
geodeInitializePool()on the hook with curve configuration - Call
registerLaunch()to set up launch state tracking
Permissionless
Anyone can launch a token. No whitelisting, no approval process. The deployer pays only gas.
Fair Launch
No presales, no hidden allocations. The entire token supply goes to the bonding curve. Every buyer gets tokens at the current curve price.
Automatic Graduation
No manual migration needed. When thresholds are met, anyone can finalize the graduation to seed the AMM.
Deployer Royalty
Deployers earn a share of the surplus generated by their token’s trading activity — sized from matched volume and drawn from accumulated surplus. During the active curve phase, surplus may be minimal since direct swaps are blocked.
GeodeToken
The minimal ERC20 deployed by the factory:- Full supply minted to the hook contract at deployment
- Standard ERC20 interface (name, symbol, 18 decimals)
- Supports burn and transfer-from-hook operations
- No admin functions, no minting after deployment
Price continuity: At graduation, the v4 pool is initialized at the terminal curve price. This ensures there’s no price discontinuity between the bonding curve and the AMM — traders see a seamless transition.