Skip to content

Instead of the usual AMM pools, we use bonding curves that automatically adjust prices based on supply and demand. Think of it like a vending machine that gets more expensive as it runs out of snacks!

Notifications You must be signed in to change notification settings

diobenu2silva/pumpfun_SC

Repository files navigation

Pump.fun Smart Contract

Hey there! 👋 This is the smart contract for Pump.fun - a cool project that lets you create virtual liquidity pools and swap tokens using bonding curves on Solana.

What's this all about?

We built this to make DeFi more accessible and fun. Instead of the usual AMM pools, we use bonding curves that automatically adjust prices based on supply and demand. Think of it like a vending machine that gets more expensive as it runs out of snacks!

Cool stuff you can do:

  • Create virtual liquidity pools (no need for massive capital)
  • Swap tokens with prices that move smoothly
  • Add/remove liquidity and earn fees
  • Bridge to Raydium when you're ready for the big leagues
  • Works with Meteora too!

Getting Started

First, make sure you have the basics:

  • Rust (latest stable)
  • Solana CLI
  • Anchor Framework
  • Node.js (for the TypeScript stuff)

Quick setup:

# Clone this bad boy
git clone https://github.com/your-username/Pumpfun-Smart-Contract.git
cd Pumpfun-Smart-Contract

# Get the dependencies
cargo build
npm install

# Build the program
anchor build

How it works

The Main Players:

  • CurveConfiguration: Stores your fee settings and curve parameters
  • LiquidityPool: Keeps track of your tokens and shares
  • LiquidityProvider: Knows how much you've contributed
  • Swap Engine: Does the math for fair pricing

The Instructions:

  • initialize: Set up your pool with custom fees (0-100%)
  • add_liquidity: Put tokens in, get shares out
  • remove_liquidity: Burn shares, get tokens back
  • swap: Trade tokens using the bonding curve
  • create_raydium_pool: Move liquidity to Raydium

Fees & Pricing

We keep it simple:

  • Default fee: 5% of reserves (you can change this)
  • Initial price: 600 lamports per token
  • Price discovery: Automatic based on supply/demand

The bonding curve makes sure prices move smoothly - no sudden jumps or manipulation!

Check it out in action

Want to see what this looks like in real life? Here's a transaction showing virtual LP removal and Raydium pool creation:

🔗 View on Solana Explorer

Testing

Run the tests to make sure everything works:

anchor test

Need help?

Got questions? We're here to help:

  • Telegram: @yookee92
  • Discord: _koga_8

Feel free to reach out - we love talking about DeFi and Solana!

Contributing

Found a bug? Want to add a feature? Awesome! Here's how:

  1. Fork the repo
  2. Make your changes
  3. Test everything works
  4. Send us a pull request

We're always looking for contributors who are passionate about DeFi!

License

MIT License - do whatever you want with it, just don't blame us if something goes wrong 😄


Built with ❤️ by the Pump.fun team

P.S. Always test on devnet before mainnet!

About

Instead of the usual AMM pools, we use bonding curves that automatically adjust prices based on supply and demand. Think of it like a vending machine that gets more expensive as it runs out of snacks!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •