# Monetary Circuit Model/Interest

In this lesson, we will add the payment of interest on loans and deposits, as well as spending by banks.

## Interest on loans

```# Interest rate on loans (5%)
irl = 0.05
# Bank consumption rate
bcr = 1.0

interest = irl * fl
compound = irl * fl
bankcons = bcr * bt
```

Interest is paid by firms from their deposit account into the bank's transaction account. Like the real world, banks spend from their income earned through interest payments and are not allowed to spend directly from the bank vault. Bank consumption (bankcons) is a function of the bank traactions account, and is paid to firms. Banks also employ workers, though modeling this is left as an exercise (it does not significantly impact the results).

```# ODE system
des = [
diff(bv, t) == repay - lend,
diff(bt, t) == interest - bankcons,
diff(fl, t) == lend - repay - interest + compound,
diff(fd, t) == lend - repay + cons - wages + bankcons - interest,
diff(wd, t) == wages - cons
]
```

Interest payment is counted as a type of repayment, and therefore diminishes the level of debt. We also include compounding of debt, which adds to the level of firm debt. The overall effect is no change in debt due to interest payments. We include payment of interest and compounding of debt in firm debt (fl) because they are not necessarily the same. It is possible for firms to not make interest payments (which are effectively a minimum repayment) and instead let the level of debt accumulate.

The result looks like this:

Bank savings in their transaction account are earned largely at the expense of firms, which incur a higher level of debt relative to savings. This is somewhat offset by interest paid on deposits.

## Interest on deposits

Interest is earned on deposits by workers and firms at a rate, ird, which is less than the rate payed on loans. The difference between the two rates is called the spread and is the means by which banks earn revenue.

The code for interest on deposits looks like this:

```# Interest rate on deposits (2%)
ird = 0.02

# Firm interest on deposits
fidep = ird * fd
# Worker interest on deposits
widep = ird * wd

# ODE system
des = [
diff(bv, t) == repay - lend,
diff(bt, t) == interest - bankcons - fidep - widep,
diff(fl, t) == lend - repay - interest + compound,
diff(fd, t) == lend - repay + cons - wages + bankcons + fidep - interest,
diff(wd, t) == wages - cons + widep
]
```

The result partially offsets the loss of savings due to interest payments and decreases bank transaction savings, though the result is not qualitatively different.

This completes the flow of funds in the simple monetary circuit model. In the next lesson, we will use the model we have built so far to determine the distribution of income in our simple economy.