func BuyTokens
BuyTokens quotes a virtual constant-product buy (net ugnot in).
Package ammmath implements integer bonding-curve and constant-product AMM helpers for the gnomemepad factory (Pump-st...
Package ammmath implements integer bonding-curve and constant-product AMM helpers for the gnomemepad factory (Pump-style virtual CPMM + real CPMM pool).
BuyTokens quotes a virtual constant-product buy (net ugnot in).
CanGraduate reports whether raised net ugnot meets the threshold.
1func PoolSwapTokenForUgnot(poolUgnot, poolToken, tokensIn int64) (ugnotOut, newPU, newPT int64)PoolSwapTokenForUgnot swaps tokens for gross ugnot out.
1func PoolSwapUgnotForToken(poolUgnot, poolToken, ugnotIn, remainderToPool int64) (tokensOut, newPU, newPT int64)PoolSwapUgnotForToken swaps net ugnot for tokens; remainderToPool adds to ugnot reserve.
SellTokens quotes a virtual constant-product sell (gross ugnot out).
SpotPriceUgnotPerToken returns ugnot per token scaled by 1e6 (display only).
ApplyFee takes gross quote paid by the user and feeBPS (e.g. 120 = 1.20%).
ApplyFeeOnOutput charges fee on assets leaving the pool/curve.