Skip to content

feat(cashout): show the real settlement amount on the cashout entry screen - #683

Open
islandbitcoin wants to merge 3 commits into
mainfrom
feat/cashout-rate-preview
Open

feat(cashout): show the real settlement amount on the cashout entry screen#683
islandbitcoin wants to merge 3 commits into
mainfrom
feat/cashout-rate-preview

Conversation

@islandbitcoin

Copy link
Copy Markdown
Contributor

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:

You'll receive about J$14,964.60 in your bank account
Settlement rate: US$1 = J$152.70
Final amount is confirmed on the next screen

  • Fed by the new cashoutRate query — 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).
  • estimateJmdReceiveCents mirrors 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's receiveJmd on the confirmation screen; the preview just makes the anchor honest.
  • Fails quiet: rate query error → no preview, flow unchanged.

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

…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
islandbitcoin force-pushed the feat/cashout-rate-preview branch from 82bfb16 to eff6087 Compare August 8, 2026 05:37
Dread and others added 2 commits August 7, 2026 23:17
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
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.

1 participant