feat(cashout): show the real settlement amount on the cashout entry screen - #683
Open
islandbitcoin wants to merge 3 commits into
Open
feat(cashout): show the real settlement amount on the cashout entry screen#683islandbitcoin wants to merge 3 commits into
islandbitcoin wants to merge 3 commits into
Conversation
…creen Users anchored on the AmountInput's JMD conversion, which uses the realtimePrice display rate (mid-market) — but JMD cashouts settle at the NCB rate minus the 2% fee, so bank deposits came in ~5-7% below the number people remembered. The entry screen now shows what will actually arrive. - New CashoutRate query (backend companion PR) fetched on the entry screen for bank cashouts; skipped for Bridge withdrawals. - "You'll receive about J$X" + "Settlement rate: US$1 = J$Y" + a note that the final amount is confirmed on the next screen — rendered once an amount is entered. - estimateJmdReceiveCents mirrors the backend quote math (fee in bps off the USD amount first, then integer conversion at JMD-cents-per-USD); unit-tested including flooring parity and NaN guards. - Fails quiet: if the rate query errors, the preview is simply absent and the confirmation screen still shows the authoritative offer numbers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017iEVSCGxZMRjwsmSsd6ZNU
islandbitcoin
force-pushed
the
feat/cashout-rate-preview
branch
from
August 8, 2026 05:37
82bfb16 to
eff6087
Compare
Review findings: a user whose only cashout account is USD gets a USD payout with no conversion — the preview showed a JMD estimate anyway. The payout account selection is now a shared pure helper (pickDefaultBankAccount / selectsJmdPayout) used by both onNext and the preview condition so they can never disagree; +6 tests including the stored-default equivalence property the preview relies on. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017iEVSCGxZMRjwsmSsd6ZNU
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017iEVSCGxZMRjwsmSsd6ZNU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Users anchor on the entry screen's JMD conversion, which uses the realtimePrice display rate (mid-market) — but JMD cashouts settle at the NCB rate minus the 2% fee, so bank deposits arrive ~5-7% below the number people remember. Support is fielding "I received less than the app showed" because of it.
What
On the cashout entry screen (bank cashouts only; Bridge withdrawals unaffected), once an amount is entered:
cashoutRatequery — companion backend PR: feat(cashout): expose the JMD settlement rate pre-quote (cashoutRate query) flash#471 (must deploy first; until then the preview simply doesn't render).estimateJmdReceiveCentsmirrors the backend quote math exactly (fee bps off USD first, integer conversion at JMD-cents-per-USD) — unit-tested including flooring parity and NaN guards. The authoritative number is still the offer'sreceiveJmdon the confirmation screen; the preview just makes the anchor honest.Tests / checks
__tests__/screens/cashout-estimate.spec.ts(4 tests, incl. backend-math parity case).tsc:check,check:translations,check:codegen, eslint on changed files: all green locally.🤖 Generated with Claude Code
https://claude.ai/code/session_017iEVSCGxZMRjwsmSsd6ZNU