This repo gives basic understanding on the pumpfun(pump.fun) smart contracts. To get the full codebase of smart contracts, you can contact me in my profile.
The following video shows how USAFun smart contract works. The USAFun smart contract is built by forking original pumpfun smart contract and adding its own features
Record.mp4
- Sets initial parameters(usafun config) and whitelist
- Can Modify protocol parameters
- Controls whitelist status
- Fee recipient
The protocol implements a constant product bonding curve (x * y = k).
TEST_DECIMALS = 6;
TEST_CURVE_LIMIT_LAMPORT = 4_000_000_000;
TEST_VIRTUAL_RESERVES_LAMPORT = 2_000_000_000;
TEST_RESERVE_TOKEN = 950_000_000_000;
TEST_TOKEN_SUPPLY = 1_000_000_000_000;
The bonding curve ensures price discovery and continuous liquidity for the token.
- Initialize curve parameters
- Enable whitelist
- Configure initial purchases
The fee rate is 1%(customizable) and it is taken for all the trades before and after the curve by the admin wallet
Migration is a critical process that occurs once the bonding curve has been completed and the tokens are empty.
People buy on the bonding curve and the market cap is growing. Once it reaches a market cap of $100k, the smart contract runs a CPI (Cross-Program Invocation) call to create a Raydium AMM.
- E2eDwJtbiXnnTnD1S3H6ESxCxZS6MamWhv45cB6uKXiX