> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hyperpad.fun/llms.txt
> Use this file to discover all available pages before exploring further.

# Phases & whitelist

> Run a private→public sale with per-phase pricing and Merkle gating.

A single sale can run as an ordered series of **phases** — e.g. a cheap whitelisted private round
that rolls into an open public round. Leave the phase builder empty for a plain single-phase sale.

<Info>Multi-phase is **fixed-price only** — it can't be combined with [oracle/USD pricing](/projects/pricing-and-caps).</Info>

## Each phase sets

| Field                 | Meaning                                               |
| --------------------- | ----------------------------------------------------- |
| `startsAt` / `endsAt` | The phase's window                                    |
| `tokensPerQuoteUnit`  | The price for **this** phase                          |
| `phaseCap`            | **Cumulative** raise ceiling by the end of this phase |
| `maxBuy`              | Per-wallet cumulative cap during this phase           |
| `merkleRoot`          | Whitelist for this phase (empty = open to all)        |

## The rules

The contract enforces a few invariants so phases stay solvent and predictable:

<AccordionGroup>
  <Accordion title="Price can only go up (rate can only go down)">
    Each phase's rate must be **≤ the previous phase's** — i.e. private buyers never pay *more* than
    public. A cheaper early round that gets more expensive later is rejected.
  </Accordion>

  <Accordion title="Caps are cumulative and increasing">
    `phaseCap` is a running high-water mark and must strictly increase. The **last phase's cap must
    equal the hard cap**.
  </Accordion>

  <Accordion title="Phases don't overlap">
    Each phase starts at or after the previous one ends. A gap between phases simply reads as
    *pending* — no buys until the next phase opens.
  </Accordion>

  <Accordion title="FCFS within every phase">
    First-come, first-served inside each phase too — no pro-rata.
  </Accordion>
</AccordionGroup>

## Whitelists

Gate a phase (or a single-phase sale) with a **Merkle root**. You paste the allowed addresses; the
form builds the tree and stores the root on-chain. At buy time, a whitelisted wallet submits a Merkle
proof — the app derives it automatically for the active phase, so whitelisted buyers purchase straight
from the UI.

<Tip>
  A common shape: **Phase 1** — whitelisted, low price, small cap; **Phase 2** — open, higher price, cap
  \= hard cap. Early supporters get the discount; everyone else gets a fair open round.
</Tip>
