Skip to content

Use exact decimal arithmetic for payments, fees, quotes, and limits - #171

Open
nwosum113-ui wants to merge 4 commits into
EF-CHAIN:mainfrom
nwosum113-ui:issue-154
Open

Use exact decimal arithmetic for payments, fees, quotes, and limits #171
nwosum113-ui wants to merge 4 commits into
EF-CHAIN:mainfrom
nwosum113-ui:issue-154

Conversation

@nwosum113-ui

Copy link
Copy Markdown
Contributor

Summary

Implement exact decimal arithmetic for financial calculations to ensure precision and avoid floating-point errors in payments.

Changes

  • Replaced floating-point arithmetic with exact decimal operations in payment-related services and utilities
  • Updated validation logic to enforce decimal precision requirements
  • Added unit tests to verify exact decimal behavior in financial calculations

Impact

  • Payment Orchestrator: Ensures accurate payment calculations
  • Compliance Service: Maintains precise financial compliance checks
  • Pricing Service: Improves pricing accuracy
  • Wallet Adapter: Enhances Stellar transaction precision
  • Money Utilities: Centralizes exact decimal arithmetic logic
  • Test Coverage: Validates financial calculations with exact decimals

closes #154

…metic-for-financial-calculations

Use exact decimal arithmetic for payments and fees
@vercel
vercel Bot temporarily deployed to Preview – senda August 20, 2026 09:09 Inactive
@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
send-am-admin Skipped Skipped Aug 20, 2026 9:42am
senda Skipped Skipped Aug 20, 2026 9:42am

@vercel
vercel Bot temporarily deployed to Preview – send-am-admin August 20, 2026 09:09 Inactive

@Gozirimdev Gozirimdev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The decimal work is moving in the right direction, but we still need:

  • Preserve exchange rates as decimals before JSON parsing can turn them into JavaScript numbers.
  • Keep compliance totals separated by asset/currency and apply limits in a clearly defined currency.
  • Support configured fiat currencies instead of a hard-coded list.
  • Add a safe audit/reconciliation step for existing values.
  • Add tests for mixed assets, rounding boundaries, large values, API output, and reconciliation.

Please finish these items before we merge.

@Gozirimdev Gozirimdev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR now conflicts with main and duplicates the decimal implementation already merged in #172. Please close this duplicate PR.

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.

Use exact decimal arithmetic for payments, fees, quotes, and limits

2 participants