> For the complete documentation index, see [llms.txt](https://docs.ethosis.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ethosis.org/protocol/maturity-and-refinancing.md).

# Term end and rollover

A fixed-term loan carries a built-in hazard: the day it matures. A borrower who cannot pay on that day would normally lose collateral to liquidation even when the position is perfectly healthy. Ethosis removes that hazard with a rollover auction, a mechanism taken from Blend, which needs neither an oracle nor anyone's discretion.

## When the term ends

Reaching the loan's `maturity` timestamp opens a **grace window** lasting 24 hours. While the window is open:

* the borrower can repay in full and take the collateral back,
* interest keeps accruing at the slice APRs,
* health-factor liquidation stays available exactly as before.

If the window closes without full repayment the loan becomes **Defaulted**, and its collateral can be auctioned no matter what the health factor is. See [Loan health and collateral auctions](/protocol/health-and-liquidation.md).

## The rollover auction

Before maturity, the borrower (or a keeper acting for the borrower) can call `openRefinance(loanId)`. That opens an auction in which the rate climbs over time:

* The starting rate is the loan's current blended APR.
* From there it rises linearly toward a cap over a fixed duration. The cap is the current rate plus 400 basis points; the duration is four hours. Both numbers are PolicyController parameters.
* Any eligible lender can take the current rate for some or all of the principal by submitting a signed offer that meets it.
* Each acceptance is held in the auction contract at the rate that applied when it arrived, so different acceptors can lock in different rates.
* Once acceptances reach the coverage target (outstanding debt plus the refinance fee), the auction hands the USDG to LoanDesk, which pays off the old slices in full (principal plus accrued interest, with the interest share deducted), burns the outgoing slice tokens and issues new ones. The collateral stays in escrow the whole time.
* The new loan carries the same term length, counted afresh from the clearing block, and a principal equal to the old debt plus the refinance fee. Both the interest and the fee are rolled into the principal rather than paid from the borrower's wallet.
* If the health factor of the new loan would be under 1.0, clearing reverts.

Should the auction run out of time without reaching coverage, anyone can call `fail`: acceptors get their USDG back, the loan is marked **Defaulted** and the collateral becomes auctionable. The borrower may cancel an auction that has not yet received any acceptance.

```mermaid
sequenceDiagram
  participant Bo as Borrower
  participant LD as LoanDesk
  participant RA as RolloverAuction
  participant Out as Outgoing lenders
  participant In as Incoming lenders

  Bo->>RA: openRefinance(loanId)
  Note over RA: rate climbs from current APR toward the cap
  In->>RA: accept(rate, amount, sig)
  RA->>LD: draw USDG from incoming lenders
  LD-->>Out: principal + interest, slice tokens burned
  LD-->>In: new slice tokens, term restarted
  Note over LD: collateral never leaves escrow
```

### No oracle required

All the auction has to discover is a rate at which somebody will carry the existing collateral position. When the collateral is sound, such a rate exists and is found in short order. When nobody will take the position at any rate up to the cap, that is the market's verdict, and the loan proceeds to liquidation. No price feed, keeper opinion or governance vote enters into the rollover decision.

### Who can accept

A lender already in the loan can accept their own rollover, and for a lender content with the position that is the usual outcome. Lenders can also authorise keepers to accept on their behalf up to a rate ceiling, so nobody has to sit and watch each maturity.

## Cost

A rollover carries a fee of 0.10% of principal, paid by the borrower. See [Fee schedule](/protocol/fees.md).

## A rollover in numbers

A 20,000 USDG loan at a blended 8.825% has three days left to run. The borrower opens a rollover auction with a cap of the current rate plus 400 bps over four hours. After forty minutes the rate stands at 9.4%, and at that point two of the existing lenders plus one newcomer accept for the whole 20,000. The outgoing slices are paid 27 days of interest, three new slice tokens are issued with a fresh 30-day term at 9.4%, and the borrower pays a 20 USDG refinance fee. The collateral did not move.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ethosis.org/protocol/maturity-and-refinancing.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
