> For the complete documentation index, see [llms.txt](https://tectonic.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tectonic.gitbook.io/docs/protocol/leverage-management-tools/collateral-swap.md).

# Collateral Swap

If a user wants to switch out his collateral with another asset, he has to manually repay his debt, remove his supplied asset and supply another one. The “Collateral swap” feature allows users to complete this move in a single transaction.

Users can swap out using any asset available for collateral on Tectonic. This function is also important from a user’s perspective with regards to risk management. For example, if collateral token A price is declining rapidly, a user can quickly switch it to collateral token B in order to avoid getting liquidated. This also benefits Tectonic as it could help lower the probability of inheriting bad debt.

How Collateral Swap works:

**Step 1:** User confirms to swap collateral token A with new collateral token B

**Step 2:** On the backend, Tectonic will burn the user's tToken A to return the underlying token A. No liquidity check conducted at this point

**Step 3:** Token A will then be swapped for Token B on the integrated DEX (currently VVS Finance)

**Step 4**: This newly swapped Token B will be used to mint tToken B, and used as the new replacement collateral

**Step 5:** Liquidity check is conducted

<br>


---

# 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://tectonic.gitbook.io/docs/protocol/leverage-management-tools/collateral-swap.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.
