Feels Bonding Curve (Pool Price Discovery)
This document specifies the design of the refactored Feels Bonding Curve. The system is inspired by the virtual-reserve, constant-product models used by platforms like pump.fun, but is implemented using the protocol's native Concentrated Liquidity (CLMM) engine.
1. Overview
The goal of the bonding curve phase is to provide a smooth, predictable, and bot-resistant price discovery process for new tokens. Instead of using a true x*y=k mathematical formula, we will approximate a virtual constant-product curve by deploying a large number of small, contiguous, protocol-owned liquidity positions.
This process functions as Phase 1 of a pool's life, managed by the PoolController. During this phase, the pool is entirely controlled by the protocol to ensure a fair launch.
2. Core Principles
- Protocol-Only Liquidity: To ensure the bonding curve's integrity, all third-party LPing is disabled during this phase. The protocol is the sole counterparty to all trades.
- Simulated
x*y=kCurve: From a trader's perspective, the experience will feel like swapping on a classic bonding curve with a smooth, continuous price path. Under the hood, they are swapping against hundreds of discrete CLMM positions programmatically arranged to form a hyperbola. - Graduation Trigger: The bonding curve phase is finite. It concludes when the market reaches a predefined target market cap (e.g., 85 SOL raised), at which point it "graduates".
- Seamless Transition to Steady-State: All capital raised during the bonding phase is automatically rolled over to seed the protocol's long-term, steady-state market-making strategies (Floor and JIT POL).
3. Discretized Liquidity Implementation
This approach replaces the old "staircase" ladder with a much more granular and sophisticated structure that approximates a smooth curve.
3.1. Target Curve Definition
First, we define the parameters of the virtual x*y=k curve we want to simulate, similar to the pump.fun model. This is defined by a set of initial virtual reserves which determine the constant k.
- Virtual SOL Reserves (
V_S): e.g., 30 SOL - Virtual Token Reserves (
V_T): e.g., 1,073,000,000 tokens - Constant Product (
k):V_S * V_T
3.2. Algorithm for Curve Discretization
The deploy_bonding_curve_liquidity instruction executes the following algorithm to transform the smooth virtual curve into a series of real CLMM positions:
-
Define Price Range: Determine the start and end price for the bonding curve. The start price is derived from the initial virtual reserves. The end price is the price at which the market cap graduation target is met.
-
Generate Price Points: Divide the price range into
Ndiscrete price points (recommended MVP:N = 20–40). These points are spaced geometrically, not linearly, to create smaller steps at lower prices and larger steps at higher prices, which naturally maps to thex*y=kcurve's shape. A simpler “staircase” of 5–10 deeper tranches is an acceptable alternative when minimizing complexity. -
Convert to Ticks: Each price point
P_iis converted into a tick indexT_i. This createsN-1small, contiguous tick ranges:[T_1, T_2],[T_2, T_3], etc. -
Calculate Liquidity for Each Tranche: For each micro-range
[T_i, T_{i+1}], the algorithm calculates the precise amount of CLMM liquidity (L_i) needed to make that segment behave like the targetx*y=kcurve. This is done by solving the CLMM liquidity formula forL:- First, calculate the amount of virtual tokens (
ΔV_T) that would be sold from the idealx*y=kcurve between pricesP_iandP_{i+1}. - Then, using the CLMM formula
ΔTokens = L * (√P_upper - √P_lower), solve forL_i:L_i = ΔV_T / (√P_{i+1} - √P_i)
- First, calculate the amount of virtual tokens (
-
Deploy Positions: The instruction loops
N-1times, creating a protocol-owned CLMM position for each range[T_i, T_{i+1}]with the calculated liquidityL_iand depositing the required number of tokens from the initial escrow.
The result is a fine-grained approximation of a smooth hyperbola, built from discrete CLMM positions.
4. Pool Lifecycle
4.1. Pool Phase 1: Bonding Curve Active
- Deployment: The
deploy_bonding_curve_liquidityinstruction creates the discretized hyperbola curve as described above. - LPing Disabled: The
PoolControllersets a flag on the pool that prevents any user from callingopen_positionor other liquidity-modifying instructions. - Trading: Users buy the new token with
FeelsSOL. Swaps are executed by the standard CLMM engine against protocol‑owned liquidity. The standard Dynamic Fee Model applies to all trades.- Optional Initial Buy: A side‑effect‑free, ordinary swap that does not alter pool configuration. It applies the standard fee model and fee split, including the creator base fee.
- Graduation Check: After every swap, the contract checks if the total
FeelsSOLcollected has reached the graduation market cap.
4.2. Pool Phase 2: Seamless Transition to Steady-State
A critical design goal is to graduate the pool from its bonding curve to an open, steady-state AMM with zero downtime. This is achieved by adding the new, permanent liquidity before removing the old, temporary bonding curve liquidity.
-
Graduation Trigger: The
swaptransaction that meets or exceeds the graduation cap flips thePoolControllerstate fromPriceDiscoverytoSteadyState. Trading continues uninterrupted, but internal logic now changes for all subsequent actions. -
Deployment of Steady-State Liquidity: Once the pool is in the
SteadyState, attempt a single, atomicgraduate_poolinstruction to reallocate capital to Floor POL and seed PoolBuffer. If this exceeds CU limits, a permissionless crank instruction,deploy_steady_state_liquidity, can be used to seed steady state and a batchedcleanup_bonding_curvewithdraws bonding-curve ranges. All steps are safe to retry and idempotent.-
Source of Capital: The crank's first step is to calculate the total assets collected during the bonding phase. These assets, held in the pool vaults from the now-inactive bonding curve positions, consist of:
- All the
FeelsSOLpaid by buyers. - All the remaining, unsold project tokens.
- All the
-
Capital Allocation: This recovered capital is then split (e.g., a 95/5 ratio) to fund the two steady-state strategies:
-
Floor POL Deployment (~95% of
FeelsSOLCapital):- Denomination: The Floor requires
FeelsSOLto create a buy wall for the project token. - Price (Tick) Calculation: The
pool::Floorcalculates theinitial_floor_tick. This is derived from thePool-Level Floor Price Formula:Floor Price = (95% of FeelsSOL Raised) / (Number of Tokens Sold). - Placement: The crank creates a single, large, one-sided concentrated liquidity position on behalf of the protocol. This position is placed in the range
[global_lower_tick, initial_floor_tick]and is funded with the allocatedFeelsSOL. Because the current market price is guaranteed to be above theinitial_floor_tick, this position consists entirely ofFeelsSOL, forming a deep, permanent buy wall.
- Denomination: The Floor requires
-
JIT POL Seeding (~5% of
FeelsSOL+ remaining tokens):- Denomination: The JIT system needs a mix of assets to operate.
- Placement: The remaining capital—the ~5% of
FeelsSOLand all of the unsold project tokens—is transferred into the pool's dedicatedPool Buffer (τ)account. This provides the initial capitalization required for the JIT system to begin its reactive, on-the-fly market making.
-
-
Pool Opening: In the same
deploy_steady_state_liquiditytransaction, thelping_enabledflag is set totrue, immediately opening the pool to third-party LPs. -
Cleanup of Bonding Curve Liquidity: A separate, permissionless crank instruction,
cleanup_bonding_curve, can now be called multiple times to safely remove the redundant bonding curve positions and reclaim rent, without affecting the now-active pool. This operation is batched and idempotent.
5. Ungraduated Pools
If a pool never reaches its graduation cap, it remains in the bonding curve phase indefinitely. Users can continue to buy and sell against the curve. The protocol does not intervene, and the token does not graduate to an open AMM.
6. Interaction with the Pool Controller
The PoolController remains the central controller for this entire process:
- It manages the state transition from
PriceDiscovery(the bonding curve phase) toSteadyState. - It enforces the "no LPing" rule during the
PriceDiscoveryphase. - It applies the appropriate fee-splitting logic (typically the "Bootstrap Regime") to all fees collected during the bonding curve phase.
- It orchestrates the withdrawal and re-allocation of capital upon graduation.
This refactored design provides the user experience and economic properties of an established bonding curve model, while leveraging the power and efficiency of our existing CLMM infrastructure.