# Deposit collateral

The collateral serves as insurance for orders. By requiring Resolvers to deposit collateral, the system ensures there is an additional layer of security protecting Users' funds. If the Resolver fails to process a transaction correctly, liquidators will still execute the order due to the presence of collateral.

<figure><img src="/files/UlTY1SVFFI2BR7QfjURg" alt="" width="375"><figcaption><p>Collateral deposit overview</p></figcaption></figure>

1. Before the Resolver can begin processing transactions, the Resolver is required to deposit authorized ERC-20 stable tokens into the `CollateralManager` smart contract. It is deposited for a specific 'receive' chain.
2. Once the `CollateralManager` receives the Resolver's collateral deposit, it updates its records. The `CollateralManager` maintains records of the total collateral amount it is holding and the amount of collateral not currently in use (known as the "unlocked" collateral amount).
3. With each new deposit from the Resolver, the `CollateralManager` updates its records, increasing the total collateral amount by the new deposit's amount.

Both chains (collateral chain and receive chain) keep track of collateral usage:

* `locked` counter in the receive chain: increased by collateral amount specified in the executed order. Order must not be executed if the locked amount exceeds the unlocked amount submitted in the order by the user and confirmed by their signature;
* `unlocked` counter in the collateral chain: increased each time successful order execution is confirmed by Resolvers by providing corresponding proofs.


---

# 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.kinetex.io/flash-trade-protocol/collateral/deposit-collateral.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.
