# Liquidation

<figure><img src="https://3776646764-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIVV4Tgp9jUTxlOPcg99u%2Fuploads%2FXm6RFjhBUjBi1eHROuGA%2Fkjklj.png?alt=media&#x26;token=320c2aba-88b0-4933-8c0d-7f9b1651da23" alt=""><figcaption></figcaption></figure>

## Isolated Risk Between Pair

All asset pairs experience different volatility by nature. To support a permissionless margin trading market, isolated pools are needed with risk parameters associated with the pair. **Each pair has its collateral ratio**, according to the pair's volatility and the block time and throughput of the chain. The protocol can support from 1.1X to 10X leverage trading.

## Risk Calculation AMM Prices

**Real-time pricing from the on-chain AMM model is taken as a reference and used in risk calculation and liquidation**. This is important for widening and speeding up the leverage trading market in a decentralized environment, compared to waiting for a Chainlink oracle to create or update market data. As [Vitalik suggested](https://gov.uniswap.org/t/uni-should-become-an-oracle-token/11988), prices from a DEX provide native data are maintained onchain, secured by technical and economical design, and are the defacto oracle for more DeFi use cases, such as margin trading.

## Restrictions

To avoid flash loan attacks, there are restrictions implemented in the protocol design:

* No open, close, or liquidation operations can be in the same transaction
* **Liquidation refers to OnDemand Oracle** to make sure the liquidation price is valid to avoid attackers manipulating prices, triggering liquidations to gain benefits, or creating cascading liquidation events.

## Insurance

**1/3 of the transaction fees of the pair are set aside as insurance to compensate lenders** if the loan fails to maintain the solvency of the pool.

Furthermore, **each lending pool will have 30% of generated interests set aside as a reserve.**
