Skip to main content

Overview

GeodeFactory handles one-transaction token launches. It deploys a GeodeToken ERC20, mints the full supply to the hook, initializes the v4 pool as an empty shell, configures the hook, and registers the permanent bonding curve — all atomically. The v4 pool is initialized at sqrtPriceAtTick(0) — a hollow shell. The hook handles all pricing via BEFORE_SWAP_RETURNS_DELTA. There is no graduation.

Immutables

Launch Parameters

Launch Flow

launch()

1

Validate

  • totalSupply > 0
  • virtualTokenReserve > 0 and virtualEthReserve > 0
  • deployerRoyaltyBps <= 5000 (max 50%)
  • maxBatchSize between 1 and 256
  • virtualTokenReserve >= totalSupply (all tokens go to curve)
2

Deploy ERC20

Full supply minted to the hook contract.
3

Determine Currency Ordering

Uniswap v4 requires address(currency0) < address(currency1). WETH is always currency0 (lower address). If the token address is lower than WETH, the launch reverts with TokenSortOrderViolation.
4

Build Pool Key & Initialize

The pool IS initialized in v4 at sqrtPriceAtTick(0) — but as an empty shell with no liquidity. The hook handles all pricing.
5

Configure Hook

Calls hook.geodeInitializePool(key, config) with the curve parameters. Because config.deployer != address(0), this call is restricted to the factory.
6

Register Launch

Calls hook.registerLaunch() to set up permanent LaunchState tracking with virtual reserves and token reference.
7

Initialize Price Beacon

Initializes a second v4 pool (same token pair, no hook) at the curve’s starting price. This secondary pool starts with zero liquidity — it serves as a price beacon for external integrators. Community members can add LP organically by buying tokens from the curve and providing two-sided liquidity to this AMM.

Launch Record

Stored in mapping(PoolId => LaunchRecord) public launches with a global launchCount.

Events

Source

GeodeFactory.sol

View the full source code on GitHub (~230 lines).