# Liquidation

Liquidation is the core safety mechanism that protects Liquidity Providers’ capital when a borrower’s position becomes unhealthy. On Arkis, liquidation is automated, transparent, and portfolio-aware. **Liquidation is triggered when the** [**Risk Factor**](https://docs.arkis.xyz/home/concepts/risk-factor) **of a** [**Margin Account**](https://docs.arkis.xyz/home/concepts/margin-account) **falls below 1.0**, indicating that, under stress conditions, the account no longer sufficiently covers the borrowed amount.

### **How Liquidation Works on Arkis**

1. Risk Factor Breach Detection
   * The Margin Engine re-evaluates all Margin Accounts every 30 seconds.
   * If Risk Factor < Liquidation Threshold, a liquidation plan is generated.
2. Liquidation Plan Creation
   * All positions across DeFi protocols (e.g., Pendle, Curve, Uniswap) are scheduled to close.
   * Assets are swapped (if needed) to the base token of the borrowed asset (e.g., USDC, ETH).
   * Target currency is returned to the Market via smart contracts.
3. Execution
   * Plan is sent to the Executor microservice.
   * Executor compiles the plan into an onchain transaction and submits it to the Ethereum network (or supported EVM chain).
   * Collateral is liquidated through whitelisted venues, following smart contract logic.
   * Execution is monitored in real-time (with onchain confirmation and fallback retries).

### **Key Properties of Arkis Liquidation**

<table><thead><tr><th width="283.287109375">Property</th><th>Description</th></tr></thead><tbody><tr><td><strong>MEV-Resistant</strong></td><td>Liquidation logic is designed to avoid predictable pricing patterns or sandwichable sequences.</td></tr><tr><td><strong>Multi-Protocol Aware</strong></td><td>A liquidation can span multiple DeFi protocols in a single plan (e.g., unwind Curve LP, sell on 1inch).</td></tr><tr><td><strong>Failsafe &#x26; Retryable</strong></td><td>Executor retries failed transactions and supports fallback execution logic.</td></tr><tr><td><strong>Configurable Liquidation Fees</strong></td><td>Per-Agreement fee settings (e.g., 5–10%) for compensating LPs and covering slippage.</td></tr></tbody></table>

### **Liquidation Example**

An Asset Manager opens a $5,000 ETH position with 5x leverage:

* Collateral: $1,000 worth of Curve LP tokens
* Borrowed Amount: $4,000 USDC
* Stress-Tested Value: $3,900 (due to slippage, LP discount, market volatility)
* Risk Factor = 3,900 / 4,000 = 0.975

If the Liquidation Threshold = 1.0, this account becomes eligible for liquidation.

* Arkis Margin Engine detects the breach.
* Executes a plan to:
  * Unstake and break Curve LP
  * Sell assets on 1inch to recover USDC
  * Return repaid principal to the Market

### **User Notifications & Transparency**

* Margin Calls and Liquidation Warnings are pushed via Arkis Web Portal and alerting system.
* Liquidation events are fully auditable onchain.
* Smart contract logs contain execution traces of all liquidated positions.
