> 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/overview.md).

# Overview

Constant Finance is a non-custodial, peer-to-peer lending protocol built around a simple promise: **Fixed Rate, Flexible Duration**.

Borrowers and suppliers sign the terms they are willing to accept offchain. When those terms are compatible, Constant Finance validates the Orders and settles the match onchain in a single transaction. The result is an isolated **Position** for the borrower and one or more transferable **Constant NFTs** for the suppliers.

The Position holds the collateral and records the debt. Each Constant NFT represents a supplier's claim on principal and funded interest.

{% hint style="info" %}
**Non-custodial does not mean that collateral stays in the borrower's wallet after settlement.** Once a Position opens, its collateral is held by the Position contract and can move only according to the protocol's onchain rules.
{% endhint %}

## Why Constant Finance

Constant Finance combines three properties that are often separated in onchain credit markets:

* **Fixed rate:** borrower and supplier unit rates are set when the Position opens, so the price of the loan does not change with a variable-rate pool.
* **Flexible duration:** the Position has a fixed maturity, but the borrower may repay early and pays interest only while principal remains outstanding.
* **Just-in-Time liquidity:** supplier assets remain in the supplier's wallet until an Order is matched and settled.

This design gives borrowers predictable pricing while preserving the option to repay early. Suppliers receive a known unit rate, while accepting that early repayment may shorten the realized lending period and reduce total interest.

If a borrower later wants a different rate, maturity, or collateral arrangement, the original agreement is not edited. Instead, refinancing settles the old Position and opens a new one atomically.

## Who Uses the Protocol

| Participant              | Role in the protocol                                 | What they receive                                  | Main responsibility                                                         |
| ------------------------ | ---------------------------------------------------- | -------------------------------------------------- | --------------------------------------------------------------------------- |
| Borrower                 | Signs borrowing terms and provides collateral        | Borrowed assets at a fixed rate and fixed maturity | Keep the Position sufficiently collateralized and repay the debt            |
| Supplier                 | Signs supply terms and provides assets at settlement | A transferable Constant NFT claim                  | Keep enough balance and Gateway approval available until settlement         |
| Matcher                  | Finds and combines compatible Orders offchain        | A combination ready for onchain validation         | Keep every fill within the limits signed by both sides                      |
| Create Position Executor | Submits a matched set of Orders onchain              | Atomic validation and Position creation            | Submit combinations that remain executable under current onchain conditions |
| Liquidator               | Repays debt for an eligible Position                 | Collateral permitted by the liquidation rules      | Return enough debt assets to satisfy the Position's final checks            |
| Constant NFT holder      | Owns a supplier claim                                | Claimable principal and funded interest            | Claim settled funds from the Constant NFT escrow                            |

## The Protocol at a Glance

```mermaid
flowchart LR
    SO[Supplier<br/>Supply Orders] --> M[Match]
    BO[Borrower<br/>Borrow Order] --> M
    M --> G[Gateway<br/>validation and settlement]
    G --> P[Position<br/>debt and collateral]
    G --> N[Constant NFTs<br/>supplier claims]
    P --> L[Repay, refinance,<br/>or liquidate]
    L --> N
```

Before settlement, Orders are signed instructions—not deposits or active loans. At settlement, the Gateway verifies the terms, transfers the required assets, creates the Position, and mints a Constant NFT for every non-zero supplier fill. If any required check or transfer fails, the whole transaction reverts.

## Key Terms

| Term                     | Category                   | Plain-English definition                                                                                                              | Key boundary                                                                                     |
| ------------------------ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| Borrower                 | Participant                | The account that signs borrowing terms, provides collateral, and owes the Position debt.                                              | The borrower controls the loan request but cannot rewrite settled supplier claims.               |
| Supplier                 | Participant                | The account that signs an offer to provide a debt asset under specified terms.                                                        | Signing an Order does not deposit or lock funds.                                                 |
| Matcher                  | Participant                | An offchain service or actor that finds compatible borrower and supplier Orders.                                                      | A matcher can combine Orders but cannot change their signed limits.                              |
| Create Position Executor | Participant                | An authorized account that submits matched Orders to the Gateway.                                                                     | Permission to submit does not bypass signature, balance, approval, collateral, or health checks. |
| Liquidator               | Participant                | An external actor that settles debt for a Position that is unhealthy or past maturity.                                                | The liquidator must satisfy the Position's liquidation limits and repayment checks.              |
| Order                    | Pre-settlement object      | A signed authorization that describes acceptable transaction terms.                                                                   | An Order creates neither debt nor a claim until settlement succeeds.                             |
| Supply Order             | Pre-settlement object      | A supplier's offer covering an asset, available capacity, minimum rate, term, expiry, and owner.                                      | Order capacity, wallet balance, and token approval are separate states.                          |
| Borrow Order             | Pre-settlement object      | A borrower's request covering the debt asset, amount, rate, term, expiry, collateral, owner, and fee field.                           | The requested loan exists only after a successful onchain match.                                 |
| Refinancing Order        | Pre-settlement object      | A borrower's request to replace an existing Position with a new one under new terms.                                                  | It does not modify the old Position in place.                                                    |
| Match                    | Settlement concept         | A compatible combination of one Borrow Order and one or more Supply Orders.                                                           | Offchain compatibility does not guarantee execution if onchain conditions change.                |
| Fill                     | Settlement concept         | The portion of a Supply Order used in a particular match.                                                                             | A partial fill consumes only the corresponding part of the signed capacity.                      |
| Just-in-Time liquidity   | Design concept             | Supplier assets are transferred only when a match is executed.                                                                        | Funds can be used elsewhere before settlement, so balance or approval may become insufficient.   |
| Gateway                  | Protocol entry             | The onchain entry point that verifies requests and routes active protocol operations.                                                 | The current Sepolia Gateway exposes the Basic and Refinance paths described in this guide.       |
| Router                   | Protocol component         | A module behind the Gateway that implements a product flow.                                                                           | A Router contains execution logic; it is not the permanent loan record.                          |
| Position Builder         | Protocol component         | The factory that creates isolated Positions and their supplier claims.                                                                | Changing its default Config affects future Positions, not existing ones.                         |
| Config                   | Protocol component         | The fixed set of collateral, liquidation, and fee parameters bound to a Position when it is created.                                  | Positions created at different times may use different Config addresses.                         |
| Oracle                   | Protocol dependency        | The price system used to value debt assets, ERC-20 collateral, and supported LP NFT collateral.                                       | Oracle quality and configuration directly affect Position health.                                |
| Position                 | Post-settlement object     | An isolated contract that holds collateral and records one borrower's debt, maturity, rates, risk configuration, and lifecycle state. | Its accounting does not merge with another Position.                                             |
| Basic Position           | User-facing position label | A Position opened through the standard Supply Order and Borrow Order flow.                                                            | It describes how the Position was opened, not a separate Position contract type.                 |
| Refinanced Position      | User-facing position label | The new Position created while an old Position is settled atomically.                                                                 | It uses the same core Position model as a Basic Position.                                        |
| Constant NFT             | Post-settlement object     | A transferable supplier claim created for one non-zero supply fill.                                                                   | It is a claim on debt repayment, not ownership of borrower collateral.                           |
| Collateral               | Risk object                | ERC-20 assets or supported Uniswap V3 LP NFTs locked in a Position to secure its debt.                                                | Collateral can be removed only when the Position rules allow it.                                 |
| Debt asset               | Accounting object          | A token borrowed by the borrower and owed by the Position.                                                                            | Debt value includes remaining principal and accrued borrower interest.                           |
| Debt bucket              | Accounting object          | The Position's combined accounting for one debt asset.                                                                                | Several Constant NFTs may share the same debt bucket.                                            |
| Borrower rate            | Pricing term               | The fixed unit rate used to calculate borrower interest for a debt asset.                                                             | The rate is fixed, but total interest still depends on time and outstanding principal.           |
| Supplier rate            | Pricing term               | The fixed unit rate used to calculate supplier interest after the protocol spread.                                                    | It is different from the borrower rate.                                                          |
| Maturity                 | Lifecycle term             | The final timestamp agreed when the Position opens.                                                                                   | Maturity does not erase unpaid debt; debt remaining afterward makes the Position liquidatable.   |
| Repayment escrow         | Settlement object          | Funds recorded for Constant NFT holders after a borrower repayment.                                                                   | The funds reach a holder's wallet only after a claim.                                            |
| Claim                    | Settlement action          | The action that pays available escrowed principal and interest to the current Constant NFT owner.                                     | The caller cannot redirect the payment to another account.                                       |
| FIFO principal repayment | Accounting rule            | Principal is returned to Constant NFTs in the order they were minted.                                                                 | FIFO changes supplier repayment timing, not the borrower's total principal reduction.            |
| Position health          | Risk concept               | The relationship between current debt value and the risk-adjusted value of collateral.                                                | Health changes with prices, accrued interest, repayments, and collateral changes.                |
| LTV                      | Risk parameter             | A stored collateral ratio intended to describe an opening-borrow boundary.                                                            | The current Position path does not enforce it as a separate opening limit.                       |
| Liquidation threshold    | Risk parameter             | The share of collateral value that supports debt before a Position becomes unhealthy.                                                 | The effective threshold is weighted across all collateral in the Position.                       |
| Liquidation bonus        | Risk parameter             | Additional collateral value permitted as compensation for a liquidator.                                                               | It is not interest paid to suppliers.                                                            |
| Protocol fee rate        | Pricing parameter          | The share of the borrower unit rate retained as protocol spread.                                                                      | It is not a standalone annual borrowing rate.                                                    |
| Refinance                | Lifecycle action           | The atomic settlement of an old Position and origination of a new one under newly signed terms.                                       | Old and new claims remain separate.                                                              |
| Liquidation              | Lifecycle action           | Permissionless debt settlement in exchange for eligible collateral after a Position becomes liquidatable.                             | The Position performs the final eligibility, collateral, and repayment checks.                   |

## Where to Go Next

* Continue to [Concepts](/docs/v0/concepts.md) to follow the full loan lifecycle.
* Visit [Ethereum Sepolia](/docs/v0/deployment/ethereum-sepolia.md) for the current public testnet deployment.
* Review [Risk Configuration](/docs/v0/deployment/risk-configuration.md) for the parameters applied to new Sepolia Positions.


---

# 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/overview.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.
