This repo contains examples demonstrating how to create and interact with bonding curve tokens on Ethereum or any EVM-compatible chain. Use bonding curves to price tokens based on supply, eliminating the need for traditional liquidity pools.
- How to implement bonding curve pricing in Solidity
- Understanding linear bonding curves and price discovery
- Building a React/Next.js interface for token trading
- Connecting smart contracts to web interfaces using Next.js
├── contracts/ # Solidity smart contracts and tests
│ ├── src/ # Contract source code
│ ├── test/ # Foundry test suite
│ └── script/ # Deployment scripts
├── ui/ # Next.js frontend application
│ ├── app/ # React components and pages
│ ├── lib/ # Utility functions and contract integration
│ └── public/ # Static assets
└── README.md # This file
Navigate to the contracts/ directory to work with the Solidity contracts:
cd contractsInstall dependencies:
forge installRun tests:
forge testFor detailed contract documentation, see contracts/README.md.
Navigate to the ui/ directory to work with the React application:
cd uiInstall dependencies:
npm installStart development server:
npm run devOpen http://localhost:3000 to view the application.
A bonding curve is a mathematical function that determines token price based on supply. Unlike traditional markets where price is set by supply and demand, bonding curves provide algorithmic price discovery.
- No Liquidity Pools: Tokens can be traded without external liquidity providers
- Fair Pricing: Everyone pays the same price for the same amount of tokens
- Continuous Trading: Buy and sell tokens at any time
- Price Predictability: Calculate exact costs before trading
- Bootstrap Liquidity: Create liquid markets from day one
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenZeppelin for secure contract libraries
- Foundry for the excellent development framework
- Next.js for the React framework
- The Ethereum community for bonding curve research and implementations