Skip to content

ING-107 fix(wallet credits): Calculate granted credits the same way we calculate paid credits#5525

Open
rinasergeeva wants to merge 1 commit into
mainfrom
fix/ing-107-align-granted-credits
Open

ING-107 fix(wallet credits): Calculate granted credits the same way we calculate paid credits#5525
rinasergeeva wants to merge 1 commit into
mainfrom
fix/ing-107-align-granted-credits

Conversation

@rinasergeeva
Copy link
Copy Markdown
Contributor

Context

During top-up, paid credits go through a lossy conversion: credits → amount (rounded to cents) → credits. This keeps the transaction credits as close as possible to amount / rate and limits the drift between wallet balance and credit balance.

Granted credits skip this conversion and keep arbitrary decimals as-is. A single granted transaction can drift -0.00342 credits — 342× larger than the typical paid-credit drift (~0.00001).

Fix

For new transactions, apply the paid-credits conversion to the granted credits.

Impact

Non-breaking. Only affects new granted transactions. Existing transactions unchanged.

@rinasergeeva rinasergeeva self-assigned this May 18, 2026
@rinasergeeva rinasergeeva force-pushed the fix/ing-107-align-granted-credits branch from e4ec813 to a141e7e Compare May 19, 2026 06:59
@rinasergeeva rinasergeeva marked this pull request as ready for review May 19, 2026 07:10
@rinasergeeva rinasergeeva requested a review from groyoh May 19, 2026 07:10
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