> For the complete documentation index, see [llms.txt](https://docs.satoshiterminal.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.satoshiterminal.io/resources/copy-of-defi-analytics/risk-management-and-security-analytics/on-chain-loan-risk-analytics.md).

# 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.
