> 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-hook.md).

# StonkHook

v2 has **no trading router**. Trading is ordinary Uniswap v4 swapping against each token's pool. What makes a stonk pool special is its **hook** — the `StonkHook` contract, attached to every stonk pool at launch. The hook is where the protocol's rules live: NYSE market hours, the 1% asset-leg fee, and permanent liquidity.

## Overview

| Property | Value           |
| -------- | --------------- |
| Contract | `StonkHook.sol` |
| Type     | Uniswap v4 hook |

| Network                | Address                                                                                                                                  | Uniswap v4 PoolManager                                                                                                                   |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| Base mainnet (8453)    | [`0x702b1FE403Ec993a102addE47f2ab52eb2eadAcc`](https://basescan.org/address/0x702b1FE403Ec993a102addE47f2ab52eb2eadAcc)                  | [`0x498581fF718922c3f8e6A244956aF099B2652b2b`](https://basescan.org/address/0x498581fF718922c3f8e6A244956aF099B2652b2b)                  |
| Robinhood Chain (4663) | [`0x3f7b2634AeE7173Ed0F5328CeB8a2134F8B95ACc`](https://robinhoodchain.blockscout.com/address/0x3f7b2634AeE7173Ed0F5328CeB8a2134F8B95ACc) | [`0x8366a39CC670B4001A1121B8F6A443A643e40951`](https://robinhoodchain.blockscout.com/address/0x8366a39CC670B4001A1121B8F6A443A643e40951) |

Both addresses end in the hook-flag suffix `0x1ACC`, mined with CREATE2 — a Uniswap v4 requirement, since a hook's permissions are encoded in its address.

Every stonk pool is created with this hook and with the native Uniswap LP fee set to **zero**, so the hook is the only thing that ever charges a fee.

## Trading-Window Enforcement

The hook's **`beforeSwap`** reverts any swap on a stonk pool while the NYSE is closed, reading the shared [MarketHoursOracle](/docs/smart-contracts/market-hours-oracle.md). A token is also locked until its `launchTime` (the next NYSE open computed at deploy), so a freshly launched token cannot trade until the first bell.

This is one of two independent market-hours guards. The token's own `transfer()` / `transferFrom()` enforce the same window at the ERC-20 layer — **defence in depth**, so there is no path (swap or transfer) to move a token off-hours. See [Market Hours](/docs/concepts/market-hours.md).

## The 1% Asset-Leg Fee

On every swap the hook withholds **1%** from the **backing-asset** leg (WETH or USDC) using the v4 return-delta mechanism across `beforeSwap` / `afterSwap`. Key properties:

* The fee is **always** denominated in the backing asset — **never** in the launched token.
* The native Uniswap LP fee is forced to **zero**; the hook is the sole fee charger.
* The 1% splits **creator 10% / platform referrer 10% / treasury 80%**. An unreferred launch folds the platform 10% into the treasury, so it is effectively **10 / 90**.

Collected fees accrue per token and are claimed from the [StonkFeeLocker](/docs/smart-contracts/stonk-fee-locker.md).

## Permanent Liquidity

Only the factory can add liquidity to a stonk pool, and only **once**, at launch. The hook rejects every liquidity **removal** attempt — from anyone, the team included — reverting with `ProtocolLiquidityIsPermanent`.

Uniswap v4 has no LP tokens, so there is nothing to burn and nothing to send to a dead address; permanence is enforced directly in the hook's code. The liquidity cannot be pulled. See [No Graduation](/docs/concepts/graduation.md).

## Trading Through the Hook

Because the curve is installed as a single concentrated-liquidity position at launch (see [How Trading Works](/docs/concepts/graduation.md)), the pool is a live, real market from the first bell — there is no separate bonding-curve contract to route through.

A **direct Uniswap v4 swap** through the Universal Router, using the pool's `PoolKey`, works today for anyone. Third-party front-ends and aggregators (the Uniswap interface, 0x, the Base app) only route a hooked pool once the hook is allowlisted; those submissions are in progress. See the [Trading](/docs/guides/trading.md) guide for how to swap in the meantime.


---

# 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-hook.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.
