This page covers V2 pool creation (constant product and bonding curve). For V3 concentrated liquidity pools with custom price ranges and higher capital efficiency, see Creating V3 Pools.
Pool Types
Single-Sided Pools (Bonding Curve)
- Goal: Gradually discover price as tokens sell, then “graduate” into a normal constant-product pool.
- Mechanism: Single-sided pools are modeled using virtual reserves that move on a constant‑product curve. The creator deposits an initial supply of Asset A; price evolves as virtual reserves update with sales.
- Graduation: Once a specified percentage of Asset A is sold, the accumulated Asset B and remaining Asset A are used to seed a new constant product pool.
- Target-Based Creation: The SDK provides a helper to compute virtual reserves from your initial supply, graduation threshold, and target Asset B raised at graduation.
Double-Sided Pools (Constant Product)
- Require initial deposits of both assets
- Use actual reserves for pricing
- Follow the constant product (
x*y=k) formula - Better for liquid markets
In the Flashnet Stack, Bitcoin is always denominated as satoshis and bears the public key
020202020202020202020202020202020202020202020202020202020202020202.Currently, Asset B must be Bitcoin, otherwise pool creation will fail.Prerequisites
Before creating pools, make sure you have set up the Flashnet SDK client. This guide assumes you have already initialized theclient instance, and that you have a wallet with either some BTC and LRC20 tokens, or two different LRC20 tokens.
In our below examples we will use BTC and USDB, where BTC is denominated in sats (8 decimals) and USDB has 6 decimals.
Creating a Constant Product Pool
Creating a Single-Sided Pool
The SDK automatically handles the deposit and confirmation process:Fee Configuration
Fee Constraints
- LP Fee: Trading fee that goes to liquidity providers (typically 0.1-1%)
- Host Fee: Additional fee for the host/integrator (0-1%)
- Total Fee: Sum of LP and host fees charged to traders
hostNamespace, the totalHostFeeRateBps must be greater than or equal to the host’s registered minFeeBps.
- If you do NOT provide a
hostNamespace, the minimumtotalHostFeeRateBpsis 10 BPS.
For single-sided pools, the graduation
threshold (percentage sold) is capped at 95% by the underlying AMM math.Complete Example: Pool Creation and Management
Error Handling
V3 Concentrated Liquidity Pools
For higher capital efficiency, consider V3 concentrated liquidity pools where you can provide liquidity within specific price ranges:Next Steps
After creating a pool, you can:- Execute swaps against your pool
- Add more liquidity to earn LP fees
- Remove liquidity when needed
- Create V3 positions for concentrated liquidity