Exiting Early

When you lend at a fixed rate with fCash, you know exactly how much interest you will receive at maturity. But what happens if you exit early? How much interest will you get if you sell your fCash before it matures?
To understand what you will get if you exit early, you need to understand how fCash accrues interest.

fCash interest accrual

As you approach maturity, the fCash/cash exchange rate approaches 1. This means that as time goes on, fCash increases in value. Here is how to determine the cash value of fCash given a fCashAmount, an interestRate, and a timeToMaturity.
cash=fCashAmount/einterestRatetimeToMaturitycash = fCashAmount/ e^{interestRate * timeToMaturity}
For example, with interest rates at 5%, 100 fCash is worth more if the time to maturity is six months than if the time to maturity is one year:
// 100 fCash value at one year to maturity with 5% interest rate
cash = 100 / e^(.05 * 1) = 95.12
// 100 fCash value at six months to maturity with 5% interest rate
cash = 100 / e^(.05 * .5) = 97.53
In this example, 100 fCash is worth 2.41 more cash after six months. This extra value is the interest that the fCash has accrued over the six month period.

Early exit example

Let's look at an example that includes transaction cost where a user lends 1000 USDC at 3.75% for one year and then exits after six months with the interest rate unchanged at 3.75%.
// Lending 1000 USDC at 3.75% for one year with 0.3% transaction fee
fCash = 1000 * e^(.0345 * 1) = 1035.10 fCash
// Selling 1035.10 fCash after six months at 3.75% and 0.3% fee
cash = 1035.10 / e^(.0405 * 0.5) = 1014.35
In this example, the user has earned 14.35 USDC after six months accounting for fees.

Impact of fees

Users who exit early can lose money if they don't hold their position long enough to cover their transaction cost. For example, here is what would happen if a user lent 1000 USDC for 1 year and then immediately exited on the same day.
// Lending 1000 USDC at 3.75% for one year with 0.3% transaction fee
fCash = 1000 * e^(.0345 * 1) = 1035.10 fCash
// Selling 1035.10 fCash immediately with interest rate at 3.75% and 0.3% fee
cash = 1035.10 / e^(.0405 * 1) = 994.02
In this example, the user lost 5.98 USDC because they paid transaction fees on entry and exit without accruing any interest.