> ## Documentation Index
> Fetch the complete documentation index at: https://pons-labs-llc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Reading state

> Read a v2 launch: its record and phase, curve reserves, price, graduation progress, fee rates, metadata and buyback vest.

## The launch record

The factory keeps one record per launch with everything needed to route and
label it.

```ts theme={null}
const factoryAbi = parseAbi([
  "struct LaunchedToken { address token; address curve; address deployer; address creatorFeeRecipient; address pairToken; uint256 graduationThreshold; uint24 poolFee; int24 tickSpacing; uint16 creatorTaxBps; bool buybackEnabled; uint8 phase; uint256 sweptQuote; uint256 sweptTokens; uint256 sweptAt; bool exists; }",
  "function getLaunchedToken(address token) view returns (LaunchedToken)",
]);

const launch = await client.readContract({ address: factory, abi: factoryAbi, functionName: "getLaunchedToken", args: [token] });
```

`pairToken` is the zero address for ETH. `exists` is false if this factory did
not launch the token; try the [other stacks](https://pons-labs-llc.mintlify.site/developers/contracts.md#older-v2-stacks).

### Phases

`phase` is the authoritative signal for where a launch trades. Do not infer it
from balances or events.

| `phase` | Name | Means |
| - | - | - |
| `0` | NotGraduated | Trading on the curve. Also the state after a failed automatic sweep |
| `1` | Swept | Curve closed and emptied; pool not created yet |
| `2` | PoolCreated | Trading on Uniswap v4 |
| `3` | Rescued | The owner's recovery path was used. Has never happened. See [admin powers](https://pons-labs-llc.mintlify.site/protocol/admin-powers.md) |

## Curve reserves

The pricing reserve includes a virtual opening reserve, the phantom quote. It
sets the starting price and is never withdrawable, so the pricing reserve
always reads higher than what was collected.

| Read | Returns |
| - | - |
| `getReserves()` | Pricing reserves `(quoteReserve, tokenReserve)`, phantom included |
| `realQuoteReserve()` | Quote actually collected and held, net of fees |
| `sellableTokens()` | Tokens still buyable before the curve closes |
| `reservedTokens()` | Supply held back for graduation. Fixed at launch |
| `readyToGraduate()` | True once `sellableTokens()` is zero |

The reserved amount is `supply × phantomQuote ÷ (phantomQuote + threshold)`. On
today's config that is 285,714,285.7 tokens of the 1,000,000,000 supply.

## Price and progress

```ts theme={null}
const curveAbi = parseAbi([
  "function getReserves() view returns (uint256 quoteReserve, uint256 tokenReserve)",
  "function realQuoteReserve() view returns (uint256)",
  "function graduationThreshold() view returns (uint256)",
]);

const [quoteReserve, tokenReserve] = await client.readContract({ address: curve, abi: curveAbi, functionName: "getReserves" });

// Spot price of one whole token in whole quote units. Both reserves are raw
// units: scale by the quote asset's decimals (6 for USDG, 8 for cbBTC).
const price = (Number(quoteReserve) / Number(tokenReserve)) * 10 ** (18 - quoteDecimals);

// Progress toward graduation, 0 to 1, by quote raised.
const [raised, threshold] = await Promise.all([
  client.readContract({ address: curve, abi: curveAbi, functionName: "realQuoteReserve" }),
  client.readContract({ address: curve, abi: curveAbi, functionName: "graduationThreshold" }),
]);
const progress = Number(raised) / Number(threshold);
```

Measure progress one way and stick to it. Quote raised against the threshold
and tokens sold against the sellable allocation only agree at 0 and 100%; in
between, tokens-sold runs well ahead.

## Fee rates

`feeBps` and `creatorTaxBps` on the curve are fixed for the life of the launch,
so cache them per token. Their sum is what a trader pays on the quote leg.

`getLaunchFeePolicy(token)` on the factory returns how the fee is divided:

```ts theme={null}
"struct FeePolicy { address protocolFeeRecipient; uint16 protocolFeeShareBps; uint16 buybackBurnBps; uint16 hookFeeBps; uint16 maxInternalPriceImpactBps; }",
"function getLaunchFeePolicy(address token) view returns (FeePolicy)",
```

Today it returns `(0x31eA…2CDB, 3000, 5000, 100, 300)`: Pons takes 30% of the
1% fee, and when buybacks are on, half of the rest is set aside for the buyback.
Despite its name, `buybackBurnBps` burns nothing. See
[buyback and burn](https://pons-labs-llc.mintlify.site/protocol/buyback-and-burn.md#creator-buyback-and-vest).

## Token metadata

Name, symbol and decimals are plain ERC-20 reads. The rest comes from one call
on the token.

```ts theme={null}
"struct Socials { string twitter; string telegram; string discord; string website; string farcaster; }",
"function getTokenInfo() view returns (address tokenDeployer, string tokenLogo, string tokenDescription, Socials tokenSocials)",
```

## Buyback vest

A launch with buybacks on holds its bought-back tokens in the
[buyback vault](https://pons-labs-llc.mintlify.site/developers/contracts.md#v2), vesting linearly over
`VESTING_DURATION`, 157,680,000 seconds (five years of 365 days).

```ts theme={null}
const vaultAbi = parseAbi([
  "function totalLocked(address token) view returns (uint256)",
  "function totalReleased(address token) view returns (uint256)",
  "function vestedAmount(address token) view returns (uint256)",
  "function releasable(address token) view returns (uint256)",
  "function vestingStart(address token) view returns (uint256)",
  "function release(address token) returns (uint256 released)",
]);
```

* `vestingStart` is weighted by size and moves forward as new buybacks land, so
  compute progress from it, not from the launch date.
* `release(token)` may be called only by the creator fee recipient or the
  protocol recipient; anyone else gets `NotVestBeneficiary`. One call pays both
  sides, 70% creator and 30% protocol, into the escrow, in the launch token.

## Pending fee recipient changes

`pendingCreatorFeeRecipient(token)` returns a recipient change the owner has
proposed, with its `effectiveAt` and `expiresAt` times, or zeros when none is
pending. See [admin powers](https://pons-labs-llc.mintlify.site/protocol/admin-powers.md#redirecting-creator-fees).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.