{
  "id": 14965247,
  "title": "Tracking Payment Liquidity with FIFO Funding Lots",
  "url": "https://urgent.news/2026/10/16/tracking-payment-liquidity-with-fifo-funding-lots",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-16T13:42:44.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/parksontano/tracking-payment-liquidity-with-fifo-funding-lots-5693"
  },
  "original_language": "en",
  "account": "Understanding the true cost of payouts requires more than just aggregate account balances. Payout accounts may appear to have sufficient funds for a transfer, but they don't reveal the underlying factors that impact the transfer's cost. Liquidity is often acquired in separate batches, each with its own unique exchange rate, funding date, provider cost, or settlement source. When a payout consumes this liquidity, finance teams need to know exactly which funds were used and what margin remained.\n\nA funding-lot ledger provides a more detailed breakdown than an aggregate balance. Each funding lot contains crucial information such as the reference funding date, the original amount, the remaining amount, the acquisition rate, the status, and metadata. As payouts consume the lot, the remaining amount changes, while the original amount and acquisition rate remain a part of the audit history. This allocation strategy, known as FIFO (First In, First Out) allocation, is straightforward to describe but can be subtle to implement.\n\nImplementing FIFO allocation begins with retrieving all open lots and ordering them by their funding date and creation date. Then, for each lot, the payout amount is subtracted from the lot's remaining amount. If the remaining amount reaches zero, the loop breaks, and the remaining liquidity is considered allocated. The used amount from each lot is then recorded in the allocation database entry. To prevent concurrent payouts from consuming the same liquidity, row locks are used. Additionally, the system ensures that allocation tasks are retry-safe by calculating the amount already assigned to the transaction reference before allocating further.\n\nFor payouts spanning multiple lots, financial values must be distributed proportionally. This involves calculating the share of the total payout, the attributed customer revenue, the provider-fee share, the cost at the lot's acquisition rate, the payout cost excluding the provider fee, and the resulting FX margin. Any rounding differences are absorbed by the final allocation to ensure that the parts equal the original transaction totals exactly.\n\nReconciling derived values is essential. Financial rules evolve over time, and a reconciliation service must be able to rebuild remaining lot balances and derived allocation values from authoritative transactions without altering the live history. Manual overrides must also be handled explicitly and traceably. A corrected revenue value should be marked as an override rather than becoming indistinguishable from a calculated value. By treating liquidity as financial inventory and utilizing funding lots and immutable allocations, treasury visibility, transaction-level cost attribution, controlled reconciliation, and reliable margin analysis can be achieved without relying on aggregate balances to reconstruct past economic data.",
  "summary": "Moving beyond aggregate balances to understand the real cost of every payout. A payout account may show enough money to complete a transfer, but that balance alone cannot explain what the transfer costs. Liquidity is often acquired in separate batches. Each batch may have a different exchange rate, funding date, provider cost, or settlement source. When a payout consumes that liquidity, finance…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}