Skip to main content

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 same x × y = k math as Uniswap, but with virtual reserves that anchor the curve:
(Vt - S) × (Ve + E) = Vt × Ve = K
Where:
  • 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:
startingPrice = Ve / Vt
For example, with Vt = 1,000,000,000 tokens and Ve = 1 ETH, the starting price is 0.000000001 ETH per token (~0.0000023at0.0000023 at 2,350/ETH).

Price Movement

Buys dispense tokens from the curve. As tokens leave (S increases), the effective token-side reserve shrinks, and the price rises:
priceAfterBuy = (Ve + E + ethIn) / (Vt - S - tokensBought)
Sells absorb tokens back into the curve. As tokens return (S decreases), the price falls:
priceAfterSell = (Ve + E - ethReturned) / (Vt - S + tokensSold)
The curve is fully reversible — tokens can be bought and sold at any time during the active phase.

Curve Math

ETH Cost to Buy

How much ETH does it cost to buy Δs tokens from the current state?
ethIn = K / (Vt - S - Δs) - (Ve + E)
This comes directly from the constant-product invariant. As Δ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 spending ethIn ETH?
Δs = (Vt - S) - K / (Ve + E + ethIn)

ETH Return on Sell

How much ETH do you get back for selling Δs tokens?
ethOut = (Ve + E) - K / (Vt - S + Δs)
Asymptotic pricing: When Vt = totalSupply, the curve price approaches infinity as 100% of tokens are distributed. When Vt > totalSupply, the curve has a finite maximum price at full distribution.

Launch Flow

1

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)
The factory deploys a GeodeToken ERC20, mints the entire supply to the hook contract, and registers the bonding curve. All in one transaction.
2

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
3

Graduation Triggered

When both conditions are met, the phase transitions to PendingGraduation:
  1. ethReserve ≥ graduationEthThreshold (default: 85 ETH)
  2. cumulativeSupplyDistributed ≥ 95% of curveSupply
A GraduationTriggered event is emitted with the terminal curve price.
4

Graduation Finalized

Anyone can call finalizeGraduation():
  1. The Uniswap v4 pool is initialized at the terminal curve price
  2. Remaining tokens + accumulated ETH are used to seed permanent full-range LP
  3. Any unsold tokens are sent to the dead address (0x...dEaD)
  4. Phase → Graduated
  5. The pool now operates in standard Geode mode with real AMM liquidity

Lifecycle Phases

PhaseTradingDirect SwapsAMM
ActiveCurve only (via intents)BlockedNot initialized
PendingGraduationBlocked (awaiting finalization)BlockedNot initialized
GraduatedStandard mode (intents + direct)AllowedLive with seeded LP

Batch Settlement on the Curve

During the Active phase, batch settlement uses ConstantProductCurveLib.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:
  1. Deploy GeodeToken ERC20 (full supply to hook)
  2. Compute the PoolKey deterministically (pool NOT initialized in v4 yet)
  3. Call geodeInitializePool() on the hook with curve configuration
  4. 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.