Skip to content

Add a TWAP price display on the key detail page alongside the bonding curve spot price #827

Description

@Chucks1093

Summary

The spot price can be manipulated by a single large trade. Displaying the TWAP price alongside the spot price on the key detail page would give buyers a more reliable price reference before committing to a purchase.

Scope

  • Fetch the TWAP price from GET /keys/:keyId/twap?window=24h on key detail page load
  • Display the TWAP price below the spot price with a label 'TWAP (24h)'
  • Show a tooltip explaining: 'Time-weighted average price over the past 24 hours. Less sensitive to short-term manipulation.'
  • Colour the TWAP label green if the spot price is above TWAP and red if below
  • Show a loading skeleton for the TWAP value while it fetches

Acceptance Criteria

  • TWAP price displayed with correct label and value
  • Tooltip shown on hover of the TWAP label
  • Green label when spot is above TWAP, red when below
  • Loading skeleton shown while fetching
  • TWAP hidden when the endpoint returns null (insufficient data)

ETA: 12 hours


Coordinate on Telegram

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