Lending, Deposits, and Interest — Where a Bank's Numbers Start
In one line
A bank's core products are deposit-taking, where it receives money, and lending, where it lends money, and the difference between the two sides, interest, is the bank's main source of revenue — so how interest is calculated and when it can no longer be collected set the backbone of a bank's systems.
Why this knowledge is needed
Here is what an engineer who joins a bank hears in the first week. "The per-installment interest in the loan ledger is off by 1 won from the channel screen," "this loan is equal principal, so the first month's payment is the largest," "a loan more than 90 days overdue drops to substandard and provisions jump." All of it is product knowledge, not technical knowledge. But if you cannot understand these words, you can neither write down the requirements nor tell a bug from normal behavior.
Deposit-taking is the side where the bank receives money from customers. There are demand deposits (money in and out freely), time deposits (locked until maturity and paying more interest), and installment savings (paid in every month). Lending is the side where the bank lends money to customers. Personal credit loans, secured loans (housing, jeonse lease deposits), corporate working capital loans, and so on. From the bank's point of view, a deposit is money it has to pay back, so it is a liability, and a loan is money it will receive, so it is an asset. This direction is the most confusing at first.
The repayment method sets the numbers
There are three main ways of repaying a loan.
| Repayment method | What stays the same and what changes |
|---|---|
| Equal principal and interest | The monthly payment (principal + interest) is the same. Early on, interest makes up most of it; later, principal does. |
| Equal principal | The principal repaid each month is the same. Interest accrues on the balance, so it falls every month and the payment gets smaller. |
| Lump sum at maturity | You pay only interest during the term and repay the principal in one go at maturity. |
For the same amount, rate, and term, total interest is lowest with equal principal, next with equal principal-and-interest, and highest with lump sum at maturity. This is because the faster you repay principal, the faster the balance on which interest accrues shrinks. In return, equal principal has the heaviest burden in the first month. Which one the customer picks is a matter of cash flow, and the system must produce the schedules of both methods accurately.
The monthly payment for equal principal-and-interest comes from a single formula. If the principal is P, the monthly rate is r, and the number of months is n, it is P × r ÷ (1 − (1 + r)^−n). Each month's interest is the previous balance multiplied by the monthly rate, and what remains after subtracting interest from the payment is that month's principal repayment. In the last month, rounding errors have accumulated, so you adjust it by repaying all the remaining principal.
Interest calculation has conventions
What makes practice harder than the formula is conventions. Whether the monthly rate uses the annual rate divided by 12 as is, or cuts off at which decimal place. Whether daily proration divides by 365 or by 366 in a leap year. Whether amounts below one won are rounded or truncated, and whether they are dropped per installment or once on the total. These rules are written in the company's product definition document, and if the rules differ, the numbers are off by 1 won. And that 1 won is sure to be caught in ledger reconciliation.
Tax comes with deposit interest. Interest income is subject to withholding of 14% income tax and 1.4% local income tax, which is 10% of that. What the customer receives is the after-tax interest, and the bank pays the withheld tax to the state. Tax is calculated separately for each case and follows a truncation rule (roughly, dropping amounts below 10 won).
Being overdue is both interest and classification
Once the payment date has passed, the loan becomes overdue. Late interest accrues at a rate that adds an overdue surcharge rate to the contract rate, and the ceiling on the surcharge is set by regulation (in Korea, roughly 3 percentage points). But being overdue does not end as an interest matter. An asset quality classification follows. Supervisory regulations require loans to be divided into five levels — normal, precautionary, substandard, doubtful, and estimated loss — and the overdue period is the representative criterion. Roughly, under 1 month is normal, 1–3 months is precautionary, and 3 months or more is substandard or below.
The reason the classification matters is provisions. Against losses, a bank must build up at least a set ratio by classification as a loan loss provision, and that ratio is around 1% for normal, around 20% for substandard, and 100% for estimated loss (it differs for households and corporations, and by regulation). A provision is an expense, so it is reflected immediately in profit and loss. If one loan drops from precautionary to substandard, that quarter's profit shrinks by that much. That is why the classification batch is the most sensitive batch at month-end and quarter-end, and if you count the overdue days wrong by one day, the supervisory report is wrong.
What you must decide when turning interest and repayment into code
The code that computes a repayment schedule is short, but if it goes wrong, the amount billed to customers changes. So there are items that must be decided before you start.
First decide the day-count convention. Even for the same 5% annual rate, actual/365, actual/360, and 30/360 give different values. It must be written in the product definition document, and the code should carry that convention as a value. If you hard-code it, an accident is certain when a new product comes in.
Decide the rounding place and direction. Depending on whether you truncate or round at the won level, and per installment or all at the end, the total differs by tens of won. It looks small, but it is where customers check with a calculator and call to ask. The most common approach is to adjust the balance in the last installment.
Decide the holiday rule. If a payment date is a holiday, it splits on whether to move it earlier or later, and on whether to recompute interest then. Calendars differ by country and change every year, so manage them as data.
An early repayment recomputes everything that remains. If you repay part, the principal and interest of the later installments change, and depending on the repayment method, whether to reduce the installment amount or shorten the term differs. Which one it is is an item the customer chooses, so it must remain in the contract.
Being overdue is a separate rate and a separate state. Late interest accrues at a rate different from normal interest, and after a certain period the asset classification changes. A change in classification affects accounting and regulatory reporting, so do not mix interest calculation and classification judgment in the same code.
Pass the reference date into every calculation. If you take today's date inside the function, you cannot reproduce a past point in time. If you cannot reproduce it, you cannot answer customer inquiries.
What really matters in practice
First, do not bury rules in code; keep them as data. The rounding method, day-count basis, and overdue surcharge rate differ by product and change along with regulation. Keep them in a product definition table and have the calculator read them.
Second, store the schedule and recompute it to compare. If the schedule made when the loan was executed differs from the schedule recomputed now, one of the two is wrong, and at which installment the difference started points to the cause.
Third, overdue days are a function of the reference date. If you run it today, it is as of today; if it is a month-end batch, as of month-end. An overdue calculator that does not take the reference date as an argument gives a different answer every time it is rerun.
In the next lab, you will calculate schedules directly with these rules, and pull out deposit interest and tax, late interest, and even provisions as numbers.