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

# Mechanics

## Breakdown of  Main Risk Categories

* Smart Contract Risk - exploits and malfunction
* Asset Risk
  * Bridge exploits
  * De-peg of stable coins
* Liquidations
* Strategy risk (VaR of a given strategy)

## Methodology Overview

For each of these categories we compute a % of value at risk in the span of 1 year. For example, we might find that we are exposed to an average of 1% loss due to smart contract hacks.

The individual values are then summed to produce a total value at risk (or VaR) for a given strategy. The result can also be seen as a fair insurance premium for the strategy. The resulting VaR can then be used to find the risk-adjusted return of a strategy.

An aggregator vault's score is calculated by using the same technique for each of its underlying strategies and weighing each VaR by its strategy's percentage capture of the vault's total TVL.

Finally we convert the total vault or strategy VaR to a 0-10 risk score for intuitive UI display.

### Smart Contract Risk

Smart contract exploit risk is currently probably the biggest risk for users interacting with DeFi. As a first step we analyze the DeFi exploit data to find an average probability of losing funds. We then gather data about the protocols used in a given strategy. This information may include # of audits, longevity, team etc. This allows us to fine-tune the average probability of loss to specific protocols.&#x20;

### Asset Risk

Asset risk, and in particular, bridge hacks and de-pegs are other major DeFi risk factors. We identify exposure to bridged assets and use historical bridge hack data to assess potential losses. De-peg probability is also taken into account when dealing with stable assets.&#x20;

### Liquidations

When strategy borrows funds it is exposed to liquidation risk. Under normal circumstances the strategies mitigate this risk, however in extreme market conditions, such as drastic price moves can lead to liquidations. We analyze asset liquidity and volatility to estimate liquidation risk.

In some instances a strategy may also trigger a cascading liquidation or asset price crash. We model these types of scenarios and monitor the relevant metrics in order to avoid such scenarios.&#x20;

### Strategy Risk  &#x20;

Strategies that bet on volatility may also require back-tests to analyze value at risk given various market conditions. We use traditional methods to analyze back-test data to estimate the potential losses a strategy may suffer.&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sector-finance.gitbook.io/sector-finance/risk-engine/mechanics.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
