Liquidity sweeps

What's real Eleanor Whitfield · Corporate Treasurer E

Liquidity concentration

Zero-balance sweeps from virtual accounts into their physical pooling header. Guarded by a non-blocking advisory lock and a UNIQUE(run_date) claim, because the failure mode of a double sweep is inventing money.

£1,980,714

swept into pooling headers, GBP equivalent, all time

No sweeps in the last 30 days

How a double sweep is prevented

  • Advisory lock
    GET_LOCK('gcms_liquidity_sweeper', 0) — a second process refuses immediately rather than racing.
  • Run-date claim
    UNIQUE(run_date) — even a lock lost across a restart cannot sweep the day twice.
  • Row locks in a total order
    Child and parent locked FOR UPDATE by ascending account_id, so a sweep and a payment cannot deadlock.
  • Only unheld funds, only active accounts
    A FROZEN account under a sanctions hold is never swept. Held money is already committed to a payment.
  • A journal per movement
    Balanced debit and credit, so tomorrow morning the movement can be explained.

Sweeper runs

One row per value date, claimed before any money moves

Value date Status Considered Swept Skipped Started Finished
Completed 19 16 3 10 Jul 23:05 10 Jul 23:09
Completed 16 14 2 09 Jul 23:05 09 Jul 23:09
Completed 21 18 3 08 Jul 23:05 08 Jul 23:08
Completed 19 17 2 07 Jul 23:05 07 Jul 23:06
Completed 20 19 1 06 Jul 23:05 06 Jul 23:07
Completed 19 17 2 03 Jul 23:05 03 Jul 23:08