# Interest Calculations for Deposit Products

### Introduction

Interest is calculated on savings accounts in LMS based on options set when creating the savings product. The administrator can set the frequency of interest calculation and posting on each savings product to configure how often interest is posted to a savings account. The start date for interest calculation and posting, and the reference for the time period is the start of the fiscal year. Interest is posted on the last day of the time period (as per the frequency of interest posting to accounts).

### Definitions

* **Active account** = the account with status as active
* **Time period of interest calculation** = the period of time over which the interest is being calculated. For example, if time period for interest calculation is 1 day, interest for the account is being calculated per day. If time period for interest calculation is 1 month, the interest for the account is being calculated at the end of every month.
* **Frequency of interest posting** = when the interest is actually posted to the account (and can be seen in the UI). For example, if frequency of interest posting is 1 month (and time period for interest calculation is per day), even though the interest is calculated daily, the interest is not actually posted to the account until the end of the month.
* **Fiscal year** = 12 month period that we use to determine interest calculation and interest posting. Currently these periods are calculated from the beginning of the fiscal year.
  * In LMS, Fiscal Year is hard-coded. First day is January 1st and the last day is December 31st.
* **Deposit** = money added to an account.
* **Withdrawal** = money deducted from an account.
* When referring to deposits and withdrawals, it is from the whole day's worth when talking in relation to calculations.
  * For example, if you deposit $10 and withdraw $20 on the same day, in calculations, it is considered a $10 withdrawal that day.

### Formula

For one period interest calculation: A = P(1+r/n)

where:

&#x20;       P = *principal amount (initial amount)*

r = *annual rate of interest (as a decimal)*

A = *amount of money accumulated (including interest)*

n = *number of times the interest is compounded per year*

Periodic intervals: can be set by number of days or months.

#### Average Balance:

The average balance is the average of all the daily balances for that interest calculation period.

A = P(1+(r/n))

A = 1200(1+(.08/4))

### Requirements and Calculations

**General Interest Calculation and Posting Requirements**

TBD

**Interest Calculation and Interest Posting**

See Savings Interest Calculation and Posting for more information.

**Rounding and Precision**

* Configuration Options DigitsAfterDecimal  and CurrencyRoundingMode  are used to set the precision of values in LMS DB and UI&#x20;
* Each interest calculation period, LMS rounds to precision set in Configuration Settings and stores this value in DB, and subsequently displays in UI when interest is posted. Extra precision is not saved. DB and UI values match.
* Caveats - In cases of extremely small balances or low interest rates, this could amount to 0 interest earned depending on precision set in DigitsAfterDecimal.
* Examples:

| CurrencyRoundingMode | DigitsAfterDecimal | Annual Interest Rate | Minimum Balance |
| -------------------- | ------------------ | -------------------- | --------------- |
| HALF\_UP             | 1                  | <= 1%                | <=60            |
| CEILING              | 1                  |                      |                 |
| FLOOR                | 1                  |                      |                 |
|                      | 2                  | <= 1%                | <=5             |
|                      | 2                  |                      |                 |
|                      | 2                  |                      |                 |

Related articles
