Skip to content

Repository files navigation

Here’s a clean project description in Markdown you can drop straight into your repo.


Liquidity Bootstrapping Pool (LBP) Launchpad

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.


🚀 Features

🧮 Balancer Weighted AMM

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.


⏱ Time-Decaying Weight Curve

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.


🔒 Anti-Drain Safety

The pool can never be drained of project tokens.

As project token balance approaches zero, price asymptotically approaches infinity, making full extraction mathematically impossible.


🔄 Trustless Vesting

Each buyer receives project tokens into a vesting position:

  • Linear time-locked distribution
  • On-chain enforcement
  • No admin intervention required

🔐 Fully Non-Custodial

  • All liquidity is provided at pool creation
  • Tokens are held in the contract
  • No minting, pausing or admin price control

🏗 Architecture

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

🔁 Swap Formula

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] ]


🧠 Example

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


🛡 Security Guarantees

Property Guaranteed
No rug pull Yes
No infinite mint Yes
No pool drain Yes
No admin pricing Yes
Front-run resistant Yes

🔮 Use Cases

  • Fair token launches
  • DAO bootstrapping
  • Community token distribution
  • Fundraising rounds
  • Liquidity discovery markets

📦 Installation

Running Tests

To run all the tests in the project, execute the following command:

npx hardhat test

You can also selectively run the Solidity or mocha tests:

npx hardhat test solidity
npx hardhat test mocha

Make a deployment to Sepolia

This 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.ts

To 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_KEY

After setting the variable, you can run the deployment with the Sepolia network:

npx hardhat ignition deploy --network sepolia ignition/modules/Counter.ts

🛠 Tech Stack

  • Solidity ^0.8.28
  • OpenZeppelin Contracts
  • PRB-Math Fixed Point
  • Hardhat + Ethers.js

📜 License

MIT — open for extension, audits and production deployment.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages