> For the complete documentation index, see [llms.txt](https://maplefun.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://maplefun.gitbook.io/docs/core-mechanics/pool-params.md).

# Pool Params

Every Maple.fun pool is configured with a set of on-chain parameters that control fees, penalties, and behavior. These values are set at pool creation and are fully transparent and verifiable.

***

### Fee Parameters

| Parameter            | Description                                                | Range                |
| -------------------- | ---------------------------------------------------------- | -------------------- |
| `deposit_fee_bps`    | Base fee on deposits (in basis points). Stays in the pool. | 0–10,000             |
| `withdrawal_fee_bps` | Fee on withdrawals (in basis points). Stays in the pool.   | 0–10,000             |
| `project_fee_bps`    | Fee on withdrawals split between creator and treasury.     | 5–10,000 (min 0.05%) |
| `max_fee_bps`        | Maximum deposit fee after dynamic scaling.                 | ≥ `deposit_fee_bps`  |

***

### TVL-Based Dynamic Fees

Deposit fees can scale based on pool size. As TVL grows, fees increase linearly between two thresholds.

| Parameter          | Description                                                           |
| ------------------ | --------------------------------------------------------------------- |
| `tvl_first_elbow`  | TVL threshold where dynamic fee scaling begins.                       |
| `tvl_second_elbow` | TVL threshold where dynamic fee scaling ends (must be > first elbow). |
| `slope1_bps`       | Additional fee added across the scaling range (in basis points).      |

**How it works:** Below the first elbow, the base fee applies. Between the two elbows, fees increase linearly by up to `slope1_bps`. Above the second elbow, fees are capped at `base_fee + slope1_bps` (not exceeding `max_fee_bps`).

***

### Early Depositor Discounts

Pools can reward early participants with reduced deposit fees during a launch window.

| Parameter             | Description                                                                                    |
| --------------------- | ---------------------------------------------------------------------------------------------- |
| `discount_tier_count` | Number of discount tiers (1–4).                                                                |
| `discount_durations`  | Array of timestamps (in seconds from pool start) defining each tier's end. Must be increasing. |
| `discount_bps`        | Array of discount amounts (in basis points) for each tier. Cannot exceed `deposit_fee_bps`.    |

**Example:** A pool with `discount_durations = [3600, 86400]` and `discount_bps = [100, 50]` offers a 1% discount in the first hour, then 0.5% discount for the first day.

***

### Withdrawal Penalties

Two penalty mechanisms discourage quick exits and protect long-term participants.

#### Cooldown Penalty (Linear Decay)

| Parameter                  | Description                                                                 |
| -------------------------- | --------------------------------------------------------------------------- |
| `withdraw_cooldown_secs`   | Duration (in seconds) over which the penalty decays to zero. Max: 730 days. |
| `max_withdraw_penalty_bps` | Starting penalty (in basis points) immediately after deposit.               |

The penalty decreases linearly from `max_withdraw_penalty_bps` to zero over the cooldown period.

#### Fast-Exit Penalty (Floor)

| Parameter               | Description                                                                                       |
| ----------------------- | ------------------------------------------------------------------------------------------------- |
| `fast_exit_window_secs` | Duration (in seconds) during which the floor penalty applies. Must be ≤ `withdraw_cooldown_secs`. |
| `fast_exit_floor_bps`   | Minimum penalty (in basis points) during the fast-exit window.                                    |

**Which penalty applies?** The higher of the two penalties is charged. This prevents users from circumventing the linear cooldown by withdrawing during the floor window.

***

### Reserve and Risk Controls

| Parameter                    | Description                                                                     | Range    |
| ---------------------------- | ------------------------------------------------------------------------------- | -------- |
| `reserve_ratio_bps`          | Minimum percentage of assets that must remain in the pool after any withdrawal. | 0–10,000 |
| `loss_cap_bps`               | If the exchange rate drops by this percentage, the pool auto-pauses.            | 0–10,000 |
| `max_deposit_percentage_bps` | Maximum single deposit as a percentage of current TVL (0 = no limit).           | 0–10,000 |

***

### Bootstrap Lock

| Parameter             | Description                                                               |
| --------------------- | ------------------------------------------------------------------------- |
| `bootstrap_lock_secs` | Duration (in seconds) that the pool owner cannot withdraw after creation. |

This ensures the pool creator has skin in the game during the launch phase.

***

### Validation Rules

The protocol enforces several constraints to prevent misconfigured pools:

* `discount_durations[0]` must be > 0
* Each subsequent duration must be greater than the previous
* Discount amounts cannot exceed the base deposit fee
* `tvl_second_elbow` must be > `tvl_first_elbow`
* `max_fee_bps` must be ≥ `deposit_fee_bps` and ≤ 10,000
* `deposit_fee_bps + slope1_bps` must be ≤ `max_fee_bps`
* `fast_exit_window_secs` must be ≤ `withdraw_cooldown_secs`
* Total withdrawal fees (`withdrawal_fee_bps + project_fee_bps + max_penalty`) must be ≤ 10,000

***

### Example Configuration

A balanced pool configuration might look like:

| Parameter                  | Value     | Meaning                                      |
| -------------------------- | --------- | -------------------------------------------- |
| `deposit_fee_bps`          | 100       | 1% base deposit fee                          |
| `withdrawal_fee_bps`       | 50        | 0.5% withdrawal fee                          |
| `project_fee_bps`          | 100       | 1% project fee (0.5% creator, 0.5% treasury) |
| `tvl_first_elbow`          | 100,000   | Dynamic fees start at 100k TVL               |
| `tvl_second_elbow`         | 1,000,000 | Dynamic fees max out at 1M TVL               |
| `slope1_bps`               | 100       | Additional 1% fee across the range           |
| `max_fee_bps`              | 200       | Cap deposit fee at 2%                        |
| `withdraw_cooldown_secs`   | 604,800   | 7-day cooldown                               |
| `max_withdraw_penalty_bps` | 500       | 5% starting penalty                          |
| `fast_exit_window_secs`    | 86,400    | 24-hour fast-exit window                     |
| `fast_exit_floor_bps`      | 300       | 3% floor penalty                             |
| `reserve_ratio_bps`        | 1,000     | 10% minimum reserve                          |
| `loss_cap_bps`             | 2,000     | Auto-pause at 20% loss                       |
| `bootstrap_lock_secs`      | 259,200   | 3-day owner lock                             |
