Bonding curve
Price is a function of the pool, not of a counterparty.
Pricing
Each pool holds a ZEC reserve and a token reserve. Trades preserve the product of the two reserves, so buying pushes the price up along the curve and selling pushes it back down.
text
price = zecReserve / tokenReserve buy: tokensOut = tokenReserve - (k / (zecReserve + zecIn * 0.99)) sell: zecOut = zecReserve - (k / (tokenReserve + tokensIn)) , minus 1% where k = zecReserve * tokenReserve
Why there is no order book
Because the pool always quotes a price, there is no need for a resting bid or ask. A trade either executes against the curve at the current reserve ratio or it does not execute at all. This also means there are no limit prices and no partial fills.
Worked example
| Action | ZEC in / out | Effect on price |
|---|---|---|
| Launch | — | Curve seeded with the full 1B supply |
| Buy 1 ZEC | 1 ZEC in | Price rises, tokens leave the pool |
| Buy 5 ZEC | 5 ZEC in | Price rises further along the curve |
| Sell tokens | ZEC credit out | Price falls back toward the reserve ratio |
Large orders move the price against you. Because settlement is instant and the quote is taken at execution, a big buy pays a materially higher average price than the spot quote.
Fee
A flat 1% fee applies to both sides of every trade. It is taken from the input amount before the curve math is applied.