# liquidity model

Durianfun's liquidity flows through three distinct phases. Each phase has its own math, its own fees, and its own safety guarantees.

## Phase 1 — Bonding Curve (pre-graduation)

Trading happens on a **virtual constant-product curve** inside each token's `BondingCurveMarket` contract. The curve's job is price discovery: new buyers pay progressively more, which rewards early believers and bootstraps an exit price for the creator.

**Properties:**

* Transparent math — anyone can compute the next price on-chain
* No front-running advantage (fair for everyone at the same block)
* **Slippage protection** via `minTokensOut` / `minKubOut`
* Sells allowed (not one-way) — traders can exit any time before graduation

**What the user experiences:**

* Progress bar showing how close to graduation
* Live price chart updating every trade
* Trade feed showing who bought/sold recently

## Phase 2 — Graduation (atomic transition)

When enough liquidity has accumulated, the **next buy atomically triggers graduation** inside the same transaction:

1. The triggering buy is capped at the graduation line (excess refunded)
2. 50 KUB → treasury, 10 KUB → creator (graduation rewards)
3. A new **AMM contract** is deployed
4. Remaining liquidity is transferred into the AMM
5. AMM opens at exactly the curve's final price (**price-aligned seeding**)
6. A 10-block cooldown begins

**This is irreversible.** The bonding curve becomes read-only forever. The AMM becomes the only place to trade that token.

## Phase 3 — Sealed AMM (post-graduation, forever)

Once graduated, trading happens on a **standard constant-product AMM** (x·y=k) — the same math as Uniswap V2, proven over billions of dollars in volume.

**Key differences from a typical DEX pool:**

| Property         | Typical DEX pool       | Durianfun AMM                            |
| ---------------- | ---------------------- | ---------------------------------------- |
| Add liquidity    | Public (anyone can LP) | ❌ **No add function**                    |
| Remove liquidity | LPs can exit           | ❌ **No remove function**                 |
| LP token         | Minted to LPs          | ❌ **No LP tokens exist**                 |
| Fee goes to      | LP token holders       | 0.30% treasury + **0.10% stays in pool** |
| Ownership        | LPs own pool           | **Nobody owns pool** — it's sealed       |

The AMM is its own counterparty. **It is structurally impossible for anyone — including Durianfun — to withdraw liquidity** after graduation.

## Token allocation

Each Durianfun token has a fixed **1,000,000,000 total supply**:

* The overwhelming majority flows through the bonding curve → ends up with traders as buy orders
* A substantial reserve (\~27% of total supply) is held back during the bonding phase and released into the AMM at graduation
* **Zero tokens go to the creator, the team, or a vesting contract.** No presale. No dev allocation.

The exact split between "sold via curve" and "reserved for LP" is governed by the bonding curve's math, which is designed so the AMM has deep, healthy starting liquidity.

## LP fees compound in pool (forever)

Post-graduation, 0.10% of every swap stays inside the pool. This has a subtle but powerful effect over time:

* Every trade increases the pool's K (constant product)
* Every K increase means lower slippage for future trades
* The pool gets **more liquid the more it's traded**, without anyone adding liquidity

Compare this to most v2-style pools where fees are extracted by LPs — Durianfun's pool depth grows purely from trading.

## Stuck token rescue

Because the AMM opens with price-aligned reserves, a small fraction of tokens can end up stuck in the bonding curve market at graduation (the math doesn't balance perfectly in integer arithmetic at the exact cut-over).

These stuck tokens can be moved out by the factory owner via the `rescueStuckTokens()` function. All rescue transactions are on-chain events (`StuckTokensRescued`) and publicly visible.

{% hint style="info" %}
**Transparency commitment:** Durianfun will publish its rescue policy publicly — how rescued tokens are used (burn / community distribution / LP top-up). This is a centralization vector we're explicit about, not a back door.
{% endhint %}

## Security guarantees

* **Immutable contracts** — no proxy, no upgrade path, no admin key rewrites logic
* **Fee cap enforced at bytecode level** — bonding fee cannot exceed 2%, AMM fee is a constant (cannot change at all)
* **Creator reward fallback** — even if a malicious creator contract rejects the 10 KUB bonus, graduation still completes (audit-patched, M-1)
* **Gas-grief protection** — all fee transfers are gas-capped at 50k (audit-patched, MED-1/MED-2)
* **10-block MEV cooldown** — prevents graduation-time sniping on the fresh AMM


---

# 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:

```
GET https://durianandfun.gitbook.io/durianfun/durian-launchpad/tokenomics/liquidity-model.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
