Skip to content

Add a key simulation tool on the key detail page allowing users to model different buy scenarios #875

Description

@Chucks1093

Summary

Users want to understand how the bonding curve price will change at different quantities before committing funds. A simulation panel on the key detail page that uses the simulate_buy view function to show price at 1, 5, 10, and 50 keys would help buyers make informed decisions.

Scope

  • Add a Price Simulator section on the key detail page below the price chart
  • Fetch simulated prices from GET /keys/:keyId/simulate?quantity=1,5,10,50 in a single request
  • Render a table with columns: Quantity, Price per Key, Total Cost, Price Impact (%)
  • Allow users to enter a custom quantity and fetch the simulation on the fly with a 300ms debounce
  • Show a loading skeleton for the table while fetching

Acceptance Criteria

  • Preset quantities (1, 5, 10, 50) rendered with correct simulated prices on load
  • Custom quantity input fetches and updates the row with a 300ms debounce
  • Price Impact computed correctly as (simulated_price - spot_price) / spot_price * 100
  • Loading skeleton shown during fetch
  • Table hidden when the simulate endpoint returns an error

ETA: 12 hours


Coordinate on Telegram

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions