Summary
Computing the expected price for a given supply step requires running the same formula used in the buy/sell path. A pure helper function should expose this calculation so tests and off-chain tooling can predict prices without invoking a state-mutating transaction.
Scope
- Add a read-only
query_price(supply: u64) -> i128 contract function
- Must return the same value the buy function would compute for that supply step
- Should not require admin authentication
- Add unit tests for supply 0, supply 1, and a mid-range supply value confirming the result matches the inline formula
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram
Summary
Computing the expected price for a given supply step requires running the same formula used in the buy/sell path. A pure helper function should expose this calculation so tests and off-chain tooling can predict prices without invoking a state-mutating transaction.
Scope
query_price(supply: u64) -> i128contract functionAcceptance Criteria
query_priceis read-only and requires no authETA: 12 hours
Coordinate on Telegram