> For the complete documentation index, see [llms.txt](https://docs.ducatprotocol.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ducatprotocol.com/how-ducat-works/vaults/repaying-unit.md).

# Repaying UNIT

In a two-transaction process, the user returns some of their borrowed UNIT stablecoins to their vault. This reduction in debt lowers the Bitcoin price at which liquidation would be triggered, moving it further from the current price and giving the user a greater margin of safety.

The user initiates a transaction to repay their borrowed UNIT runes, sending them back to their vault UTXO as part of the transaction. The MPC network verifies the repayment amount and processes the return of UNIT runes. The transaction builder then constructs a PSBT that reduces the vault’s borrowed amount while maintaining the same BTC collateral. The output reflects the reduced debt and unchanged collateral in an updated vault UTXO.

In a second transaction, the new vault state is processed, paying the network fees for both transactions to ensure atomic execution. This generates an updated vault token reflecting the reduced borrowed amount and improved collateralisation ratio. The vault UTXO retains both the user update path and the guardian/oracle liquidation path, with the improved ratio reducing the likelihood of liquidation. An OP\_RETURN output records the updated vault state, including the reduced borrowed amount and revised collateralisation ratio.

Together with the Open Vault function, these processes form a complete vault management system, allowing users to borrow against, repay, and maintain their BTC-collateralised positions while ensuring proper record-keeping and risk controls throughout.

<figure><picture><source srcset="/files/mpwcooVyA22ksx70lnBk" media="(prefers-color-scheme: dark)"><img src="/files/9AE9FWrnQ3arfsp5P2Q2" alt=""></picture><figcaption><p>Repaying UNIT Transaction Diagram</p></figcaption></figure>


---

# 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://docs.ducatprotocol.com/how-ducat-works/vaults/repaying-unit.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.
