# Repayment

<figure><img src="/files/ZUL2Epn8BYIcxoHdLkt7" alt=""><figcaption><p>Repayment Flow</p></figcaption></figure>

### **Repayment**

1. **Locate the Loan:** Before the maturity date, borrowers can find the "Repay" button next to the associated loan in the **Wallets -> Liability (Borrower)** tab.
2. **Maturity Time:** The exact maturity time is 00:00 on the maturity date plus one day, coordinated in UTC+0. For example, if the maturity date is January 30, 2025, the maturity time is 00:00 on January 31, 2025, UTC+0.
3. **Repayment Process:**
   * **Before Maturity:** Borrowers can repay their loans at any time before maturity by following these steps:
     1. Approve the transfer of debt to the lender
     2. Call the smart contract to execute the transaction
   * **After Maturity:** If the loan is not repaid before maturity, the liquidation process will be automatically triggered.
4. **Smart Contract Execution:** When the borrower initiates repayment, the smart contract:
   * Transfers the debt (principal plus accrued interest) from the borrower to the lender
   * Transfers the collateral from the lender's wallet back to the borrower's wallet
5. **Collateral Return:** The collateral return is executed automatically by the smart contract based on the lender's pre-approval that was provided during the loan creation. The borrower does not need to wait for manual action from the lender to receive their collateral back.
6. **Transaction Monitoring:** The borrower can monitor the status of the repayment and collateral transfer transactions in the **Transfers** page.

<figure><img src="/files/XQFGrKFzK9KA0qLDtJfE" alt=""><figcaption><p>The Borrower Clicks Repay to Initiate Repayment Transactions</p></figcaption></figure>

<figure><img src="/files/prILJ9wkpqrFhXYAUviD" alt=""><figcaption><p>The Lender Transfers Collateral to the Borrower After Receiving the Repayment</p></figcaption></figure>

### **Important Notes**

* The smart contract ensures that the collateral is only returned to the borrower after confirming the full repayment has been made.
* The peer-to-peer nature of the repayment process means assets move directly between user wallets, not through an intermediary.
* The TSI system sends reminder notifications to borrowers as the maturity date approaches to help them avoid late repayments.
* If the borrower fails to repay by maturity, the liquidation process will be triggered automatically to protect the lender's interests.
* If any issues arise during the repayment process, users should contact TSI support for assistance.


---

# Agent Instructions: 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:

```
GET https://tsi-docs.tkmatrix.com/defi-mode-overview/repayment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
