Skip to content

Pricing & Fees

The Twin.fun bonding curve determines deterministic pricing for every trade.

Fees per Trade

  • Protocol fee → sent to the treasury address.
  • Subject fee → paid to the twin owner.
  • Percentages are configured in the contract (1e18 = 100%).

Creation Rules

  • At zero supply, buyers must purchase at least minSharesToCreate keys.
  • If an ID is pre-mapped to an owner, only that address can execute the first buy.

Pricing Intuition

  • Earlier buyers pay less; each additional key marginally increases price.
  • Selling walks back down the curve, returning ETH at the lower supply point.

Mathematics (Advanced)

Let supply be the current supply and amount the delta for the trade.

sum1 = (supply-1)*supply*(2*(supply-1)+1)/6         // if supply > 0 else 0
sum2 = (supply+amount-1)*(supply+amount)*(2*(...)+1)/6
price = (sum2 - sum1) * 1 ether / 1,600,000
  • Buy: getPrice(supply, amount)
  • Sell: getPrice(supply - amount, amount)
  • Fees:
    • protocol = price * protocolFeePercent / 1e18
    • subject = price * subjectFeePercent / 1e18

OpenGradient 2025