Define the ledger account structure: for each customer deposit account create at minimum an asset account (customer deposit balance), an interest payable liability account (accrued but not yet credited interest), and an interest expense account; for fee-bearing products also create a fee receivable asset account and fee income revenue account
Implement a daily end-of-day accrual job: for each account calculate the day's interest accrual as (current balance * annual rate / 365); create a double-entry ledger transaction that debits the interest expense account and credits the interest payable liability account for the calculated accrual amount
At the interest posting date (typically monthly or per product terms), create a second journal entry that debits the interest payable liability and credits the customer deposit balance account, increasing the customer's principal balance by the accrued interest amount — this is the interest capitalization event
For fee accrual, follow the same pattern: daily accrual debits an accrued fee receivable and credits fee income; on the fee charge date create an entry debiting the customer deposit balance and crediting the accrued fee receivable to net out the accrual and record the actual deduction from principal
Ensure all accrual entries carry the accrual date (the economic date of the accrual) rather than the posting timestamp in the ledger transaction effective date field, so month-end trial balance calculations are correct even if the batch job runs past midnight
Implement a reconciliation check after each accrual run: the sum of all interest payable liability balances should equal the total accrued-but-uncredited interest outstanding across all accounts; drift in this check indicates a missed accrual or an incorrect posting that needs correction
Known gotchas
Day-count convention matters for interest calculations: some deposit products use actual/365, others actual/360, and some use 30/360; using the wrong convention produces small daily errors that compound into material discrepancies at month-end, particularly for large balances or high rates
If the accrual batch job fails mid-run and must be restarted, naive re-execution will create duplicate accrual entries for accounts already processed — accrual jobs must be idempotent, using the ledger account and effective date as a composite key to detect and skip already-posted accruals
Leap year (366 days) changes the daily rate divisor from 365 to 366 for actual/365 products; products using a fixed 365-day divisor will slightly over-accrue in leap years and products using actual/actual must switch divisors precisely at year boundary — both require explicit handling in the accrual calculation
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp