# Liquidation

In a swap, both parties post collateral to guarantee they can pay the obligations from their side of the trade. To protect against volatility, each party must post slightly more than their maximum expected potential payment. This amount is in part determined by the liquidation threshold which is an immutable parameter set for each market. For example, if you might owe up to $5,000 on a swap (in the event you're on the losing side), you'd need to post about $5,263 in collateral ($5,000 divided by a liquidation threshold of 0.95). This extra buffer creates a safety margin for the protocol.

If market conditions move against you or the LP counterparty, and the actual net obligation approaches the posted collateral, the position becomes "liquidatable." For now, only approved LPs can trigger a liquidation although this will change in the future so that anyone will be able to call liquidation. Calling liquidation successfully will close the swap and transfer all of the swap collateral, minus a liquidation penalty that is paid to the liquidation caller, from the liquidated party to the other party on the trade. This means if you get liquidated right at the threshold, you'd lose the extra \~5% buffer (in our example, losing $5,263 when you only owed $5,000). This penalty serves two purposes: it compensates the counterparty for taking on risk and provides a safety margin that protects the protocol from positions becoming under-collateralized. Importantly, this works symmetrically—both the buyer and the pool face the same liquidation penalty if their position goes underwater, making the system fair to all participants.


---

# 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.kairosswap.com/how-tos/liquidation.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.
