> For the complete documentation index, see [llms.txt](https://docs.unstable.run/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unstable.run/launching-a-coin/initial-dev-buy.md).

# Optional initial buy

The **Initial buy** field on the launch modal lets you snipe your own launch — in the same transaction, before anyone else can trade.

Concretely: the factory swaps whatever `USDT0` amount you specified through the fresh pool via `SwapRouter02`, and hands you the tokens the swap returns.

## Why it exists

Two reasons:

1. **Activate the pool.** A launch without an initial buy has zero USDT0 on the quote side — technically live, but the current tick sits exactly at the tickUpper of your position, which V3 defines as "out of range". Some scanners and bots read that as "empty pool". A tiny initial buy (\~$1) pushes the tick into range and marks the pool as tradeable everywhere.
2. **Seed the creator.** If you want to hold some of your own coin without buying separately after launch, do it here — you avoid MEV bots that would otherwise front-run your post-launch buy.

## The 5% cap

The factory refuses any launch where the initial buy would leave you holding **more than 5% of total supply** (50,000,000 tokens on a 1B-supply launch). Concretely:

```solidity
if (tokensOut > MAX_INITIAL_BUY) revert InitialBuyExceedsCap();
```

The cap is:

* **Hardcoded**, not a config knob. You can't opt out.
* **Enforced atomically**, in the same transaction as the launch. Nothing gets minted or spent if the cap would breach.
* **Total** — meaning if you'd receive 50,000,001 tokens, the entire launch reverts and you get your USDT back. It's not a partial fill.

### Why 5%?

Because the whole pitch of Unstable is *fair launch*. A creator walking away with 20-30% of supply in a single transaction — however atomic — reintroduces the exact rugpull surface fair launches exist to remove. 5% is a small enough bag that it feels like a normal participant's position, not a founder's stash. Traders who read the deploy tx can trust that at t=0, no wallet held more than 5% + whatever they sniped.

## How to size it

The pool at t=0 has:

* **1,000,000,000** tokens
* **0** USDT0

The starting price is `~$0.000002 USDT / token` (see [Pool & starting price](/under-the-hood/pool-and-price.md)). Because Uniswap V3 pools use concentrated liquidity, the first dollars in cause outsized token withdrawals — the closer you get to the cap, the more USDT you need per token.

Rough guide:

| Your USDT0 in | Tokens back (approx) | % of supply     |
| ------------- | -------------------- | --------------- |
| $1            | \~500,000            | 0.05%           |
| $5            | \~2,500,000          | 0.25%           |
| $10           | \~5,000,000          | 0.5%            |
| $50           | \~24,900,000         | 2.5%            |
| $100          | \~49,300,000         | 4.9% (near cap) |
| $200+         | reverts              | > 5% cap        |

Numbers are approximate — the exact tokens-out depends on where the pool ends up after your swap. Front-ends can call the Uniswap `QuoterV2` before launch to get an exact estimate.

## What the tx looks like

If you set `usdtIn = 50_000000` (i.e. $50 USDT with 6 decimals), the launch transaction ends with:

1. The factory approving SwapRouter02 for $50.
2. `exactInputSingle` swapping $50 through the fresh pool.
3. The router returning \~24.9M tokens (from our rough table).
4. Those tokens landing in your wallet.
5. An `InitialBuy(token, buyer, 50e6, ~24.9e24)` event emitted.
6. A cap check — if `tokensOut > 50e24`, the whole transaction reverts.

## What if you don't want an initial buy?

Leave the field blank (or type `0`). The factory skips the swap step entirely, no additional USDT is pulled, and no `InitialBuy` event is emitted. Your token is live and tradeable — the first buyer post-launch will be the one to push the tick into range.

## Next

* [After the launch](/launching-a-coin/after-launch.md) — what happens in the minutes and hours that follow
* [Pool & starting price](/under-the-hood/pool-and-price.md) — how the anchor tick is chosen


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.unstable.run/launching-a-coin/initial-dev-buy.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
