> 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/v0/concepts/refinance.md).

# Refinance

Refinance lets a borrower replace an existing fixed-rate loan with a new one. Instead of editing the original rate, maturity, collateral, or supplier claims, the protocol settles the old Position and opens a new Position under newly signed terms.

## Why Refinance Creates a New Position

A Position's terms are fixed when it opens. Allowing one party to rewrite those terms later would weaken both the signed agreement and the value of transferable supplier claims.

Constant Finance therefore treats refinance as two linked outcomes:

* retire the old debt; and
* originate new debt under newly agreed terms.

## Required Intent and Liquidity

A refinance brings together:

* an existing Position;
* a Refinancing Order signed by that Position's borrower;
* new Supply Orders;
* a newly selected fixed rate and term; and
* the collateral arrangement for the new Position.

The new suppliers must have enough live liquidity to cover the old Position's remaining obligation. That amount includes both outstanding principal and borrower interest accrued up to the refinance transaction.

## Atomic Outcome

```mermaid
flowchart LR
    O[Old Position] --> X[Atomic refinance]
    B[Borrower<br/>Refinancing Order] --> X
    S[New Supply Orders] --> X
    X --> C[Old Position closed]
    X --> P[New Position opened]
    X --> E[Old supplier claims<br/>funded in escrow]
    X --> N[New Constant NFTs]
```

At a high level, one refinance transaction:

1. verifies that the borrower authorized the refinance of the old Position;
2. calculates the old Position's current repayment requirement;
3. matches new Supply Orders against the replacement terms;
4. moves the approved collateral into the new Position;
5. settles and closes the old Position; and
6. creates new Constant NFTs for the new supplier fills.

These steps are atomic. If old-debt settlement, new funding, collateral transfer, signature validation, or the new Position's health check fails, the entire transaction reverts.

## Rights Before and After Refinance

| Party or object   | Result                                                                                      |
| ----------------- | ------------------------------------------------------------------------------------------- |
| Borrower          | Continues with a new Position under the newly signed rate, term, and collateral arrangement |
| Old Position      | Is fully settled and closed                                                                 |
| Old Constant NFTs | Keep their claims on the old Position's settlement until those funds are claimed            |
| New suppliers     | Provide replacement funding and receive new Constant NFTs                                   |
| New Position      | Begins with new fixed terms and its own isolated accounting                                 |

Accrued borrower interest is not erased. It remains part of the amount required to settle the old Position and establish the new debt.

## What Refinance Does Not Do

Refinance does not:

* modify the old Position in place;
* force old suppliers to accept new terms;
* convert old Constant NFTs into new ones;
* move unclaimed old escrow into the new loan; or
* guarantee that a previously signed Supply Order still has enough live balance or approval.

An old supplier can also fund the new Position, but only through a valid new match backed by independently available assets and approval. Principal settled during the refinance is not automatically reused to fund that same transaction.


---

# 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://constant-finance.gitbook.io/docs/v0/concepts/refinance.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.
