Summary
Off-chain tools and tests both need to predict prices and fees without triggering state-mutating transactions. A read-only price query function and thorough fee unit tests at boundary supply values address both needs and together verify the bonding curve formula end to end.
Scope
- Add
query_price(supply: u64) -> i128 read-only contract function — returns the same value the buy path computes for that supply step, requires no auth, performs no storage writes
- Add unit tests for
query_price at supply 0, 1, and a mid-range value confirming output matches the inline formula
- Add protocol fee unit tests at supply 0, 1, and 1000 asserting the computed fee matches expected bps-based value; assert fee floors (rounds down) on non-whole stroop results
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram
Summary
Off-chain tools and tests both need to predict prices and fees without triggering state-mutating transactions. A read-only price query function and thorough fee unit tests at boundary supply values address both needs and together verify the bonding curve formula end to end.
Scope
query_price(supply: u64) -> i128read-only contract function — returns the same value the buy path computes for that supply step, requires no auth, performs no storage writesquery_priceat supply 0, 1, and a mid-range value confirming output matches the inline formulaAcceptance Criteria
query_priceis read-only, requires no auth, performs no writesquery_priceoutput matches buy-path formula at supply 0, 1, and mid-rangeETA: 12 hours
Coordinate on Telegram