Here’s a clean project description in Markdown you can drop straight into your repo.
A decentralized Liquidity Bootstrapping Pool (LBP) smart contract system that enables fair, manipulation-resistant token launches using Balancer-style weighted AMM mechanics with time-decaying token weights and on-chain vesting.
This project is inspired by Fjord Foundry, Copper Launch and Balancer LBPs, but is designed to be lightweight, composable, and developer-friendly.
Implements the invariant:
[ B_{project}^{w_{project}} \cdot B_{quote}^{w_{quote}} = k ]
This allows dynamic price discovery based on relative token weights instead of fixed pricing.
Project token weight decreases linearly from initialWeight to finalWeight across the sale duration.
This causes the price of the project token to start high and fall gradually, protecting early buyers from sniper bots.
The pool can never be drained of project tokens.
As project token balance approaches zero, price asymptotically approaches infinity, making full extraction mathematically impossible.
Each buyer receives project tokens into a vesting position:
- Linear time-locked distribution
- On-chain enforcement
- No admin intervention required
- All liquidity is provided at pool creation
- Tokens are held in the contract
- No minting, pausing or admin price control
| Component | Description |
|---|---|
LBPPool.sol |
Core pool logic |
| Weighted AMM | Balancer-style invariant |
| Time Engine | Linear weight interpolation |
| Vesting Vault | Per-user vesting positions |
| PRB-Math | Fixed-point exponentiation |
Project tokens received:
[ \Delta B_{project} = B_{project} \cdot \left[1 - \left(\frac{B_{quote}}{B_{quote} + \Delta_{quote}}\right)^{\frac{w_{quote}}{w_{project}}} \right] ]
Initial parameters:
| Variable | Value |
|---|---|
projectTokenBalance |
100,000 |
quoteTokenBalance |
50,000 |
initialWeight |
0.8 |
finalWeight |
0.5 |
Initial price:
[ P = \frac{50,000 / 0.2}{100,000 / 0.8} = 2 ]
→ 1 Project Token = 2 USDC
| Property | Guaranteed |
|---|---|
| No rug pull | Yes |
| No infinite mint | Yes |
| No pool drain | Yes |
| No admin pricing | Yes |
| Front-run resistant | Yes |
- Fair token launches
- DAO bootstrapping
- Community token distribution
- Fundraising rounds
- Liquidity discovery markets
To run all the tests in the project, execute the following command:
npx hardhat testYou can also selectively run the Solidity or mocha tests:
npx hardhat test solidity
npx hardhat test mochaThis project includes an example Ignition module to deploy the contract. You can deploy this module to a locally simulated chain or to Sepolia.
To run the deployment to a local chain:
npx hardhat ignition deploy ignition/modules/Counter.tsTo run the deployment to Sepolia, you need an account with funds to send the transaction. The provided Hardhat configuration includes a Configuration Variable called SEPOLIA_PRIVATE_KEY, which you can use to set the private key of the account you want to use.
You can set the SEPOLIA_PRIVATE_KEY variable using the hardhat-keystore plugin or by setting it as an environment variable.
To set the SEPOLIA_PRIVATE_KEY config variable using hardhat-keystore:
npx hardhat keystore set SEPOLIA_PRIVATE_KEYAfter setting the variable, you can run the deployment with the Sepolia network:
npx hardhat ignition deploy --network sepolia ignition/modules/Counter.ts- Solidity
^0.8.28 - OpenZeppelin Contracts
- PRB-Math Fixed Point
- Hardhat + Ethers.js
MIT — open for extension, audits and production deployment.