A Solana smart contract implementing customizable bonding curves with fee distribution and liquidity management capabilities.
This smart contract implements an launchpad using bonding curves. It supports multiple curve types, fee collection and distribution, and liquidity management features.
-> Fair launch mechanism with fully customizable business logic
- Linear Curve: Price increases linearly with supply
- Quadratic Curve: Price increases quadratically with supply
-
Buy Tokens
- Calculate token price based on selected curve type
- Apply fees
- Update reserves and supply
- Distribute fees to configured recipients
-
Sell Tokens
- Calculate token value based on selected curve type
- Apply fees
- Update reserves and supply
- Distribute fees to configured recipients
-
Liquidity Management
- Add liquidity with configurable lock periods
- Remove liquidity after lock period expires
- Configurable fee percentage (basis points)
- Multiple fee recipients with customizable share ratios
- Claimable accumulated fees for recipients
- Install
yarn install
- Add your private key in the config folder
2.1 Signer on ~/.config/solana/id.json
(default signer for anchor config)
2.2 Fee Recipient on ~/.config/solana/id2.json
and ~/.config/solana/id3.json
- Run script to create token
Noted: Fill the SIGNER_PRIVATE_KEY
and USER_PRIVATE_KEY
in the .env
file
yarn create-token
Result
Mint: 3YChZhQqYpriRAiNunKLRxF5jnTuj97RE4SHBBHNAJsu
ATA: 5ZoKnNrLwDw5FSgjuA7S7uSEsYPDHrhPzQ7bUTZxdtSa
- Run tests
Noted: Replace your mint account in the tests/bonding-curve.ts
file
const mint = new PublicKey("3YChZhQqYpriRAiNunKLRxF5jnTuj97RE4SHBBHNAJsu");
Run test
anchor test