Skip to content

fix: show market prices with 6 decimal places (SUP-17) - #294

Open
Siddharth2207 wants to merge 2 commits into
mainfrom
feature/sup-17-decimal-precision-for-st0x
Open

Siddharth2207 wants to merge 2 commits into
mainfrom
feature/sup-17-decimal-precision-for-st0x

Conversation

@Siddharth2207

Copy link
Copy Markdown
Contributor

Summary

  • Add shared formatMarketPrice (6 fractional digits) so unit market/avg/best prices keep sub-cent precision.
  • Wire it into Market Order, Quick Trade, midpoint table, chart headline, and the post-trade average price.
  • Fixes SUP-17: wtSGOV Market Price no longer rounds to the nearest cent (e.g. 101.64101.637000).

Test plan

  • npm test -- tests/lib/utils/format.test.ts --run
  • Open trade for wtSGOV; confirm Market Price and Avg. price show 6 decimals
  • Confirm Est. cost still matches the finer avg × size (no more cent-rounding mismatch)
  • Spot-check Quick Trade avg/best price labels for a ~$100 token

Made with Cursor

Unit prices were rounded to cents (and QuickTrade truncated >=$100 to 1dp),
so wtSGOV quotes could not be compared fairly with DEX aggregators.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Sep 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
st0x Ready Ready Preview Sep 16, 2026 4:08pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 9204eafd-db08-4d9e-a1fc-93ec8e8f0734


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant