---
title: Indices
slug: indices
icon: 🔨
docTags: 
createdAt: 2022-07-05T19:15:57.000Z
---

Kord.Fi Lending Contracts use three following indices: `deposit_index `, `net_credit_index` and `gross_credit_index`.

- `deposit_index `– is an index that shows the growth of deposits by Lenders;
-  `gross_credit_index` – index that tracks the growth of Farmers’ total debt;
-  `net_credit_index` – supplementary index, that indicates the growth of the Farmers' debt portion that is directly owed to Lenders.

Each one of these three indices is calculated in a similar piecewise-linear manner according to a formula:

:::CodeblockTabs
Formulas

```none
i_n=i_p*(1+r_p*(t_n-t_p)), where

i_n - present value of an index
i_p - its previous value
t_n - present timestamp
t_p - last index refresh timestamp
r_p - interest rate at a certain timestamp
```
:::

Therefore, a regular update of these indices is required to limit their maximum values and thus the error compared to the “fair” operation of taking them to the nth power.
Since we are dealing with fixed arithmetic operations it is necessary to specify the rounding type: **net\_credit\_index** and **gross\_credit\_index** are rounded above, while **deposit\_index** is rounded below
Thus, conceptually the only difference between the way these indices are calculated is the interest rate type we use for each one of them:

| **Index&#x20;**      | **Variable used in its computation** |
| -------------------- | ------------------------------------ |
| gross\_credit\_index | gross\_credit\_rate                  |
| net\_credit\_index   | net\_credit\_rate                    |
| deposit\_index       | deposit\_rate                        |

Each successive rate is calculated based on its previous value:

:::CodeblockTabs
Formulas

```none
net_credit_rate = gross_credit_rate * 9/10
deposit_rate = net_credit_rate * utilization
```
:::

If contract is powered down (`is_working`=False) **net\_credit\_rate** and **deposit\_rate** are automatically assigned values of zero.

