DEV Community

Daniel Parkson Tano
Daniel Parkson Tano

Posted on AI-assisted

Reconcile Money at the Same Point in Time

Why provider balances, local ledgers, pending withdrawals, and snapshot timestamps must be compared together.

Reconciliation is often described as comparing two balances. In practice, two correct systems can report different balances because they are describing different points in time or different stages of settlement.

Suppose the local ledger shows 50,000. A withdrawal of 2,000 is held locally but has not reached the provider. The provider balance still shows 50,000. Comparing the raw balances suggests everything matches, even though 2,000 is already unavailable to customers.

Now suppose the provider accepts the withdrawal and immediately reduces its balance, while the local ledger waits for final settlement. A raw comparison reports a 2,000 discrepancy even though both systems are behaving correctly.

Reconciliation needs an adjusted expectation:

expected provider balance
= last reconciled provider balance
+ externally settled inflows
- provider-accepted outflows
- provider-posted fees
Enter fullscreen mode Exit fullscreen mode

The exact formula depends on the provider contract, but every term needs an explicit settlement state.

Store two timestamps

Every provider snapshot should store:

  1. the provider's as_of time, when the balance was true; and
  2. the local retrieval time, when the system received it.

Without the first timestamp, a delayed response can overwrite a newer observation. Without the second, operators cannot distinguish stale provider data from a delayed polling job.

Accept snapshots in provider-time order. If an older snapshot arrives after a newer one, preserve it for audit but do not make it the current balance.

Separate observation from movement

A balance snapshot is an observation. A ledger entry is a movement. Treating them as interchangeable makes it difficult to explain a change.

Store snapshots only when the balance changes, while always updating the latest successful check time. This creates a compact history showing opening balance, closing balance, and the change from the previous observation without writing identical rows every hour.

Daily money movement should come from transaction records, grouped by settlement date, direction, provider, and currency. It should not be inferred only from balance differences because prefunding, fees, reversals, and manual adjustments can produce the same change.

Use tolerance deliberately

Currency precision, provider rounding, and delayed fees can create small differences. Define tolerances by currency and reconciliation stage rather than applying one global threshold.

A mismatch should carry context: expected value, observed value, difference, snapshot age, unsettled items, and the last matching point. This gives operations a useful investigation record instead of a generic red alert.

Reconcile progressively

Start with reference-level matching. Then compare transaction totals for a time window. Finally compare adjusted balances. A balance mismatch with fully matched transactions points toward fees, timing, or missing adjustments. Unmatched transactions indicate a different class of problem.

Good reconciliation preserves uncertainty. It does not force two numbers to agree; it explains why they do or do not agree at a specific moment.

Implementation checklist

For each provider, document when its balance changes: request acceptance, processing, settlement, or fee posting. Store snapshot source, currency, account identifier, provider time, retrieval time, and request outcome. Reject older observations from the current-balance projection while retaining them for audit.

Build reconciliation output that shows matched transactions, unmatched local entries, unmatched provider entries, timing adjustments, fee adjustments, and the final unexplained difference. Alert only on the unexplained remainder and include the snapshot age so operators can judge whether another sync should occur before escalation.

Top comments (2)

Collapse
 
digitalgh0st profile image
Digital Ghost •

Why you spamming

Collapse
 
parksontano profile image
Daniel Parkson Tano •

what are you saying