Our fourth annual State of Payment Operations report is here.Get the Report →

Journal

Key Ledgering Challenges for Investing Platforms

Here, one of our software engineers looks at the challenges investing platforms face and explores how designing a ledger can better address them.

Image of Sahil Altekar
Sahil AltekarSoftware Engineer

Investing platforms process large numbers of securities-related transactions every second. As each user makes trades, the platform has to check their spending power, track the transfer and settlement of funds, and allocate securities to the end user.

To do this effectively, a good investing platform needs a good ledger. But maintaining a ledger is not easy. Things like complex calculations, collecting incoming data from financial intermediaries, and scaling the overall investing platform can make ledgering a challenge.

How a ledger fits into an investing platform’s architecture.
How a ledger fits into an investing platform’s architecture.

In this article, we will go through the challenges investing platforms face and how designing a ledger can better address them.

Typical Architectural Challenges in Ledgering

Balance Queries

Securities transactions require rapid querying of balances to compute buying power, margin calculations, and real-time balances. These queries must be well-structured, accurate, and fast. Additionally, providing an accurate record of historical balances is necessary to do aggregate calculations across time periods such as one month, six months, year-to-date (YTD), or other significant increments of time.

Some investment platforms choose to do live aggregations on their database to pull these balances, which can create additional performance and accuracy issues for users.

Reconciliation with Financial Intermediaries

Recording transactions from users and reconciling them with reports from clearinghouses can be challenging due to the complexity of transactions. Transactions can be partially settled, have different timings than the investment platform’s internal system, or be missing entirely. This, along with the high volume of transactions, makes reconciliation a challenge.

Some investment platforms rely on the clearinghouse as the definitive source of information. This reliance means that, if there are discrepancies, the investment platform must overwrite its own database in order to update it, which can affect auditability and risk management. It also can introduce errors or cause further discrepancies that necessitate manual investigation in order to explain to users or auditors what happened to a transaction.

Scalability

Processing large volumes of transactions accurately and swiftly, especially when reacting to events with “bursty” traffic like dividend payouts, is not easy. For example, when a dividend is processed, any user who holds the underlying equity will receive a dividend, meaning many cash balances have to be updated simultaneously.

When a system isn’t architected to handle these bursts it can create high latency, which can lead to lag and even timeouts. This has downstream effects for the user when displaying up-to-date balances and impact buying power calculations.

How a Well-Architected Ledger Helps

For an investing platform, a well-architected ledger database has two primary responsibilities:

  1. Store user transactions & holdings data in an accurate and structured way
  2. Easily handle incoming data from financial intermediaries

With a ledger, an investing platform is able to store, persist, and retrieve data at low latencies, process billions of transactions quickly, and reconcile records effectively.

A look at how a ledger can fit into the life cycle of a trading event.
A look at how a ledger can fit into the life cycle of a trading event.

Storing Data

An investing platform must accurately record all transactions and money movement, so its ledger needs the following features:

Pending and Posted Balances: A ledger should be able to model different balance types to encompass all transaction activity, including unsettled transactions. Knowing where a transaction is in its lifecycle helps especially when making buying power calculations in real-time especially when these calculations become more complex like margin trading.

Conditional Transactions: A ledger should be able to support rules for transaction settling to prevent misallocations and errors. For example, conditional transactions allow actions like taking funds out of a user’s account only if they have sufficient balance.

Idempotency: A ledger should ensure requests are rejected if they are accidentally sent twice. This helps prevent user error and ensures availability of funds.

Immutability: A ledger should maintain a fixed record of all transactions and be able to easily revert to prior states during error handling.

Multi-Currency: A ledger should be built to support global currencies and as well as be able to model arbitrary units, like security counts.

Double-Entry Accounting: A ledger should be modeled to have matching credits and debits. This ensures that money is always tracked both within user liabilities and as an asset, which helps prevent errors. For example, when a user purchases a security, we can easily see the exchange of USD to stock units with double-entry accounting:

Auditability: A ledger should maintain versioning on user balances corresponding to transactions. This maintains historical accuracy and provides visibility into the origination of balance changes.

Dealing with Financial Intermediaries

Investing platforms need to maintain their own ledger independent from any third parties and reconcile to the intermediaries’ systems. Some good rules of thumb:

  1. Maintain business logic outside of the intermediary. For example, the investing platform may have more context on margin offerings which will affect buying power calculations (whereas a clearinghouse would be the source of truth for securities holdings but not cash).
  2. Avoid interacting with the clearinghouse API unnecessarily, which is costly and can lead to latency problems over time, as transaction volumes scale.
  3. Operate in real-time. Third parties may not operate in real-time, but the optimal user experience is providing instant updates when they make actions like trading and viewing balances.
  4. Choose how to store their data in a way that's beneficial for the business. For example, storing your data in the ways described above makes it easier to retrieve the data in an efficient manner necessary for investing use cases and powering critical business needs.
  5. Spot check clearinghouses. With an independent ledger, investing platforms can cross-verify data with third-party sources, help identify discrepancies, and decide when it's necessary to update records.

Dealing with latency requirements, scale, complex aggregations, and incoming data—while also maintaining real-time visibility to your users—is hard. However, the investment in a high-quality ledger is well worth it to know that your data and transactions are being accurately recorded.

If you’re ready to find a ledgering solution that works at scale for your business, reach out to us.

  1. For non-technical readers, “bursty” traffic is when there are unexpected or sudden network traffic volume peaks and valleys.

Try Modern Treasury

See how smooth payment operations can be.

Talk to sales