Question
Design the double-entry postings for a cross-currency PAYMENT (not a balance conversion): a sender pays 100 EUR and the recipient receives USD, settled through your own FX inventory. Per-currency the books must each balance to zero, the FX spread must land in a P&L account, and the system must handle ~7,000 such payments/sec while staying auditable. The subtlety: a single user-facing transfer touches two currencies, so 'debits == credits' can't be checked across currencies — only within each. How do you structure the entries so each currency balances and the FX gain/loss is captured exactly?
Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts — data model, bottlenecks, consistency, failure modes — and name the trade-offs you are making.