Modern Treasury: Accounting and Ledgers
Transcription of handwritten notes on accounting, transactions, and ledgers.
Source reference: [1]
Intro#
Payment operations may seem misterious by topic, largest fin-tech scale The accounting principales implementations.
Building or working on financial systems The tech part require or like needs to know financial system at its core and it's principales. A product or a tech That moves money is already in business of accounting. Things worth knowing are lot such as: Track Balances, avoid financial inconsistencies, structure systemes Tha scale cleanly.
- Double-entry accounting in which a transaction are stored in more than one account usually Two Debit and credit is one of The approaches That enhance reliability ensure recording of every event with accuracy with clear sources and destination for funds.
- Companies and successfull software companies have good Architectures, most of em rely on double entry, some implement their own logic while keeping financial principales in mind but often need to retrofit their work after incidents such as missing funds, broken payout flows, or like inconsistent balances.
- When software fails to Track money properly it does it by some common failure most common is destroying or creating funds or records of funds.
So The core principale of double entry is recording where The money came from and where it went or like what was it used for.
Core Concepts: Accounts, Transactions and Ledgers#
An account in Accounting#
an account is an isolated pool of values, a person's money deposited in a bank, from The bank's perspective is holding a money (value) on behalf of you or The person demarcated as yours, from normal individual accounts to a multi Billions companie account.
How Transactions work in a ledger#
A Transaction is an atomic event. atomic means either happening entirely or not happening. properties of a Transaction:
- has at least Two entries.
- Affects two or more accounts.
- keeps the ledger balanced.
[Marginal note:] a ledger is holding a transaction globally historically a book.
example:
| Time | event | Youness | Ahmed |
|---|---|---|---|
| 5/2/2026, 5 | Youness send 50 MAD to Ahmed | -50 Mad | +50 Mad |
Me, Anas [unclear: Belkhadi], I already studied finance at FSJES, I already know Those principales.
So let's expand it:
| Event ID | Time | Event description | ahmed | Sara | Lucas | John |
|---|---|---|---|---|---|---|
| 1 | 1/5/2026, 10 | ahmed send 400 Mad to John | -400 Mad | +400 Mad | ||
| 2 | 2/5/2026, 11 | Lucas send 50 Mad to ahmed | +50 Mad | -50 Mad | ||
| 3 | 4/6/2026, 02 AM | Lucas send 100 Mad to Sara | +100 Mad | -100 Mad | ||
| 4 | 20/7/2026, 03 | Sara send 1000 Mad to John | -1000 Mad | +1000 Mad |
- Some of The suboptimal approaches are to mutate balances Balances rather Than computing it. So mutating directly is more simpler and like easy to work with but it can lead to some incidents such as... The Things it's it became prone to error and non Trival meaning not easy to detect error from it. A better or more accurate approaches is to store transactions and compute the balances from those transactions, in which transactions are immutable while The balances depends on it and are mutable.
- So each entry has it's account and a Transaction has multiple entries and each entrie Belong to a Transaction and an account.
| Event Description | Person A | Person B |
|---|---|---|
| Yan sends funds to Tai | -250 Mad | +250 Mad |
| Source | Use (or more like where The money goes) |
So This is The idea behind double-entries where The Transaction has Two accounts each account has it's entry.
Credit Vs debit Normal Accounts#
The nostalgie hited me hard, i swear I'm about to cry, I loved that year
So In a Big overview Debit is where The money was used for, credit is where The money came from.
NOTE: it's a little Tricky.
So in more debit is. we'll give example: you have 1000 Mad you bought a product for 60 Mad. Debit goes up by 60 Mad, Credit goes down by 60 Mad. So your Mad is stored in credit. You own nothing. The account has Two sections debit/credit. you spent from credit on debit.
The all Time rule#
Sum(debit, credit) is The same no matter The Transaction, Time ...
| Debit Normal Account | Credit Normal Account |
|---|---|
| Assets And Expenses | Liabilities and Revenue |
| cash, physical property, inventory, taxes | Credit Card Balance, Revenue, Bank loans |
| uses of money | Sources of money |
an accounting classification Table#
| Account Category | MNEMONIC | Account Examples | Account Type |
|---|---|---|---|
| Assets | Funds you own (Debit+, credit-) | Operating cash accounting, investment | Debit Normal |
| Liabilities | funds you owe (debit-, credit+) | Digital wallet balances, accounts payable | Credit Normal |
| Equity | Funds you owe to owner (debit-, credit+) | Profit or investor's Capital | Credit Normal |
| Revenue | Funds gained in course of business (debit-, credit+) | Revenue, or income | Credit Normal |
| Expenses | Funds spent in course of business (debit+, credit-) | Tax expenses, fees, bills paid, rent, etc. | Debit Normal |
Requirement: Fully mastering This Concept is more like mandatory, so keep in mind That it's a perspective driven, Depends on who.
Here is a Bilan in a software Presentation. Bilan Has only Two sides But we'll be structuring it as a software piece.
Advice: practice some accounting exercices in "le Bilan".
let say a startup called "MiMoV".
| Time | Transaction | Debit | Credit | Explanation |
|---|---|---|---|---|
| T | MiMoV raises money | cash 1M$ increase | Equity 1M$ increase | MiMoV now has 1M$ and this 1M$ is owned by investors so it's equity |
| T+1d | MiMoV buys inventory | inventory 300K increase | cash 300K$ decreases | MiMoV spent 300K$ from cash on inventory now debit has inventory so it increases |
| T+2d | MiMoV sells the inventory | inventory -50K$ decreases | cash 50K$ increases | MiMoV sells The inventory from debit That was decreased and got money wich is credit That was increased |
| T+3d | MiMoV takes a loan | cash 500K increase | Loans 500K increase | so This "loan" moves both cash debit+ credit- loan payable debit- credit+ |
Also Transaction does not explicitly need to increase an account while decreasing The other. The rule is That Total debit = Total credit.
The Thing is That in finance we use classes. In software dev each classe should be an entity.
| Time | Transaction | Debit normal: cash | Debit normal: inventory | Credit Normal: Equity | Credit Normal: Loans |
|---|---|---|---|---|---|
| T | MiMoV raises 1M$ | 1M$ | 1M$ | ||
| T+1d | MiMoV buy inventory | 700K$ | 300K$ | ||
| T+2d | MiMoV sells inventory | 750K$ | 250K$ | ||
| T+3d | MiMoV takes loans | 1.25M$ | 500K$ | ||
| T+4d | MiMoV pays of a loan | 1.22M$ | 450K$ | ||
| Ending Balances | $1.47M | $1.47M |
So a Summary or recap#
- A ledger is a timestamped log of events That have monetary impact.
- An account is a separate pool of values That represents a balance you want to Track.
- Accounts are classified a debit or credit.
- A Transaction is an event recorded in The ledger.
- a Transaction must have two or more entry.
- Entries Belong to an account and to a ledger Transaction.
- Debits or entries on debit side increases the balance of debit normal accounts while credit decrease it.
- Credits or entries on credit side increase The credit normal account and debit decreases it.
- The system is correct if all or sum of all debit is equal to some of all debit. The Thing That means all money is properly accounted for.
Source: moderntreasury.com
Account: Debit = Credit
Debit Normal (left side - up with debit) Credit normal
Assets: cash, machine, stock Liabilities: loans, unpaid bills
Expenses: rent, wages, supplies Equity: capital, kept profit
Revenue: sales, income
Records: How it's tracked
Journal entry: 1 debit + 1 credit
Ledger: one T-account each
Balance sheet: Assets = liab + equityReferences
- 1Accounting For Developers, Part I: The FundamentalsLucas Rocha · 2022