Bonding curves are powerful pricing mechanisms, commonly used in token issuance, prediction markets, DAOs, and decentralized applications to determine token prices based on supply. But with great power comes many edge cases and attack surfaces.

A bonding curve is a mathematical function that defines the price of a token in relation to its supply. As tokens are bought (minted), the supply increases and the price follows the curve. When tokens are sold (burned), the price decreases accordingly.

The bonding curve is usually backed by a reserve pool (e.g., ETH, DAI), which ensures liquidity.


1. Linear Bonding Curve

Formula

Screenshot 2025-06-04 at 7.02.13 AM.png

Where:

Graph

Screenshot 2025-06-04 at 2.13.06 PM.png

Characteristics

Solidity Snippet


function getPriceLinear(uint256 supply) public view returns (uint256) {
    return a * supply + b;
}

Use Case