---
# System prepended metadata

title: Risk Analysis Mechanism for Arcadia Protocol

---

# Risk Analysis Mechanism for Arcadia Protocol
## Goals
The goal is to find the correct parameters (or a range or parameters) for the following:
- Collateral Factor
- Liquidation Factor
- Exposure

such that
- Protocol doesn't inculcate bad debt
    - Minimum risk for junior tranche
- Maximum protocol earning (Arcadia Finance Treasury)
- Maximum junior tranche earning

## Mechanism
In an instance of simulation, there will be these entities
- An account that is getting liquidated
- Liquidators who are liquidating this said account
- External market price feed (with slippage)
    - Since slippage is mostly linear in nature compared to volume, a model based on linear regression can be used for slippage

1) The simulation will be set with certain values for collateral factor, liquidation factor and exposure. Based on that, a scenario will be created where an account
    - has certain amount of debt and a portfolio (collateral).
    - The debt will be based what the exposure is for the ongoing simulation.
    - The ratio of debt and collateral will also be based on collateral factor.

    *NOTE: Realistic values of exposure and collateral factor can be calculated by observing other protocols and checking the spread of loan and collateral value*

2) Liquidator agents will try to calculate which assets to bid for and what amount of those assets should be bid for maximizing profit. The volume of each liquidation bid for a particular asset will be based on an assumed percentage of exposure value of that asset. This percentage needs to be realistic and will be based on historical data.
*NOTE: The profit function will also include rewards for first and last liquidator*

3) There can be three possible scenarios after liquidation
    - debt > sold value or incomplete selling
    What is the effect on junior most tranche here?
    - debt + penalty > Sold value > debt
    How much do the junior most tranche and arcadia treasury get?
    - sold Value > debt + penalty
    How much do the junior most tranche and arcadia treasury get? How much does the account get?

Based on fee earned in these scenarios and observing bad debts, we can come up with ideal values of collateral factor, liquidation factor and exposure using grid search among different instances of simulation while making assumtions about the following:
- Liquidation Penalty
- Initiator and closer reward
- Duration of liquidation event
- Liquidation Volume cap
- Asset Type
- Distribution of fee between Treasury & tranches
- Distribution of assets in pool in different tranches


# Notes
1) What is the time duration between each step?
2) Do we take the average price of that time duration?
3) https://github.com/kaleb-keny/synthetix_slippage_calibration_sip_272