Daily interest for a savings account app
Your task
Your fintech app offers a savings account to 300,000 customers. Every balance change is a row in a ledger table, stamped with the time it posted. Money moves in and out at any hour, about 50,000 transfers a day.
Interest is worked out on each account's balance at midnight New York time, every day. A day earns that balance times the yearly rate, divided by 365. The rate is 4.1% today, and it can change on any date. On the 1st of each month, the account is paid the month's daily amounts added up and rounded to the nearest cent.
Customers can see the interest earned so far this month. A regulator can ask how any month's payment was worked out, day by day. Jobs sometimes fail partway and are run again.
What does the daily job write, and how does the job on the 1st turn that into a payment?
It covers
- Rounding
- Daily batch
- As of balance