Repository navigation
Conversation
…integration Closes accesslayerorg#870 - Add GET /api/v1/keys/:keyId/simulate supporting single and comma-separated batch quantities - Implement constant-time O(1) bonding curve integration across milestone tiers - Enforce batch size limits (max 20) and individual quantity limits (max 1,000,000) - Reject sell requests where quantity exceeds circulating supply with 422 error - Cache preview results in Redis for 15 seconds
TS-mfon
force-pushed
the
fix/issue-870-simulate-endpoint
branch
from
September 24, 2026 17:10
802dd02 to
b590834
Compare
Contributor
Author
|
Superseded by #1007, which carries all four issues (#866, #869, #870, #872) on one branch rebased on latest Splitting these four across separate PRs meant they collided with each other: all four touch Closing this one in favour of #1007. |
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
Implements the trade execution simulation endpoint, allowing prospective buyers and sellers to preview bonding curve pricing, average price per unit, and percentage price impact prior to submitting on-chain transactions.
Closes #870
Implementation Details
GET /api/v1/keys/:keyId/simulate?quantity=N&side=buy|sellquantity=1,5,10,25) to preview tiered execution scenarios in a single round-trip.cache:keys:simulate:{keyId}:{side}:{quantities}).Testing
src/modules/keys/__tests__/key-simulate.test.tsverifying: