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

> ## Agent Instructions
> Treat Solana and Robinhood Chain as separate protocol paths.
> Write for people using the KEK.PRO app.
> Treat displayed fees, limits, and availability as environment-specific unless labeled as protocol constants.

# Pricing and TGE

> Derive exact V3 prices and market cap, then map live paired principal to KEK.PRO's irreversible TGE checkpoint.

Read the canonical pool's `slot0.sqrtPriceX96`. V3 stores the square root of
the atomic token1-to-token0 ratio in Q64.96 form.

<figure className="kek-figure kek-figure--robinhood" data-mark="Q96" aria-labelledby="price-pipeline-title">
  <div className="kek-figure__header">
    <span id="price-pipeline-title">Exact pricing / fixed-point pipeline</span>
    <small>Integer arithmetic end to end</small>
  </div>

  <div className="kek-figure__body">
    <div className="kek-figure__formula">
      <span>sqrtPriceX96²</span><b>÷</b><strong>2¹⁹²</strong><b>→</b><span>decimal-adjusted quote</span><b>×</b><span>fixed supply</span>
    </div>

    <div className="kek-readout">
      <div><span>Pool price</span><strong>Q64.96</strong><small>Square first and preserve the exact rational ratio.</small></div>
      <div><span>Valuation</span><strong>bigint</strong><small>Do not pass atomic amounts through JavaScript Number.</small></div>
      <div><span>TGE</span><strong>ever reached</strong><small>Read the irreversible checkpoint separately from live principal.</small></div>
    </div>
  </div>

  <figcaption className="kek-figure__caption">USD conversion is a separate observation with its own source and timestamp.</figcaption>
</figure>

## Exact price

Keep the ratio as integers. Do not convert `sqrtPriceX96`, supplies, balances,
or market cap through JavaScript `Number`.

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
const Q192 = 1n << 192n;

type Fraction = {
  numerator: bigint;
  denominator: bigint;
};

function quotePerToken(
  sqrtPriceX96: bigint,
  tokenIsToken0: boolean,
  tokenDecimals: number,
  quoteDecimals: number,
): Fraction {
  if (sqrtPriceX96 <= 0n) throw new Error("invalid pool price");

  const squared = sqrtPriceX96 * sqrtPriceX96;
  const tokenScale = 10n ** BigInt(tokenDecimals);
  const quoteScale = 10n ** BigInt(quoteDecimals);

  return tokenIsToken0
    ? {
        numerator: squared * tokenScale,
        denominator: Q192 * quoteScale,
      }
    : {
        numerator: Q192 * tokenScale,
        denominator: squared * quoteScale,
      };
}
```

The reviewed launch and quote tokens both use `18` decimals, but integrations
should read decimals instead of assuming equality.

## Market cap and FDV

The launch contract mints a fixed supply once. Calculate quote-denominated FDV
without floating point:

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
function marketCapQuoteAtomic(
  sqrtPriceX96: bigint,
  tokenIsToken0: boolean,
  supplyAtomic: bigint,
): bigint {
  const squared = sqrtPriceX96 * sqrtPriceX96;

  return tokenIsToken0
    ? (supplyAtomic * squared) / Q192
    : (supplyAtomic * Q192) / squared;
}
```

For the contract-reported fixed supply, FDV and fully supplied market cap use
the same value. A circulating-supply metric needs a separate, disclosed
circulation policy. Sending tokens to an arbitrary burn address does not
change this ERC-20's `totalSupply`.

Convert the quote result to USD only with a separately identified ETH/USD
observation and timestamp.

<Note>
  Spot price is not an executable quote. Use the configured V3 quoter or router
  path for trade output, price impact, and a user-selected slippage floor.
</Note>

## TGE state

Read the four-value factory result:

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
const [pairedPrincipal, threshold, liveGraduated, reachedEver] =
  await client.readContract({
    address: launchFactory,
    abi: factoryAbi,
    functionName: "graduationStatus",
    args: [token],
  });

const progressBps =
  threshold === 0n
    ? 0n
    : ((pairedPrincipal * 10_000n) / threshold > 10_000n
        ? 10_000n
        : (pairedPrincipal * 10_000n) / threshold);
```

Map the values as follows:

| Condition                        | Product state                          |
| -------------------------------- | -------------------------------------- |
| `!liveGraduated && !reachedEver` | TGE threshold not currently reached    |
| `liveGraduated && !reachedEver`  | Eligible for permissionless checkpoint |
| `reachedEver`                    | TGE checkpointed                       |

`checkpointGraduation(token)` is permissionless. It succeeds only while live
paired principal meets the threshold. After it succeeds, `reachedEver` remains
true even if live principal falls.

## What paired principal means

The factory derives paired principal from:

* the current pool `sqrtPriceX96`;
* the original locked position's tick range;
* the launch-time position liquidity recorded by the factory.

It is not the pool's raw WETH balance. It does not count later compounded
liquidity toward the original-position threshold.

TGE does not migrate liquidity, create a pool, or change fee allocation.
