# Auto Repay

Auto repay is Metronome’s version of unlooping a position, enabling users to repay with ease. If a user wants to unloop their position, they can input the number of collateral assets they intend to use for repayment (the corresponding dollar value is displayed). Upon doig so, users will be shown their anticipated collateral ratio after repayment, as well as an approximation of how many synths will be bought back for the repayment process. Once users confirm by clicking the "Repay" button, a transaction will be executed and then confirmed in the users wallet with the newly updated position displayed.&#x20;

#### Example:

1. User navigates to the Metronome Smart Farming platform.
2. User selects vaUSDC as their preferred collateral.
3. The user's vaUSDC position is looped according to the users preference.
4. When the user decides to unloop (auto repay) their position, the user will retains their vaUSDC tokens within the Metronome platform.

Additionally, if a user deposits naked collateral (i.e. USDC) for use in Smart Farming, the contract will deposit the user's USDC into Vesper, generating vaUSDC. Upon unlooping, this can easily be converted back to the original USDC position via the Vesper pools on Metronome, or by visiting the Vesper app.

#### The smart contract manages the following steps:

1. Exchanges the user’s collateral for the necessary synth amount.
2. Uses the exchanged synth to repay the users outstanding assets.
3. Cancels the transaction if the exchanged synth amount exceeds the user’s total outstanding amount.
4. Confirms the user’s account is healthy after the swap.

***Note:** Any user that has generated synthetic assets can use the auto repay functionality.*

**You can perform Auto Repay by doing the following:**

1\. Navigate to the [Metronome](https://app.metronome.io/op) application.

2\. Hover over your chosen synth asset and click “Repay”.

<figure><img src="https://570996971-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJxkFvNxIjd0Pv-NrbL%2Fuploads%2FXiYUhDmMaKcI9NQdvCOA%2F1.png?alt=media&#x26;token=6f8a78c5-4f3d-49df-91b2-fcf3d78bc329" alt=""><figcaption></figcaption></figure>

3. Next, select how you would like to repay, in this case, we will be using “Auto Repay”.

<figure><img src="https://570996971-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJxkFvNxIjd0Pv-NrbL%2Fuploads%2FPOy3Mbm1DH3c1e8wIF0Z%2F2.png?alt=media&#x26;token=88f2f986-f5c7-4b43-9260-a3bd3b7e662c" alt=""><figcaption></figcaption></figure>

4. Here you will be able to see your outstanding position, choose your collateral, and set your slippage tolerance.

<figure><img src="https://570996971-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJxkFvNxIjd0Pv-NrbL%2Fuploads%2Fipv3ssjM2D3sbRiGcvJx%2F3.png?alt=media&#x26;token=36568e9c-44ee-4051-9a7a-804fb7c9da88" alt=""><figcaption></figcaption></figure>

5. Once you are comfortable, hit “Repay” and confirm the transaction.
6. Now you will be able to see your updated stats and health factor on the dashboard.


---

# 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.metronome.io/smart-farming/auto-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.
