Urgent.News

What's breaking now, across thousands of outlets.

Tech

Tracking Payment Liquidity with FIFO Funding Lots

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…

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.

A 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.

Implementing 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.

For 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.

Reconciling 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.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

How we keep 56,000 browser games playable on low-end devices

Most of our players aren't on gaming rigs. They're on school Chromebooks, five-year-old Android phones, and library computers.

  • Delay game iframe loading until player clicks "play"
  • Serve 56,000 thumbnails as WebP with JPEG fallbacks
  • Use single shared game shell for all pages

Cascade Poisoning in Multi-Agent Meshes: The Peer-to-Peer Trust Collapse

Originally published by **Asif Muhammad Iqbal (Founder & CEO at Logic42) * at https://logic42.ai/articles/cascade-poisoning-multi-agent-meshes .* Cascade Poisoning in Multi-Agent Meshes: The…

  • Cascade poisoning spreads malicious outputs across autonomous AI agents
  • Traditional prompt injection attacks differ from cascade poisoning's semantic trust breach
  • Zero-trust agent mesh with cryptographic identity and payload signing prevents cascade poisoning

Your Dashboard Is Green. Your Users Are Still Unhappy.

Imagine getting a message from a customer: "Your application isn't working." You open your monitoring dashboard. Server uptime: 99.99%. API response time: 120 milliseconds. Error rate: 0.1%.

  • Green dashboards can mislead about user satisfaction.
  • Technical metrics don't capture user experience.
  • Outcome observability needed for true software success.

CORS Explained: Why It's a Browser Problem (and How to Fix It on the Server)

CORS (Cross-Origin Resource Sharing) is responsible for more confused developer Stack Overflow questions than almost any other browser feature.

  • CORS is a browser problem caused by different origins in URLs
  • Simple requests use GET, POST, or HEAD methods with specific content types
  • Preflighted requests involve complex methods, custom headers, or JSON content types

More from Friday 16 October →