> For the complete documentation index, see [llms.txt](https://machfi.gitbook.io/machfi-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://machfi.gitbook.io/machfi-documentation/protocol/mechanics/risk-management.md).

# Risk Management

#### What is it <a href="#what-is-it" id="what-is-it"></a>

The Comptroller is the risk management layer of the MachFi protocol; it determines how much collateral a user is required to maintain, and whether (and by how much) a user can be liquidated. Each time a user interacts with a ibToken, the Comptroller is asked to approve or deny the transaction.

The Comptroller maps user balances to prices (via the Price Oracle) to risk weights (called [Collateral Factors](https://docs.compound.finance/v2/comptroller#collateral-factor)) to make its determinations. Users explicitly list which assets they would like included in their risk scoring, by calling [Enter Markets](https://docs.compound.finance/v2/comptroller#enter-markets) and [Exit Market](https://docs.compound.finance/v2/comptroller#exit-market).

#### Oracle <a href="#oracle-risk" id="oracle-risk"></a>

MachFi leverages both **Api3** & **Pyth** as oracle providers, ensuring accurate and reliable price feeds for secure and efficient protocol operations.

#### Api3

Api3 serves as the oracle for blue chip assets for MachFi due to the following key advantages:

1. **Push-Based Oracle Design** - Api3 delivers price data through a push mechanism, minimizing latency and enabling real-time updates without requiring external triggers.
2. **Decentralized and Reliable Service** - Api3's decentralized infrastructure reduces single points of failure, providing high reliability and data integrity.
3. **Oracle Extractable Value (OEV) Rewards** – Api3’s OEV Network auctions oracle update priority and returns the proceeds back to the dApp, allowing MachFi to capture value that would otherwise leak to external arbitrageurs.

#### Pyth

Pyth acts as a complementary oracle to Api3 for assets not covered by Api3 or in scenarios where Api3 provides invalid or stale price feeds:

1. **Pull-Based Oracle Design** - Pyth fetches prices on-demand, ensuring that data is pulled directly from the source when required.
2. **High Availability Through Keeper Bots** - MachFi employs a network of high-availability keeper bots that consistently refresh Pyth prices to keep data up-to-date and responsive to market conditions.
3. **Industry Proven Solution** - Pyth is widely adopted in the DeFi ecosystem and secures billions of dollars in assets across top protocols, establishing it as a trustworthy backup.

**General**

In general the use of DeFi applications can lead to loss of funds due to either malicious developers or unforeseen vulnerabilities in a given protocol, users should conduct their own research before depositing funds into a given DeFi application.

​

**Maximum Utilization Risk**

In heavy utilization, funds may temporarily be unable to withdraw until the utilization rate decreases.
