Skip to content

fix: use BigInt arithmetic for trade panel precision - #95

Open
alastairong1 wants to merge 1 commit into
mainfrom
claude/fix-trade-panel-precision-01A2RRo1dUQQMLM5nHinR71N
Open

alastairong1 wants to merge 1 commit into
mainfrom
claude/fix-trade-panel-precision-01A2RRo1dUQQMLM5nHinR71N

Conversation

@alastairong1

Copy link
Copy Markdown
Contributor

Replace floating-point conversions with BigInt math throughout trade components to eliminate rounding errors in percentage button handlers and balance calculations.

Changes:

  • Add bigIntMath.ts utility module with scaled BigInt arithmetic functions
  • MarketOrder: Use BigInt for percentage handlers and balance checks
  • LimitOrder: Use BigInt for percentage handlers
  • DcaOrder: Use BigInt for min trade amount calculation
  • QuickTrade: Use BigInt for percentage calculations
  • transaction.ts: Use bigIntRatio for ioRatio and fill percentage
  • tradeTransform.ts: Use bigIntRatio for price calculation

Replace floating-point conversions with BigInt math throughout trade
components to eliminate rounding errors in percentage button handlers
and balance calculations.

Changes:
- Add bigIntMath.ts utility module with scaled BigInt arithmetic functions
- MarketOrder: Use BigInt for percentage handlers and balance checks
- LimitOrder: Use BigInt for percentage handlers
- DcaOrder: Use BigInt for min trade amount calculation
- QuickTrade: Use BigInt for percentage calculations
- transaction.ts: Use bigIntRatio for ioRatio and fill percentage
- tradeTransform.ts: Use bigIntRatio for price calculation
@vercel

vercel Bot commented Dec 15, 2025

Copy link
Copy Markdown

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

Project Deployment Review Updated (UTC)
st0x Ready Ready Preview, Comment Dec 15, 2025 8:38pm

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.

2 participants