# Repaying

The repayment process involves the return of the borrowed asset and the corresponding release of the collateral asset. The protocol checks the debt NFT associated with the debt and retrieves the following information:

* **ID**: The unique identifier for the debt NFT
* **Collateral Size**: The amount of collateral provided during borrowing.
* **Borrow Price**: The price at which the asset was borrowed
* **Borrow Type**: Indicates whether the borrowing occurred above or below the active market price.

### Example 1: Repaying Debt Borrowed Below Market Price

* The contract checks the debt NFT data which includes:
  * ID: 12345
  * Collateral Value: 1 NAD
  * Borrow Price: 1000 USDC
* Repay Fee: 0.03% as an example&#x20;
* To Repay: 1000.3 USDC = $$(\text {collateral size} \times \text {borrow price})+\text{repay fee}$$

### Example 2: Repaying Debt Borrowed Above the Market Price

* The contract checks the debt NFT data which includes:
  * ID: 67890
  * Collateral size: 1000 USDC
  * Borrow Price: 2250 USDC
* Repay Fee: 0.11% as an example
* To Repay: 0.449 NAD =$$(\dfrac {\text{collateral size}} {\text{borrow price}})+\text{repay fee}$$

{% hint style="success" %}
Repayment is restricted for debts that are either  [<mark style="color:purple;">blacklisted or inactive</mark>](https://nitro-finance.gitbook.io/ftl/core-interactions/debt-recovery):

* **Blacklisted Debts**: Expired debts absorbed into the protocol and no longer repayable.
* **Inactive Debts**: Temporarily locked due to price crossover with the active market price
  {% endhint %}

### REPAY ARCHITECTURE

<figure><img src="https://1590734653-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUz9H2yEvvJUXv6c07FqW%2Fuploads%2FgX8101JqKas2QJYR78s0%2FRepay%20Architecture%201.svg?alt=media&#x26;token=549178e7-30f3-43b5-b3b8-c730c4aeeee2" alt=""><figcaption></figcaption></figure>
