> For the complete documentation index, see [llms.txt](https://constant-finance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://constant-finance.gitbook.io/docs/introduction/concepts/repayment-and-fifo-settlement.md).

# Repayment and FIFO Settlement

Borrowers do not have to keep a Constant Finance loan open until maturity. They may repay earlier and pay interest only for the time and principal they actually use.

To understand repayment, it helps to separate three questions:

1. How much does the borrower owe?
2. How does a payment reduce that debt?
3. When does a Constant NFT owner receive the settled funds?

## Fixed-Rate Accrual

Borrower and supplier unit rates are fixed when the Position opens. Interest then accrues over elapsed time on the principal that remains outstanding. Unpaid interest does not itself generate additional interest.

After a partial principal repayment, future interest accrues on the lower balance. A full repayment closes the Position and stops any future accrual.

The borrower and supplier rates are both fixed, but they are not the same. Their difference is the protocol revenue defined by the configured fee rate.

## Interest-First Payments

```mermaid
flowchart LR
    P[Borrower payment] --> I[Borrower interest due]
    I --> S[Supplier interest<br/>to escrow]
    I --> F[Protocol fee]
    S --> R[Remaining payment]
    F --> R
    R --> Q[Principal<br/>FIFO reduction]
```

For each debt asset, a payment is applied in the following order:

1. Cover the borrower interest accrued so far.
2. Fund the corresponding supplier interest in Constant NFT escrow.
3. Allocate the interest spread to protocol revenue.
4. Apply any amount left over to principal.

If the payment is smaller than the borrower interest currently due, no principal is reduced.

## Global Interest, Principal FIFO

Constant Finance uses **global interest-first settlement with principal FIFO**.

* Interest is assigned according to each Constant NFT's outstanding principal during the relevant period.
* Principal repayment is assigned to Constant NFTs in the order they were minted.
* The protocol does not run a separate interest-and-principal waterfall for each NFT.

This ordering affects future interest. Once an earlier NFT receives principal back, that amount stops earning interest. A later NFT may remain fully outstanding—and continue earning interest—for longer.

FIFO changes when each supplier receives principal. It does not change the total principal reduction charged to the borrower.

## Supplier Effects

| Event                   | Earlier FIFO NFT                          | Later FIFO NFT                               |
| ----------------------- | ----------------------------------------- | -------------------------------------------- |
| Interest-only payment   | Receives its proportional funded interest | Receives its proportional funded interest    |
| First principal payment | Principal is reduced first                | Principal may remain fully outstanding       |
| Later accrual           | Earns on its lower remaining principal    | Continues earning on its remaining principal |
| NFT transfer            | Keeps the same queue position             | Keeps the same queue position                |

Because queue position affects repayment timing, it is an economic property of the claim that suppliers and secondary buyers should understand.

## Escrow and Wallet Receipt

A repayment recorded for a Constant NFT is not yet a payment to the owner's wallet. Supplier principal and funded interest first move into Constant NFT escrow. A separate claim then transfers the available amount to the current owner.

This pull-based model keeps repayment accounting independent of NFT-owner behavior and spreads claims across separate transactions.

## Supply Order Capacity

When principal falls and the repayment is synchronized with the Gateway, protocol-level Supply Order capacity may become available again. Even then, three states remain separate:

* restored signed capacity;
* funds claimed into the supplier's wallet; and
* ERC-20 approval available for another settlement.

Restoring any one of these does not automatically restore the other two.
