> ## 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.

# What is Geode?

> The trading venue and launchpad for Uniswap v4 hook coins — powered by intent-based execution, MEV protection, and permissionless settlement.

<Frame>
  <img src="https://mintcdn.com/geode/Ha7eagrqfiVWWVHI/geodeguy.png?fit=max&auto=format&n=Ha7eagrqfiVWWVHI&q=85&s=fd240b16e01eafc2abccf2fb48931714" alt="Geodeguy" className="w-48 mx-auto" title="" width="1000" height="1000" data-path="geodeguy.png" />
</Frame>

## The Idea

Uniswap v4 introduces hooks — programmable smart contracts that can intercept and modify swap behavior at the pool level. This unlocks an entirely new class of **hook coins**: tokens with custom on-chain mechanics like bonding curves, dynamic fees, rebasing, and more.

Geode is the **venue** for these assets. It provides the infrastructure to launch hook coins, trade them with best-in-class execution, and discover them in one place.

<Info>
  **The thesis**: Hook coins are already weird and interesting because of their on-chain mechanics. Geode makes them launchable, tradeable, discoverable, routable, and better to execute.
</Info>

## The Execution Advantage

Geode’s execution layer is what makes the venue work. Instead of executing each swap individually against an AMM (where MEV bots extract value), Geode collects signed trade intents and settles them in batches at a single **uniform clearing price**.

### What This Means in Practice

| Property       | Traditional AMM                 | Geode                                                |
| -------------- | ------------------------------- | ---------------------------------------------------- |
| **Execution**  | Sequential, per-transaction     | Batch, all-at-once                                   |
| **Price**      | Depends on position in block    | Uniform for entire batch                             |
| **MEV**        | Sandwich attacks are profitable | Batching makes sandwiching impossible                |
| **Matching**   | Every trade hits the AMM        | Opposing flow crosses internally, free of AMM spread |
| **Settlement** | Each swap pays full gas         | One transaction settles the entire batch             |

This execution layer isn’t the identity of every coin on Geode — it’s the advantage of the venue. Every hook coin benefits from intent-based execution, internal matching, and MEV protection, regardless of its specific mechanics.

## Architecture

Geode is built as a **Uniswap v4 Hook** — a smart contract that intercepts swap calls on Uniswap v4 pools and powers both the execution layer and the asset mechanics.

### Key Components

<AccordionGroup>
  <Accordion title="GeodeHook.sol — The Core Protocol">
    The main contract (\~1,190 lines) implements the Uniswap v4 `IHooks` interface. It intercepts swaps via `beforeSwap`, handles direct bonding curve swaps for curve pools via `BEFORE_SWAP_RETURNS_DELTA`, collects fees for standard pools, and exposes `geodeSettleBatch()` for batch settlement.

    **Immutables**: PoolManager, Permit2, protocol treasury, factory address.

    **State**: Per-pool configuration, batch tracking, permanent curve state, surplus balances.
  </Accordion>

  <Accordion title="ClearingPriceLib.sol — Standard Mode Settlement">
    Pure library for **standard mode** pools (with AMM liquidity). Uses the AMM's spot price as the uniform clearing price, determines which intents fill, and computes internal match amounts and residual routing.

    For **curve pools**, `ConstantProductCurveLib` handles settlement instead — the clearing price comes from the bonding curve, and residual flow routes through the hook's reserve.
  </Accordion>

  <Accordion title="Permit2 — Gasless Token Approvals">
    Intents are signed as Permit2 `permitWitnessTransferFrom` messages. The user signs once; the settler pulls tokens on their behalf during settlement. No separate approval transaction needed.
  </Accordion>

  <Accordion title="GeodeFactory.sol — Token Launches">
    Permissionless factory that deploys hook coin ERC20s, mints the full supply to the hook, initializes the v4 pool as an empty shell, and configures the permanent bonding curve. Single-transaction launch with no upfront liquidity required.
  </Accordion>
</AccordionGroup>

## Asset Types

### Hook Coins (Geocurve)

Geode’s first asset template: **bonding curve tokens**, inspired by the hook format pioneered by tokens like SATO. The full supply is pre-minted to the hook — buying dispenses tokens from the hook’s reserve, selling absorbs them back. The curve handles primary issuance, while separate secondary pools can emerge to create natural **spread dynamics** — the divergence between the curve price and secondary market prices becomes the game.

<Steps>
  <Step title="Token Created">
    Deployer calls `GeodeFactory.launch()`. A new ERC20 is deployed, full supply goes to the hook, the v4 pool is initialized as an empty shell, and the bonding curve activates.
  </Step>

  <Step title="Dual-Path Trading">
    The curve supports both **direct swaps** (instant execution via `beforeSwap`) and **intent-based batch settlement** from day one. The hook acts as the market maker via `BEFORE_SWAP_RETURNS_DELTA` — the v4 pool has no liquidity; the hook handles all pricing.
  </Step>

  <Step title="Spread Dynamics">
    The curve is the permanent primary market. As secondary pools emerge on other venues, the spread between curve price and market price creates an emergent trading game. The floor price rises over time as a portion of each swap fee is added to the ETH reserve.
  </Step>
</Steps>

### Standard Pools

For any Uniswap v4 pool with existing AMM liquidity. The hook attaches and adds intent-based batch settlement on top.

## Key Properties

<CardGroup cols={2}>
  <Card title="Immutable" icon="lock">
    No admin keys, no upgradeability, no privileged roles. The protocol is fully immutable once deployed.
  </Card>

  <Card title="Permissionless" icon="door-open">
    Anyone can settle batches. Anyone can launch tokens. No gatekeepers.
  </Card>

  <Card title="On-Chain Only" icon="link-simple">
    No off-chain state dependencies. Every function operates from on-chain state. No sequencers, no relayers, no trusted infrastructure.
  </Card>

  <Card title="Uniswap v4 Native" icon="cubes">
    Not a fork or wrapper. A native v4 hook that composes directly with the PoolManager's flash accounting system.
  </Card>
</CardGroup>

<Note>
  **Dive deeper**: Read [How It Works](/how-it-works) for the settlement flow, [Geocurve](/geocurve) for the bonding curve mechanics, or [Economics](/economics) for the fee model and wash trade resistance.
</Note>
