> 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/monitoring-and-tracking/market-depth-anomaly-alerts.md).

# Market Depth Anomaly Alerts

**Implementation Details**

**Class Names**

| Model Name               | Parameters Class       | Data Class             |
| ------------------------ | ---------------------- | ---------------------- |
| MarketDepthAnomalyAlerts | MarketDepthQueryParams | MarketDepthAnomalyData |

**Import Statement**

```python
pythonCopyEditfrom satoshi_terminal.models.market_depth_anomaly_alerts import (
    MarketDepthAnomalyAlerts,
    MarketDepthQueryParams,
    MarketDepthAnomalyData,
)
```

***

**Parameters**

| Name                  | Type                    | Description                                               | Default | Optional |
| --------------------- | ----------------------- | --------------------------------------------------------- | ------- | -------- |
| asset\_symbol         | Union\[str, List\[str]] | Asset(s) to monitor for market depth anomalies.           | None    | False    |
| threshold\_percentage | float                   | Percentage deviation in bid-ask spread to flag anomalies. | 5.0     | True     |
| time\_horizon         | int                     | Time window (in minutes) for anomaly detection.           | 15      | True     |

***

**Data**

| Name                  | Type     | Description                                                |
| --------------------- | -------- | ---------------------------------------------------------- |
| asset\_symbol         | str      | Asset being monitored for anomalies.                       |
| bid\_ask\_spread      | float    | Current bid-ask spread as a percentage of the asset price. |
| anomaly\_detected     | bool     | Whether an anomaly was detected.                           |
| deviation\_percentage | float    | Deviation from the historical average bid-ask spread.      |
| timestamp             | datetime | Timestamp of the anomaly detection.                        |

***

**Key Features**

* **Real-Time Alerts:** Notifies users when bid-ask spreads deviate significantly from historical norms.
* **Threshold Customization:** Allows users to define their own thresholds for anomalies.
* **Anomaly Trends:** Tracks and visualizes historical patterns in market depth anomalies.
