# HELIX HLP Bootstrap

Spec for the day-1 liquidity bootstrap on the HLP vault. Locked in pre-TGE so the
terms can't move once the contract ships.

## Why a bootstrap

HELIX is a perp DEX where the **HLP vault is the counterparty to every position**.
TVL drives:

- **Maximum tradeable size.** A $10M vault can't underwrite $50M of open interest
  without taking on bank-run risk through the 8% drawdown gate.
- **Fee yield credibility.** New LPs won't deposit into a $100K vault — bootstrap
  TVL is what makes the APR number trustworthy.

So we incentivize the first $1M of LP capital and lock the founder's own seed at
the same time. After 28 days, the multiplier turns off forever.

## Terms

| Parameter | Value | Contract constant |
|---|---|---|
| Bootstrap cap | **$1,000,000 USDC** | `BOOTSTRAP_CAP_USDC` |
| Bootstrap duration | **28 days** | `BOOTSTRAP_DURATION` |
| Bonus multiplier | **2.00×** on base emissions | `BOOTSTRAP_MULTIPLIER_BPS = 20_000` |
| Vesting | **28 days linear** | `BOOTSTRAP_VEST_DAYS` |
| Referral kickback | **10% of bonus** to referrer | `REFERRAL_KICKBACK_BPS = 1000` |
| Base emissions | **1.6 $HELIX / 1 USDC** | `baseEmissionsPerUsdc` (constructor arg) |
| Effective during window | **3.2 $HELIX / 1 USDC** | base × multiplier |
| Emissions source | 250M $HELIX (25% of supply, the "HLP incentives" bucket) | `bootstrapEmissionsBudget` |

The window ends when **either** the cap fills **or** the 28-day timer expires,
whichever comes first.

## Math

For a deposit of `D` USDC made at time `t` (assuming `t < bootstrapEndTs`):

```
remaining_cap        = max(0, BOOTSTRAP_CAP_USDC - bootstrapFilledUsdc)
applied_to_bootstrap = min(D, remaining_cap)
remaining_at_base    = D - applied_to_bootstrap

bonus_helix    = applied_to_bootstrap × baseEmissionsPerUsdc × 2.0
base_helix     = remaining_at_base    × baseEmissionsPerUsdc × 1.0
total_emitted  = bonus_helix + base_helix

referrer_share = bonus_helix × 0.10  (only if referrer != depositor)
depositor_gets = total_emitted        (referrer's share comes from the bonus pool,
                                       not deducted from depositor's total)
```

All emissions enter the depositor's (and referrer's) `bootstrapVests[]` queue
and unlock linearly over 28 days. Call `bootstrapClaim()` any time to sweep
matured tokens. View pending with `bootstrapClaimable(address)`.

## Founder seed

The founder posts **$250,000 USDC** as the day-1 LP seed. This is enforced at the
contract level:

- The constructor immutably binds the `founder` address and sets
  `founderLockEnd = deploy_ts + 90 days`.
- `seedFounderDeposit(usdc)` is callable exactly once, by `founder`. It runs
  the normal deposit path (so the founder also earns vested $HELIX on the seed).
- The resulting `hlpShareBalance[founder]` is snapshotted into `founderSeedShares`.
- `hlpWithdraw()` enforces that the founder cannot drop below `founderSeedShares`
  before `founderLockEnd`.

The founder forfeits nothing if they wait — they just can't pull the seed early.

## Why this shape and not alternatives

| Alternative | Why we didn't pick it |
|---|---|
| Higher permanent base emission rate | Never sunsets. Creates a permanent dilution overhang. The bootstrap multiplier × window naturally fades. |
| Unlimited 2× emissions | Whales would absorb the entire allocation. Cap + per-block fill ordering forces broader distribution. |
| Cliff vest (e.g., 30d cliff then unlock) | Encourages dump-on-unlock. 28d linear smooths sell pressure. |
| Locked LP-token escrow | Adds custody risk and locks capital users may need. Drawdown gate already prevents bank runs without locking. |
| Referral rebate from depositor's own bonus | Punishes the depositor for using a referral link. We pay the referrer from the bonus bucket so depositors are indifferent. |

## Risks acknowledged

- **Sybil farming of `earlyDepositorCount`.** A single actor can split deposits to
  inflate the counter. The counter is cosmetic (front-end signal only) — actual
  emissions are based on USDC deposited, not depositor count, so this doesn't
  drain the budget.
- **Bootstrap emissions exhaustion.** If `bootstrapEmissionsBudget` is set too
  low at deploy, late depositors revert. We pre-fund 250M $HELIX which covers
  3.2 $HELIX × $1M cap = 3.2M HELIX (well within budget). Math:
  `cap × base × mult = 1e6 × 1.6 × 2 = 3.2M HELIX` ≪ 250M budget.
- **Trader-streak drawdown during window.** Bootstrap participants are exposed
  to HLP NAV risk like any LP. If traders capture >8% during the window,
  withdrawals pause but emissions keep accruing — which is by design (they're
  being compensated for that exact risk).

## Post-bootstrap

After `bootstrapEndTs` (28 days), `_hlpDepositInternal` falls into the "else"
branch and emits **base rate only** for any deposit. The contract has no admin
key to re-enable or extend the window. Permanent fade.

## Deploy parameters

```solidity
HelixPerps perps = new HelixPerps(
    USDC,                   // 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
    HELIX_TOKEN,            // deployed first, all 250M HLP-incentive supply pre-approved to this contract
    AMM_HOOK,
    HOOK_CALLER,
    FOUNDER_ADDRESS,
    250_000_000e18,         // bootstrapEmissionsBudget (25% of 1B HELIX supply)
    1_600_000_000_000_000_000 // baseEmissionsPerUsdc = 1.6 × 1e18
);
```

Then, in the same deploy script, `HELIX_TOKEN.approve(perps, 250M)` so the
contract can pull from the budget on each claim.

## API exposure

The dual chain/mock router exposes these as:

- `GET /api/hlp/bootstrap` — `{ active, capUsdc, filledUsdc, multiplier, baseEmissionsPerUsdc, effectiveEmissionsPerUsdc, vestingDays, endTs, remainingMs, earlyDepositors, founderSeedUsdc, founderLockRemainingDays, referralKickbackPct }`
- `POST /api/hlp/deposit` accepts `{ amount, wallet, referrer? }` and returns the deposit receipt with a nested `bootstrap` field showing `applied`, `helixEmitted`, `multiplierUsed`, `vestingDays`, `referrerKickback`.

Mock and chain implementations return identical shape, so the `/hlp` page works
in either mode.
