leetbit
Thinking Too LoudstablePublished Nov 1, 2026Updated Nov 5, 202610 min read

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:

TimeeventYounessAhmed
5/2/2026, 5Youness 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 IDTimeEvent descriptionahmedSaraLucasJohn
11/5/2026, 10ahmed send 400 Mad to John-400 Mad+400 Mad
22/5/2026, 11Lucas send 50 Mad to ahmed+50 Mad-50 Mad
34/6/2026, 02 AMLucas send 100 Mad to Sara+100 Mad-100 Mad
420/7/2026, 03Sara 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 DescriptionPerson APerson B
Yan sends funds to Tai-250 Mad+250 Mad
SourceUse (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 AccountCredit Normal Account
Assets And ExpensesLiabilities and Revenue
cash, physical property, inventory, taxesCredit Card Balance, Revenue, Bank loans
uses of moneySources of money

an accounting classification Table#

Account CategoryMNEMONICAccount ExamplesAccount Type
AssetsFunds you own (Debit+, credit-)Operating cash accounting, investmentDebit Normal
Liabilitiesfunds you owe (debit-, credit+)Digital wallet balances, accounts payableCredit Normal
EquityFunds you owe to owner (debit-, credit+)Profit or investor's CapitalCredit Normal
RevenueFunds gained in course of business (debit-, credit+)Revenue, or incomeCredit Normal
ExpensesFunds 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".

TimeTransactionDebitCreditExplanation
TMiMoV raises moneycash 1M$ increaseEquity 1M$ increaseMiMoV now has 1M$ and this 1M$ is owned by investors so it's equity
T+1dMiMoV buys inventoryinventory 300K increasecash 300K$ decreasesMiMoV spent 300K$ from cash on inventory now debit has inventory so it increases
T+2dMiMoV sells the inventoryinventory -50K$ decreasescash 50K$ increasesMiMoV sells The inventory from debit That was decreased and got money wich is credit That was increased
T+3dMiMoV takes a loancash 500K increaseLoans 500K increaseso 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.

TimeTransactionDebit normal: cashDebit normal: inventoryCredit Normal: EquityCredit Normal: Loans
TMiMoV raises 1M$1M$1M$
T+1dMiMoV buy inventory700K$300K$
T+2dMiMoV sells inventory750K$250K$
T+3dMiMoV takes loans1.25M$500K$
T+4dMiMoV pays of a loan1.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 + equity

References

  1. 1Accounting For Developers, Part I: The Fundamentals
    Lucas Rocha · 2022

Relations

where else this lives in the system
rev 0last revised Nov 5, 2026first published Nov 1, 2026