> For the complete documentation index, see [llms.txt](https://docs.dahlia.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dahlia.xyz/key-concepts/market-modes.md).

# Market Modes

To ensure the safety of lenders and borrowers, Dahlia offers robust emergency management options to handle unexpected disruptions or critical market events.

### **Pause Mode**

Pause Mode is a safety mechanism designed to protect market participants during unexpected events, such as emergencies or disruptions. When a market is paused:

* **Borrowing and lending activities** are halted.
* Borrowers can still **repay their debt**.
* Lenders are allowed to **withdraw their funds**, though subject to any underlying losses that may have occurred.

The market remains in this state until the underlying issue is resolved and stability is restored. This can happen when:

* Market conditions normalize.
* Necessary actions are taken by the DAO or Market Admin to address the emergency.

**Authority**: The **Market Admin** and the [**DAO (Guardian Multisig)**](https://docs.dahlia.xyz/governance-and-fees/governance.md) have the ability to pause or unpause a market, depending on the situation.

### **Deprecation Mode**

Deprecation Mode applies to markets that are deemed **unsafe** or have **insufficient deposits**, rendering them inactive. Once deprecated:

* **New borrowing and lending activities** are permanently disabled.
* Borrowers can **repay their debt**.
* Lenders can **withdraw their funds**, similar to paused markets.

Deprecation is an irreversible action. If a similar market is needed, users can **create a new market** with the same parameters.

**Authority**: Only the [**DAO (Guardian Multisig)**](https://docs.dahlia.xyz/governance-and-fees/governance.md) can deprecate a market.

### **Oracle Stalled Mode**

If a market’s oracle becomes stalled — meaning one or more price feeds return `badData` (indicating the price has not been updated within the required delay and is no longer fresh) — Dahlia halts all actions that depend on oracle prices. This includes liquidations, new borrows, and collateral withdrawals.

To address a stalled oracle, there are two possible resolutions:

1. **Oracle price feeds recover** and start providing fresh prices again.
2. **Oracle price feeds are irreparably broken**, requiring an alternative mechanism to ensure funds are not stuck indefinitely.

In the event of an unresolved oracle issue, Dahlia can activate the **Stalled Market Mode** with the following process:

* A `REPAY_PERIOD` is initiated, during which borrowers can repay their full debt and reclaim their collateral. Lenders are unable to withdraw funds during this period.
* The `REPAY_PERIOD` lasts for **2 weeks** by default but can be adjusted by the DAO (Guardian Multisig).

If borrowers fail to repay their debt within the `REPAY_PERIOD`, the following actions occur:

* Borrowers lose the ability to reclaim their collateral.
* Lenders gain access to the **available liquidity** and any **remaining collateral**, ensuring fair distribution of assets even without a functioning oracle.

This mechanism prevents liquidity from becoming permanently stuck in the protocol and provides a clear resolution path in the absence of reliable price data.

**Authority:** Only the [**DAO (Guardian Multisig)**](https://docs.dahlia.xyz/governance-and-fees/governance.md) can trigger Oracle Stalled Mode.
