# Repay

Users can easily **repay** their loans and accrued interest through the dApp. Loans and any accrued debt must be repaid back with the same asset that was borrowed.

Repaying a loan improves the Health Factor of a user's portfolio. Decreasing the likelihood of liquidation and/or improving the borrow eligibility. After repaying, a user can chose to withdraw the supplied assets partially or fully as long as there is no outstanding loan.

{% hint style="warning" %}
There is no fixed time to repay a loan, as long as your Health Factor remains above 1.
{% endhint %}

### Learn more

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th data-hidden></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>For users</strong></td><td>How to <strong>repay</strong> your loan from any chain.</td><td></td><td><a href="/files/YNBTC7LlwTCF5Ztytv8n">/files/YNBTC7LlwTCF5Ztytv8n</a></td><td><a href="/pages/skqinmS2OSNuFtP8oDb1">/pages/skqinmS2OSNuFtP8oDb1</a></td></tr><tr><td><strong>For devs</strong></td><td>How to <strong>repay</strong> your loan using code.</td><td></td><td><a href="/files/3Cjpdx7Vs8TPI0WYqKyy">/files/3Cjpdx7Vs8TPI0WYqKyy</a></td><td><a href="/pages/wrPnNP6i1a6EAiPnAzhU">/pages/wrPnNP6i1a6EAiPnAzhU</a></td></tr></tbody></table>

***

## Repay architecture

Repaying debt positions in a cross-chain domain is slightly different to a single chain counterpart. If the borrow transaction are on Repletes pool chain, repaying the loan functions similar to a chain isolated money market.

For cross-chain however, a user may find themselves that payments of loans vary slightly depending on the asset that was borrowed. For assets requiring bridging, for example, a user depositing excess tokens (i.e. due to slippage), the standard course of action after settling the debt is to provide the surplus as liquidity to the protocol. This is similar for assets that follow a omnichain token standard.

<figure><img src="/files/FsWc1tgZQb8cgTXN91zF" alt=""><figcaption><p>Example of how excess tokens are supplied to the protocol, enabling users to accrue interest.</p></figcaption></figure>

A user can decide in a follow-up transaction where to withdraw the surplus while accruing in the meantime interest for the supplied excess assets.

{% hint style="info" %}
Note that withdraws can affect your Health Factor for outstanding loans.
{% endhint %}

### Learn about

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Withdraw</strong></td><td>Learn more about withdrawing to any chain.</td><td></td><td><a href="/files/3WuwSgKANkCbCuXhuYDa">/files/3WuwSgKANkCbCuXhuYDa</a></td><td><a href="/pages/YpsOIcblHKHDAjoedHrP">/pages/YpsOIcblHKHDAjoedHrP</a></td></tr><tr><td><strong>Borrow</strong></td><td>Learn more about borrowing to any chain.</td><td></td><td><a href="/files/6bXwEbhcSeuSzr22r64V">/files/6bXwEbhcSeuSzr22r64V</a></td><td><a href="/pages/hdffH1MijvSKXSTmoOaB">/pages/hdffH1MijvSKXSTmoOaB</a></td></tr><tr><td><strong>Supply</strong></td><td>Learn more about supplying from any chain.</td><td></td><td><a href="/files/3WdrNHdNCEPUhof1rECz">/files/3WdrNHdNCEPUhof1rECz</a></td><td><a href="/pages/FjR6Uc1Bd8QRSluPrLTb">/pages/FjR6Uc1Bd8QRSluPrLTb</a></td></tr></tbody></table>


---

# 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://docs.replete.fi/core-functions/repay.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.
