DEV Community

Daniel Parkson Tano
Daniel Parkson Tano

Posted on

Separating Available, Held, Actual, and Displayed Balances

Why one balance field cannot represent every financial truth in a virtual-account product.

“What is the balance?” sounds like a simple question until the system includes pending deposits, withdrawals awaiting completion, provider-reported funds, fees, manual reconciliation, and temporary account restrictions.

These values describe different truths. Compressing them into one number makes failures difficult to recover and discrepancies difficult to explain.

Define each balance explicitly

A virtual-account system may need at least four concepts:

  • ledger balance: the result of locally applied credits and debits;
  • held amount: funds reserved for operations that have not completed;
  • available balance: the amount that can be spent now;
  • actual balance: the latest balance reported by the external account provider.

Some products may also maintain a displayed balance when customer presentation must be separated from internal debt or reconciliation handling.

The relationship can be expressed as:

available balance = ledger balance - active holds
Enter fullscreen mode Exit fullscreen mode

The provider-reported actual balance should not overwrite the local ledger automatically. A difference may indicate pending events, fees, reversals, or a reconciliation issue that needs investigation.

Use holds for asynchronous withdrawals

When a customer requests a withdrawal, the platform may need to reserve funds before the external payment reaches a terminal state.

Immediately applying a final debit creates ambiguity if the provider later rejects the request. Leaving the full balance spendable creates an overspending risk.

A hold provides the intermediate state:

with database_transaction():
    account = lock_account(account_id)

    if account.available_balance < total_required:
        raise InsufficientFunds()

    account.hold_amount += total_required
    record_hold(reference, total_required)
Enter fullscreen mode Exit fullscreen mode

On success, consume the hold and create the final debit. On failure or cancellation, release it. Each action should use a stable transaction key so retries remain safe.

Preserve before-and-after values

Every balance mutation should record its effect:

reference
direction
amount
balance before
balance after
transaction type
metadata
timestamp
Enter fullscreen mode Exit fullscreen mode

The ledger then explains both the current customer balance and the path used to reach it.

Treat provider balances as reconciliation evidence

External balance updates are valuable but may arrive on a different timeline from individual transaction events.

The platform can store:

  • latest provider-reported balance;
  • time of the last successful sync;
  • local ledger balance; and
  • calculated difference.

Staff can then investigate discrepancies without silently changing customer funds.

If an authorized adjustment is required, it should be represented by a reconciliation entry with a reason, actor, reference, and before-and-after values.

Keep fees in the ledger

Transaction fees and monthly maintenance charges are financial events. They should not be hidden arithmetic applied only when the balance is serialized.

A fee engine can determine whether a fee applies based on transaction rail, amount, account configuration, or prior-period activity. The resulting charge or exemption should be recorded so staff and customers can understand what occurred.

For recurring fees, use a deterministic reference per account and billing period. This prevents two workers from charging the same month twice.

Model temporary restrictions separately

Sometimes an account should accept deposits but temporarily block outgoing transfers. That is an account capability decision, not a negative balance and not necessarily a debt.

Explicit flags or account states such as deposit-only, outgoing hold, or suspended provide clearer behavior than manipulating the balance to force withdrawals to fail.

The design principle

Balances are views of a ledger under specific rules.

Available, held, actual, and displayed amounts answer different questions. Modeling them explicitly improves withdrawal safety, reconciliation, fee transparency, and operational control without losing the audit trail behind customer funds.

Top comments (0)