Files
system-design-101/data/guides/money-movement.md
Kamran Ahmed ee4b7305a2 Adds ByteByteGo guides and links (#106)
This PR adds all the guides from [Visual
Guides](https://bytebytego.com/guides/) section on bytebytego to the
repository with proper links.

- [x] Markdown files for guides and categories are placed inside
`data/guides` and `data/categories`
- [x] Guide links in readme are auto-generated using
`scripts/readme.ts`. Everytime you run the script `npm run
update-readme`, it reads the categories and guides from the above
mentioned folders, generate production links for guides and categories
and populate the table of content in the readme. This ensures that any
future guides and categories will automatically get added to the readme.
- [x] Sorting inside the readme matches the actual category and guides
sorting on production
2025-03-31 22:16:44 -07:00

3.1 KiB
Raw Permalink Blame History

title, description, image, createdAt, draft, categories, tags
title description image createdAt draft categories tags
Money Movement Understanding the flow of money during online transactions. https://assets.bytebytego.com/diagrams/0127-buy-something-money-movement.jpg 2024-03-06 false
payment-and-fintech
Payments
Fintech

One picture is worth more than a thousand words. This is what happens when you buy a product using Paypal/bank card under the hood.

To understand this, we need to digest two concepts: clearing & settlement. Clearing is a process that calculates who should pay whom with how much money; while settlement is a process where real money moves between reserves in the settlement bank.

Lets say Bob wants to buy an SDI book from Claires shop on Amazon.

Pay-in flow (Bob pays Amazon money):

  • Bob buys a book on Amazon using Paypal.

  • Amazon issues a money transfer request to Paypal.

  • Since the payment token of Bobs debit card is stored in Paypal, Paypal can transfer money, on Bobs behalf, to Amazons bank account in Bank A.

  • Both Bank A and Bank B send transaction statements to the clearing institution. It reduces the transactions that need to be settled. Lets assume Bank A owes Bank B $100 and Bank B owes bank A $500 at the end of the day. When they settle, the net position is that Bank B pays Bank A $400.

    1. 5 & 1.6 The clearing institution sends clearing and settlement information to the settlement bank. Both Bank A and Bank B have pre-deposited funds in the settlement bank as money reserves, so actual money movement happens between two reserve accounts in the settlement bank.

Pay-out flow (Amazon pays the money to the seller: Claire):

  • Amazon informs the seller (Claire) that she will get paid soon.

  • Amazon issues a money transfer request from its owe bank (Bank A) to the seller bank (bank C). Here both banks record the transactions, but no real money is moved.

  • Both Bank A and Bank C send transaction statements to the clearing institution.

    1. 4 & 2.5 The clearing institution sends clearing and settlement information to the settlement bank. Money is transferred from Bank As reserve to Bank Cs reserve.

Notice that we have three layers:

  • Transaction layer: where the online purchases happen

  • Payment and clearing layer: where the payment instructions and transaction netting happen

  • Settlement layer: where the actual money movement happen

The first two layers are called information flow, and the settlement layer is called fund flow.

You can see the information flow and fund flow are separated. In the info flow, the money seems to be deducted from one bank account and added to another bank account, but the actual money movement happens in the settlement bank at the end of the day.

Because of the asynchronous nature of the info flow and the fund flow, reconciliation is very important for data consistency in the systems along with the flow.

It makes things even more interesting when Bob wants to buy a book in the Indian market, where Bob pays USD but the seller can only receive INR.