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

# Liquidation

In a swap, both parties post collateral to guarantee they can pay the obligations from their side of the trade. The buyer's collateral is sized to cover the maximum payment they could owe over the term, calculated from the swap rate and the length of the swap — not from the notional amount.

On top of that collateral, the buyer prefunds a small **liquidation bounty** at the moment they open the swap. The bounty is a percentage of their required collateral, set per market by the `liquidationIncentive` parameter and capped at **5%**. So a buyer whose maximum payment obligation is $5,000 posts $5,000 in collateral plus a bounty of up to $250, for a total of up to $5,250 pulled from their wallet at entry (alongside the protocol fee).

**The bounty is refundable.** It's held separately from the collateral that backs your payments, and if your swap is never liquidated it comes back to you in full when the swap settles at expiry. You only forfeit it if you're actually liquidated.

### When does a position become liquidatable?

A position becomes liquidatable when one side's collateral can no longer cover the payment it **already owes** on accrued interest up to right now.

This is worth being precise about: liquidation is evaluated on **accrued** payments, not projected ones. Where the rate might go between now and expiry is irrelevant to whether you can be liquidated today. A swap is only liquidatable when one side's collateral is mathematically insufficient at this moment.

### Who can liquidate?

**Anyone.** Liquidation is permissionless — there is no whitelist and no privileged liquidator role. Whoever calls `liquidateSwap` on an underwater position becomes the liquidator and collects the reward.

Where that reward comes from depends on which side went underwater:

* **Buyer-side liquidation** — the liquidator receives the buyer's prefunded liquidation bounty.
* **Pool-side liquidation** — the liquidator receives `liquidationIncentive × poolCollateralBacking`, drawn from the LP collateral reserved for that swap.

At most one side is liquidated per call. The other side receives its normal settlement.

### What happens when you're liquidated

The swap closes immediately. Your remaining collateral, after the liquidator's reward is paid out, transfers to the counterparty. In the example above, being liquidated means losing the $250 bounty on top of settling what you owed.

Importantly, this works **symmetrically**. The LP pool faces liquidation on exactly the same terms as the buyer — if the pool's backing for a swap can't cover what the pool owes, the pool gets liquidated and the buyer is made whole. Neither side gets preferential treatment.

Your maximum loss on a swap is what you posted. Because each swap is independently collateralized and settlement caps each side's payment at its own collateral, you can never end up owing more than you put in.


---

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