Skip to content

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

Merged
Gozirimdev merged 4 commits into
EF-CHAIN:mainfrom
nwosum113-ui:issue-160
Aug 22, 2026
Merged

Use exact decimal arithmetic for payments, fees, quotes, and limits#172
Gozirimdev merged 4 commits into
EF-CHAIN:mainfrom
nwosum113-ui:issue-160

Conversation

@nwosum113-ui

@nwosum113-ui nwosum113-ui commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Switch from floating-point to decimal arithmetic for all payment-related calculations to ensure precision and avoid rounding errors.

Changes

  • Replaced floating-point arithmetic with decimal-based operations in payment, pricing, and compliance modules
  • Updated Prisma schema and migration files to support decimal fields for monetary values
  • Modified validation logic to handle decimal strings and prevent precision loss
  • Added unit tests for decimal arithmetic operations
  • Updated Stellar wallet adapter to work with decimal amounts

Impact

  • Payment Orchestrator: Now uses exact decimal calculations for all transactions
  • Pricing Service: Ensures accurate rate calculations without floating-point inaccuracies
  • Compliance Service: Maintains precise financial records for auditing
  • Wallet Adapter: Handles decimal amounts correctly in Stellar transactions
  • Database Schema: Decimal fields replace float types for monetary columns

Closes #154

Remaining hardening is tracked separately in #181.

@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 2:06pm
senda Skipped Skipped Aug 20, 2026 2:06pm

@vercel
vercel Bot temporarily deployed to Preview – send-am-admin August 20, 2026 09:32 Inactive
@vercel
vercel Bot temporarily deployed to Preview – senda August 20, 2026 09:32 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.

This PR cannot be merged as linked. It says it closes #160, but #160 is about voice-note security and privacy; this PR contains decimal-payment changes.

Please either:

  • change the PR to implement issue #160 fully, or
  • link the correct issue and remove the incorrect closure.

If this is intended as decimal work, also fix mixed-asset compliance totals, exact rate parsing, configured fiat support, and existing-value reconciliation. It also overlaps with PR #171, so the duplicate work needs to be resolved.

@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 core decimal-arithmetic implementation is substantial and the remaining precision-policy, currency-separation, and reconciliation work is tracked in unassigned issue #181.

@Gozirimdev
Gozirimdev merged commit 79e7afa into EF-CHAIN:main Aug 22, 2026
3 checks passed
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