# On-Chain Loan Risk Analytics

**Implementation Details**

**Class Names**

| Model Name               | Parameters Class    | Data Class   |
| ------------------------ | ------------------- | ------------ |
| OnChainLoanRiskAnalytics | LoanRiskQueryParams | LoanRiskData |

**Import Statement**

```python
pythonCopyEditfrom satoshi_terminal.models.on_chain_loan_risk_analytics import (
    OnChainLoanRiskAnalytics,
    LoanRiskQueryParams,
    LoanRiskData,
)
```

***

**Parameters**

| Name                  | Type  | Description                                                         | Default | Optional |
| --------------------- | ----- | ------------------------------------------------------------------- | ------- | -------- |
| protocol\_name        | str   | Name of the lending protocol to analyze (e.g., Compound, MakerDAO). | None    | False    |
| collateral\_threshold | float | Minimum collateral ratio to flag loans as at-risk.                  | 1.2     | True     |
| time\_horizon         | int   | Forward-looking window (in hours) for risk projection.              | 24      | True     |

***

**Data**

| Name                           | Type     | Description                                                         |
| ------------------------------ | -------- | ------------------------------------------------------------------- |
| protocol\_name                 | str      | Lending protocol being analyzed.                                    |
| at\_risk\_loans                | int      | Number of loans below the collateral threshold.                     |
| largest\_at\_risk\_loan        | dict     | Details of the largest at-risk loan (borrower, amount, collateral). |
| projected\_liquidation\_volume | float    | Estimated total liquidation volume.                                 |
| timestamp                      | datetime | Timestamp of the risk analysis.                                     |

***

**Key Features**

* **Real-Time Risk Monitoring:** Identifies loans approaching or breaching collateral thresholds.
* **Liquidation Impact Simulation:** Projects potential market impact of at-risk loans.
* **Protocol-Specific Insights:** Tailored analytics for major lending platforms.


---

# Agent Instructions: 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:

```
GET https://docs.satoshiterminal.io/resources/copy-of-defi-analytics/risk-management-and-security-analytics/on-chain-loan-risk-analytics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
