Summary
The client needs to show price previews for various quantities without triggering a transaction. A simulate_buy and simulate_sell view function that accepts a supply level and quantity and returns the computed price without mutating any state would power client-side price previews and the batch buy total cost estimate.
Scope
- Add simulate_buy(key_id: BytesN<32>, quantity: u32) as a read-only view function
- Add simulate_sell(key_id: BytesN<32>, quantity: u32) as a read-only view function
- Both functions should read the current supply from storage and compute the price using the bonding curve formula
- Return the total cost and per-unit price without writing to any storage entry
- These functions must work during the auction phase, returning the auction price when applicable
Acceptance Criteria
ETA: 24 hours
Coordinate on Telegram
Summary
The client needs to show price previews for various quantities without triggering a transaction. A simulate_buy and simulate_sell view function that accepts a supply level and quantity and returns the computed price without mutating any state would power client-side price previews and the batch buy total cost estimate.
Scope
Acceptance Criteria
ETA: 24 hours
Coordinate on Telegram