feat: add simulate_buy and simulate_sell view functions (#836) - #843
Merged
Chucks1093 merged 1 commit intoSep 4, 2026
Merged
Conversation
|
@sojetunde8 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Member
❌ CI Failed —
|
freebuff-web
Bot
force-pushed
the
feat/simulate-view-functions
branch
2 times, most recently
from
September 4, 2026 15:41
3e21ded to
f737cb6
Compare
…rg#836) Add read-only simulation functions that compute bonding curve pricing for buy and sell operations without mutating state, enabling client-side price previews and batch cost estimates. Co-Authored-By: sojetunde8 <sojetunde8@gmail.com>
freebuff-web
Bot
force-pushed
the
feat/simulate-view-functions
branch
from
September 4, 2026 15:43
f737cb6 to
db76de3
Compare
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
simulate_buyandsimulate_sellread-only view functions to theCreatorKeysContractthat compute bonding curve pricing for any quantity without mutating state. This powers client-side price previews and batch buy total cost estimates.Closes #836
Motivation
Clients need to show price previews for various quantities without triggering a transaction. These simulation functions allow frontends to:
Changes
creator-keys/src/lib.rsNew struct:
SimulateResponse