> For the complete documentation index, see [llms.txt](https://hello-fun-1.gitbook.io/hello.fun-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hello-fun-1.gitbook.io/hello.fun-docs/uniswap-v4-integration.md).

# Uniswap v4 Integration

Hello.Fun uses Uniswap v4 as the market infrastructure for launches that complete graduation.

A token begins on its Hello.Fun bonding curve.

Once it reaches graduation, the launch transitions into a Uniswap v4 pool using the same pairing asset.

### From Bonding Curve to Uniswap v4

The market lifecycle has two distinct trading stages.

```mermaid
flowchart LR
    A["Token Launch"] --> B["Bonding Curve"]
    B --> C["Graduation"]
    C --> D["Uniswap v4 Pool"]
    D --> E["Post Graduation Trading"]
```

Before graduation, Hello.Fun's bonding curve provides the market.

After graduation, the token trades through its Uniswap v4 pool.

### Uniswap v4 on Robinhood Chain

Hello.Fun integrates with the Uniswap v4 deployment available on Robinhood Chain.

The graduated market is therefore built using Uniswap v4 infrastructure rather than a separate Hello.Fun exchange fork.

```mermaid
flowchart TD
    A["Hello.Fun"] --> B["Graduation Infrastructure"]
    B --> C["Uniswap v4"]
    C --> D["Graduated Market"]
```

Hello.Fun manages the transition into this market through its smart contracts.

### Creating the Pool

When a launch graduates, the graduation infrastructure moves the launch through the process required to establish its Uniswap v4 market.

The UniswapV4Adapter handles the pool creation and liquidity position.

```mermaid
flowchart LR
    A["GraduationManager"] --> B["UniswapV4Adapter"]
    B --> C["Create Uniswap v4 Pool"]
    C --> D["Seed Liquidity"]
    D --> E["Full Range Position"]
```

The pool uses the launched token and the same pairing asset used during the bonding curve.

### The Pair Remains the Same

Graduation changes the market mechanism.

It does not replace the selected pair.

For an ETH paired launch:

```mermaid
flowchart LR
    A["Token + ETH Bonding Curve"] --> B["Graduation"]
    B --> C["Token + ETH Uniswap v4 Pool"]
```

As additional pairing assets are introduced, the same principle is designed to apply.

The selected pair follows the launch from its initial market into its graduated market.

### Opening Market State

The graduated market is established from the final state of the bonding curve.

The reserves accumulated through curve trading become part of the transition into the Uniswap v4 market.

```mermaid
flowchart TD
    A["Bonding Curve Activity"] --> B["Pair Reserves"]
    B --> C["Graduation"]
    C --> D["Uniswap v4 Pool"]
```

The transition is designed to carry the launch from its curve market into its open market rather than creating an unrelated market from scratch.

### Full Range Liquidity

Hello.Fun creates a full range liquidity position for the graduated Uniswap v4 market.

```mermaid
flowchart LR
    A["Graduated Assets"] --> B["Uniswap v4 Pool"]
    B --> C["Full Range Liquidity Position"]
    C --> D["LiquidityLockerV4"]
```

Once created, the position is transferred into the Hello.Fun liquidity locker.

### Permanent Liquidity Custody

The graduated liquidity position is permanently held by LiquidityLockerV4.

The locker does not provide functions for:

1. Withdrawing the liquidity position
2. Unlocking the position
3. Transferring the position
4. Decreasing the locked liquidity
5. Removing the liquidity principal

The liquidity position is not sent to a burn address.

It remains held by a dedicated smart contract that does not provide an exit path for the locked principal.

### Trading After Graduation

Once the Uniswap v4 market is established, trading moves away from the bonding curve.

```mermaid
flowchart TD
    A["Trade Request"] --> B{"Launch Stage"}
    B -->|"Curve Stage"| C["Bonding Curve"]
    B -->|"Graduated"| D["Uniswap v4"]
```

Post graduation quotes are obtained from the Uniswap v4 market.

Trades continue to use minimum output protection based on the user's slippage settings.

### LaunchFeeHook

Hello.Fun uses a custom Uniswap v4 hook for graduated markets.

The hook participates in swap fee handling.

Its enabled hook permissions are:

1. Before Initialize
2. After Swap
3. After Swap Returns Delta

Before Swap is not enabled.

```mermaid
flowchart TD
    A["Uniswap v4 Swap"] --> B["LaunchFeeHook"]
    B --> C["Protocol Fee"]
    B --> D["Creator Fee"]
    C --> E["FeeEscrow"]
    D --> E
```

The hook cannot use a Before Swap permission to block a sell because that permission is not enabled.

### Pool Initialization Protection

The Before Initialize permission is used as part of the pool creation controls.

Hello.Fun restricts initialization of its launch pools to the expected graduation infrastructure.

```mermaid
flowchart LR
    A["Graduation Infrastructure"] --> B["Authorized Pool Initialization"]
    B --> C["Hello.Fun Uniswap v4 Pool"]
```

This connects pool creation to the Hello.Fun graduation process.

### Fees on Graduated Trades

After graduation, a trade can include three fee components.

| Fee                | Rate                                   |
| ------------------ | -------------------------------------- |
| Protocol Fee       | 1%                                     |
| Creator Fee        | Set at launch within the allowed range |
| Pool Liquidity Fee | 1%                                     |

The protocol fee is fixed.

The creator fee is established when the launch is created and remains fixed for that launch.

The pool liquidity fee is established as part of the deployed pool configuration.

### Fee Collection and Liquidity

Fees generated by the locked liquidity position can be collected without removing the underlying liquidity principal.

```mermaid
flowchart LR
    A["Pool Trading"] --> B["Liquidity Fees"]
    B --> C["Fee Collection"]
    A --> D["Liquidity Principal"]
    D --> E["Remains Locked"]
```

The liquidity locker checks that the principal remains unchanged when liquidity fees are collected.

### Residual Supply

Graduation may leave token supply that cannot enter the Uniswap v4 pool without changing the intended opening market state.

That residual supply is separated from the liquidity position and moved into the ResidualVault.

```mermaid
flowchart TD
    A["Graduation Supply"] --> B["Pool Supply"]
    A --> C["Residual Supply"]
    B --> D["Uniswap v4 Liquidity"]
    C --> E["ResidualVault"]
```

The ResidualVault does not provide a withdrawal function for this supply.

### Permissionless Graduation Completion

A completing buy can attempt to trigger graduation automatically.

If the automatic process does not complete, the protocol provides permissionless graduation completion.

```mermaid
flowchart LR
    A["Graduation Ready"] --> B["Automatic Graduation Attempt"]
    B --> C{"Completed?"}
    C -->|"Yes"| D["Uniswap v4 Market"]
    C -->|"No"| E["Permissionless Completion"]
    E --> D
```

Another user can therefore complete the graduation process without requiring exclusive intervention from the Hello.Fun team.

### Trading Through Uniswap v4

After graduation, the token exists as a Uniswap v4 market and can be interacted with through compatible Uniswap v4 interfaces as well as through the Hello.Fun trading experience.

Hello.Fun continues to index the resulting market activity for its token pages, charts and market data.

```mermaid
flowchart LR
    A["Uniswap v4 Activity"] --> B["Blockchain Events"]
    B --> C["Hello.Fun Indexer"]
    C --> D["Token Page and Market Data"]
```

### The Complete Transition

The full integration can be summarized as:

```mermaid
flowchart LR
    A["Bonding Curve"] --> B["Graduation"]
    B --> C["Uniswap v4 Pool"]
    C --> D["Full Range Liquidity"]
    D --> E["Permanent Locker"]
    C --> F["Post Graduation Trading"]
```

The bonding curve creates the starting market.

Graduation creates the transition.

Uniswap v4 becomes the graduated market.

The liquidity position remains permanently locked.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hello-fun-1.gitbook.io/hello.fun-docs/uniswap-v4-integration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
