> For the complete documentation index, see [llms.txt](https://stonkmarket.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stonkmarket.gitbook.io/docs/smart-contracts/stonk-token-factory.md).

# StonkTokenFactory

The factory is the entry point for launching new tokens. It uses the EIP-1167 minimal-proxy pattern to deploy gas-efficient clones of a singleton `StonkTokenV2` implementation, and in the same transaction it stands up the token's live Uniswap v4 market.

## Overview

| Property            | Value                                                                                                                                            |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| Contract            | `StonkFactoryV2.sol`                                                                                                                             |
| Inherits            | `Ownable`, `ReentrancyGuard`                                                                                                                     |
| Pattern             | EIP-1167 Minimal Proxy (Clones)                                                                                                                  |
| Owner (both chains) | [`0x1E6F0A86B56Fa66c133F7c08EdE527184eC7EbFB`](https://basescan.org/address/0x1E6F0A86B56Fa66c133F7c08EdE527184eC7EbFB) (Ledger hardware wallet) |

| Network                | Address                                                                                                                                  |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| Base mainnet (8453)    | [`0xa2e56390DaF5d6A9823950D8171cbCa9350893ed`](https://basescan.org/address/0xa2e56390DaF5d6A9823950D8171cbCa9350893ed)                  |
| Robinhood Chain (4663) | [`0x162673f9b07A55c5082ee21F4e2ecb73D731Dd75`](https://robinhoodchain.blockscout.com/address/0x162673f9b07A55c5082ee21F4e2ecb73D731Dd75) |

The two deployments run identical bytecode with separate configuration — see [Robinhood Chain](/docs/reference/robinhood-chain.md) for what differs.

## Responsibilities

* Deploy new `StonkTokenV2` clones.
* Initialize the token's Uniswap v4 pool and install the bonding curve as a single concentrated-liquidity position — the **only** liquidity add the pool ever accepts.
* Bind the pool to the [StonkHook](/docs/smart-contracts/stonk-hook.md) so market-hours, fees, and permanent liquidity are enforced.
* Execute the deployer's atomic launch buy, if any.
* Compute `launchTime` (the next NYSE open) and lock the token until then.
* Manage protocol-level configuration (fee split, limits, treasury, per-asset config).
* Enforce name/symbol uniqueness.

## What a Launch Does

`deployToken` runs the whole launch atomically:

1. Look up the backing asset's config and reject the call if that path is disabled.
2. Validate the name/symbol pair is free and the launch-buy amount is within `maxDevInitialBuyAmount`.
3. Collect the launch fee (payable in ETH or WETH for a WETH launch, in USDC for a USDC launch) and forward it to the treasury.
4. Clone the `StonkTokenV2` implementation and mint the fixed 1,000,000,000 supply.
5. Create the token's Uniswap v4 pool (hook = StonkHook, LP fee = 0) and seed it **once** with the concentrated-liquidity position that reproduces the bonding curve.
6. Mint the dev allocation (0.5%) to the deployer.
7. Execute the deployer's launch buy through the v4 pool if `initialBuyAmount > 0`, then refund any excess ETH.
8. Finalize: minting is permanently disabled, and trading stays locked until `launchTime`.

After step 5 the pool never accepts another liquidity add, and the hook rejects every liquidity **removal** — the liquidity is permanent from launch. There is no graduation step; see [No Graduation](/docs/concepts/graduation.md).

## Fee Split

The hook withholds **1%** from the backing-asset leg of every swap. The factory records how that 1% is divided for each token:

| Share               | Recipient                                                                                                               | Referred | Unreferred |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------- | -------- | ---------- |
| Creator             | The token's deployer                                                                                                    | 10%      | 10%        |
| Platform referrer   | The listed platform that referred the launch                                                                            | 10%      | —          |
| Treasury (protocol) | [`0x72338634020f2BFcbaCa591B8CB67ECe577A3b02`](https://basescan.org/address/0x72338634020f2BFcbaCa591B8CB67ECe577A3b02) | 80%      | 90%        |

If a launch has no listed platform referrer, the platform's 10% folds into the treasury, so the split is effectively **10 / 90**. Fees accrue per token and are claimed from the [StonkFeeLocker](/docs/smart-contracts/stonk-fee-locker.md).

## Configurable Parameters

These affect **future launches only**. Changing them never affects existing tokens.

**Global** parameters (apply to all asset paths):

| Parameter                  | Description                                  | Constraint       |
| -------------------------- | -------------------------------------------- | ---------------- |
| `tradeFee`                 | Fee withheld from the asset leg of each swap | 1% (10,000 pips) |
| `maxWalletBasisPoints`     | Max % of supply per wallet                   | 500 (5%)         |
| `devAllocationBasisPoints` | % of supply minted to the deployer           | 50 (0.5%)        |
| `treasury`                 | Protocol fee recipient                       | Non-zero         |
| `paused`                   | Emergency stop for new launches              | Boolean          |

**Per-asset** parameters, set per backing asset (WETH or USDC):

| Parameter              | Description                              | WETH     | USDC            |
| ---------------------- | ---------------------------------------- | -------- | --------------- |
| Launch fee             | One-time deploy fee in the backing asset | 0.1 WETH | 150 USDC        |
| Virtual asset reserves | Starting asset reserves for the curve    | 2 WETH   | \~3,285.71 USDC |
| Discovery raise        | Asset depth of the curve band            | 7 WETH   | 11,500 USDC     |
| Max launch buy         | Cap on the deployer's atomic launch buy  | 0.1 WETH | 160 USDC        |

See [Protocol Configuration](/docs/reference/protocol-configuration.md) for the full parameter reference and the fixed curve constants (tick spacing 60, market-band ceiling 1000x).

## Security

* Only the owner (a Ledger hardware wallet) can modify factory parameters.
* The pause mechanism stops new launches but does not affect existing tokens.
* Name/symbol uniqueness is enforced via a keccak256 hash mapping.
* The factory is the **only** address that can add liquidity to a stonk pool, and it does so exactly once, at launch.


---

# 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://stonkmarket.gitbook.io/docs/smart-contracts/stonk-token-factory.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.
