Note: when a token is launched via a bonding curve without proper parameter configuration, the very first transactions can be spam attacks from snipers, and the curve may give unfair advantage to early buyers. In each project, we configure the curve shape, fees, graduation thresholds, and protection mechanisms for the specific token economy — whether it's a meme token or utility. Our team has been working for over 5 years and has implemented more than 30 bonding curve contracts on Ethereum, BNB Chain, and Solana.
Pump.fun made bonding curves a mass product: anyone can launch a token without seed liquidity, CEX listing, or insider allocation. The price rises deterministically with purchases and falls with sales. This is not magic—it's AMM math without a counterparty pool.
But behind the simple interface lies a non-trivial choice: curve shape, parameters, graduation mechanics (transition to DEX), and protection from sniper bots. Wrong decisions here mean the token dies within the first hours. We offer complex turnkey development: from analytics to deployment, with documentation and support. Get a consultation for your project — we will evaluate the tokenomics and suggest optimal curve settings. Our approach saves up to 30% on fees through contract optimization. With proper curve configuration, you reduce liquidity costs by 20–40%.
Curve Shapes and Their Behavior
Linear bonding curve
P(x) = a * x + b
Price linearly rises with supply. Simple, predictable. Problem: with low a early buyers get minimal advantage; with high a latecomers overpay disproportionately.
Exponential / Power curve
P(x) = a * x^n
With n > 1 growth accelerates. Heavily rewards early participants. Exponential curve gives early buyers up to 10x more profit compared to a linear curve at the same final market cap. Pump.fun uses a variant of this curve. For meme tokens this is especially relevant.
Bancor formula (constant reserve ratio)
P = Balance / (Supply * CRR)
Note: where CRR is the reserve ratio. With CRR = 0.5 price grows as x². Bancor made this math popular; Uniswap v3 uses similar ideas in concentrated liquidity.
Sigmoid curve
Slow growth at the start, fast in the middle, slowdown at the maximum. Mimics S-curve adoption. More complex to implement, but more "organic" pricing for utility tokens.
How to Implement a Bonding Curve: Key Contract Decisions
Invariant vs. computation per transaction
Two approaches:
- Analytic — formula is exact, price computed mathematically for any x. Requires precise large-number arithmetic without precision loss.
- Discrete — price updates in steps. Simpler, less gas-intensive, but less accurate.
For production, analytic is preferred using fixed-point libraries (PRBMath, ABDKMath):
import { PRBMathUD60x18 } from "@prb/math/UD60x18.sol";
contract BondingCurve {
using PRBMathUD60x18 for uint256;
uint256 public constant INITIAL_PRICE = 0.000001 ether; // in wei
uint256 public constant K = 1e15; // curve steepness factor
uint256 public totalSupply;
uint256 public reserveBalance;
// Current token price at supply = x
function currentPrice() public view returns (uint256) {
// P(x) = INITIAL_PRICE + K * x^2
return INITIAL_PRICE + K.mul(totalSupply.powu(2));
}
// Cost of buying amount tokens (integral of curve)
function getBuyPrice(uint256 amount) public view returns (uint256) {
// Integral P(x)dx from totalSupply to totalSupply + amount
uint256 newSupply = totalSupply + amount;
// ∫(INITIAL_PRICE + K*x^2)dx = INITIAL_PRICE*x + K*x^3/3
return _integral(newSupply) - _integral(totalSupply);
}
function _integral(uint256 x) internal pure returns (uint256) {
return INITIAL_PRICE * x + K.mul(x.powu(3)) / 3;
}
function buy(uint256 minTokens) external payable {
uint256 tokensToMint = _calculatePurchaseReturn(msg.value);
require(tokensToMint >= minTokens, "Slippage exceeded");
reserveBalance += msg.value;
totalSupply += tokensToMint;
token.mint(msg.sender, tokensToMint);
emit Buy(msg.sender, msg.value, tokensToMint);
}
function sell(uint256 tokenAmount, uint256 minEth) external {
uint256 ethToReturn = _calculateSaleReturn(tokenAmount);
require(ethToReturn >= minEth, "Slippage exceeded");
token.burnFrom(msg.sender, tokenAmount);
totalSupply -= tokenAmount;
reserveBalance -= ethToReturn;
payable(msg.sender).transfer(ethToReturn);
emit Sell(msg.sender, tokenAmount, ethToReturn);
}
}
Slippage protection
minTokens / minEth parameters are mandatory. Without them, the transaction is vulnerable to sandwich attack: a bot sees a large purchase in the mempool, buys before it (raising price), sells after (pocketing the difference).
Fee structure
Bonding curve earns through fees on buy/sell:
uint256 public buyFeeBps = 100; // 1%
uint256 public sellFeeBps = 100; // 1%
function buy(uint256 minTokens) external payable {
uint256 fee = msg.value * buyFeeBps / 10000;
uint256 netValue = msg.value - fee;
protocolFees += fee;
// ... compute tokenAmount based on netValue
}
Pump.fun charges 1% on each transaction plus 0.5 SOL at graduation. This generates significant protocol revenue.
Why Graduation and How to Implement It?
Graduation is the moment when the token reaches a target market cap and transitions from the bonding curve to Uniswap/Raydium. This is a key moment: the curve stops, liquidity migrates to a pool.
uint256 public constant GRADUATION_THRESHOLD = 69000 ether; // market cap in wei
uint256 public constant GRADUATION_LIQUIDITY = 12000 ether; // reserve for DEX pool
function _checkGraduation() internal {
uint256 marketCap = totalSupply * currentPrice();
if (marketCap >= GRADUATION_THRESHOLD && !graduated) {
graduated = true;
_graduate();
}
}
function _graduate() internal {
// 1. Create Uniswap v2 pair
address pair = IUniswapV2Factory(UNISWAP_FACTORY).createPair(
address(token), WETH
);
// 2. Add liquidity from reserve
uint256 ethForLiquidity = GRADUATION_LIQUIDITY;
uint256 tokensForLiquidity = _calculateTokensForLiquidity(ethForLiquidity);
token.mint(address(this), tokensForLiquidity);
IUniswapV2Router(UNISWAP_ROUTER).addLiquidityETH{value: ethForLiquidity}(
address(token),
tokensForLiquidity,
0, 0, // min amounts (can be stricter)
DEAD_ADDRESS, // Burn LP tokens — liquidity locked forever
block.timestamp + 300
);
emit Graduated(pair, ethForLiquidity, tokensForLiquidity);
}
Important: LP tokens are sent to 0xdead (burn). This guarantees liquidity cannot be removed. Without this, a rug pull is possible at graduation.
How to Protect the Curve from Snipers?
Sniper bots monitor the mempool or events and buy at launch with max gas. They capture a large share of early supply.
Several protection mechanics:
- Cooldown between purchases — minimum interval between transactions from the same address.
- Max buy per transaction — limit per transaction in the first N blocks.
- Launch delay with commit-reveal — contract address unknown until launch (deployed via CREATE2 with salt known only at launch).
| Protection Method | Description | Effectiveness vs Snipers |
|---|---|---|
| Cooldown | Minimum interval between buys from same address | Medium |
| Max buy per tx | Limit on first purchase amount | High |
| Commit-reveal launch | Hidden address until launch | Very high |
Curve Parameters: Practical Guidelines
| Parameter | Meme Token Value | Utility Token Value |
|---|---|---|
| Initial price | 0.000001 ETH | 0.001 ETH |
| Graduation market cap | $50K–$100K | $500K–$2M |
| Buy fee | 1–2% | 0.3–1% |
| Sell fee | 1–2% | 0.3–1% |
| Curve shape | Exponential (n=2) | Linear or sigmoid |
| Max buy (launch) | 0.5–1 ETH | 5–10 ETH |
What's Included in the Work
Comprehensive bonding curve development includes:
- Token economy analysis and curve parameter selection
- Smart contract development in Solidity (Foundry/Hardhat) with gas optimizations
- Graduation mechanics with migration to Uniswap v2/v3 or Raydium
- Sniper protection and anti-bot mechanics
- Contract audit using Slither, Mythril, and Echidna (fuzzing)
- API documentation for frontend integration
- Deployment and verification on Etherscan/Solscan
- Technical support after launch (2 weeks)
Development Process
We follow a phased approach: analytics → design → implementation → testing → deployment. Each stage ends with an internal review and documentation.
A bonding curve is not just a smart contract; it's a price discovery mechanism without an order book. A properly configured curve creates organic price growth, fair reward for early participants, and a smooth transition to a classic AMM. Order development — we'll select optimal parameters for your project.
Get a consultation: contact us to discuss your token and receive a preliminary estimate. We'll help implement a reliable and efficient contract.







