# Stablecoin Depeg Monitor - USDT/USDC/USDe Peg Deviation API (`gochujang/stablecoin-depeg-monitor`) Actor

Track real-time peg deviation for 380+ stablecoins (USDT, USDC, USDe, DAI, sUSDe, FRAX, PYUSD, etc.) with severity labels and Telegram alerts. DefiLlama-powered.

- **URL**: https://apify.com/gochujang/stablecoin-depeg-monitor.md
- **Developed by:** [Hojun Lee](https://apify.com/gochujang) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Stablecoin Depeg Monitor

> Real-time **peg deviation tracking** for 380+ stablecoins (USDT, USDC, USDe, DAI, sUSDe, FRAX, PYUSD, FDUSD, RLUSD, USDS, and more). Get pinged when any stable wobbles. DefiLlama-powered. No API key required.

---

### What It Does

Pulls live aggregated price and circulating supply for every tracked stablecoin and computes **basis-point deviation from peg**. Each row includes a severity label so you can wire alerts at any threshold:

| Severity | Range | Meaning |
|----------|-------|---------|
| `NORMAL` | < 10 bps | Within market microstructure noise |
| `WATCH` | 10–50 bps | Slightly off — monitor closely |
| `DEPEG` | 50–200 bps | Clear deviation — derisking signal |
| `CRITICAL` | > 200 bps | Active depeg event |

---

### Why This Matters

Stablecoins are the plumbing of crypto — every DeFi pool, every CEX pair, every yield strategy assumes they hold peg. When they don't, **cascades happen fast**:

- **UST depeg (May 2022)** wiped out $40B in 72 hours
- **USDC depeg (Mar 2023, SVB)** dropped to $0.87 in hours, took $3B+ of DeFi TVL with it
- **USDe small wobbles** in 2024-25 routinely preceded mNAV widening and Ethena negative basis

Catching deviation at 25 bps (0.25%) gives you minutes-to-hours to exit before the market notices. This Actor automates that watch.

---

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `symbols` | string[] | `[]` | Filter to specific symbols (USDT, USDC, USDe, …). Empty = all stables matching other filters |
| `minCirculatingUsd` | integer | `10000000` | Skip below this circulating supply (default $10M excludes micro tokens) |
| `minDeviationBps` | integer | `0` | Only return rows above this |deviation| in bps |
| `pegType` | string | `peggedUSD` | `peggedUSD`, `peggedEUR`, `peggedKRW`, `peggedJPY`, `all` |
| `sortBy` | string | `deviation_desc` | `deviation_desc`, `circulating_desc`, `symbol_asc` |
| `alertDeviationBps` | integer | `0` | Send Telegram alert when any \|deviation\| crosses this in bps |
| `telegramBotToken` | string (secret) | — | Bot token for alerts |
| `telegramChatId` | string | — | Chat ID for alerts |

#### Example: USD stables only, alert on 25 bps
```json
{
  "pegType": "peggedUSD",
  "minCirculatingUsd": 100000000,
  "alertDeviationBps": 25,
  "telegramBotToken": "<token>",
  "telegramChatId": "<chat>"
}
````

#### Example: Just the top 5 by supply

```json
{
  "symbols": ["USDT", "USDC", "USDe", "DAI", "USDS"],
  "sortBy": "circulating_desc"
}
```

***

### Output

One row per stablecoin:

```json
{
  "symbol": "USDe",
  "name": "Ethena USDe",
  "gecko_id": "ethena-usde",
  "peg_type": "peggedUSD",
  "peg_mechanism": "algorithmic",
  "price_usd": 0.9987,
  "deviation_bps": -13.04,
  "deviation_pct": -0.1304,
  "severity": "WATCH",
  "is_above_peg": false,
  "circulating_usd": 4492720834,
  "chains_count": 12,
  "chains_deployed": ["Ethereum", "Arbitrum", "Optimism", "Base", "Polygon", "BSC", "Solana", "Avalanche", "Linea", "zkSync"],
  "timestamp": "2026-06-02T14:00:00+00:00"
}
```

***

### Pricing

Pay-Per-Event (PPE):

- **$0.001 per stablecoin returned**

Examples:

- Top 50 USD stables: **$0.05/run**
- All 380 (`pegType: all`, no supply filter): **$0.38/run**

***

### Use Cases

**24/7 depeg alert** — Run every 5 min, alert at 25 bps:

```bash
curl -X POST "https://api.apify.com/v2/acts/gochujang~stablecoin-depeg-monitor/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"alertDeviationBps": 25, "telegramBotToken": "<token>", "telegramChatId": "<chat>"}'
```

**DeFi risk dashboard** — Pull all > $100M stables into a watchlist for your trading bot to monitor LP pool exposure.

***

### Data Source

[DefiLlama Stablecoins](https://defillama.com/stablecoins) — aggregates price + circulating supply across CEX, DEX, and on-chain oracles. 380+ stables across 60+ chains, updated every ~5 min.

***

### Related Actors

- **[DeFi Yield Scanner](https://apify.com/gochujang/defi-yield-scanner)** — Best stablecoin yields across 17,000+ pools.
- **[CEX Funding Rate Aggregator](https://apify.com/gochujang/cex-funding-aggregator)** — Perp funding context for depeg arb opportunities.
- **[Hyperliquid Whale Tracker](https://apify.com/gochujang/hyperliquid-whale-tracker)** — Whale positions during depeg events.

***

### Feedback

If this Actor saves you time, a quick review helps others find it: [Leave a review on Apify Store](https://apify.com/gochujang/stablecoin-depeg-monitor#reviews)

# Actor input Schema

## `symbols` (type: `array`):

Filter to specific stablecoins (e.g. USDT, USDC, USDe). Empty = all 380+ tracked stables.

## `minCirculatingUsd` (type: `integer`):

Skip stablecoins below this circulating supply. Default $10M excludes micro/test tokens.

## `minDeviationBps` (type: `integer`):

Only return stablecoins whose peg deviation exceeds this in basis points (1 bp = 0.01%). 0 = include all matching the supply filter.

## `pegType` (type: `string`):

Filter by peg type. Most users want USD-pegged only.

## `sortBy` (type: `string`):

Sort order for results.

## `alertDeviationBps` (type: `integer`):

Alert when any stablecoin's |deviation| crosses this in basis points. 0 = disabled. Recommended: 25 bps (0.25%) for early warning.

## `telegramBotToken` (type: `string`):

Telegram bot token for depeg alerts. Leave empty to disable.

## `telegramChatId` (type: `string`):

Chat ID to receive depeg alerts.

## Actor input object example

```json
{
  "symbols": [
    "USDT",
    "USDC",
    "USDe",
    "DAI",
    "PYUSD",
    "FRAX",
    "USDS",
    "FDUSD"
  ],
  "minCirculatingUsd": 10000000,
  "minDeviationBps": 0,
  "pegType": "peggedUSD",
  "sortBy": "deviation_desc",
  "alertDeviationBps": 0,
  "telegramChatId": ""
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "symbols": [
        "USDT",
        "USDC",
        "USDe",
        "DAI",
        "PYUSD",
        "FRAX",
        "USDS",
        "FDUSD"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("gochujang/stablecoin-depeg-monitor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "symbols": [
        "USDT",
        "USDC",
        "USDe",
        "DAI",
        "PYUSD",
        "FRAX",
        "USDS",
        "FDUSD",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("gochujang/stablecoin-depeg-monitor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "symbols": [
    "USDT",
    "USDC",
    "USDe",
    "DAI",
    "PYUSD",
    "FRAX",
    "USDS",
    "FDUSD"
  ]
}' |
apify call gochujang/stablecoin-depeg-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=gochujang/stablecoin-depeg-monitor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Stablecoin Depeg Monitor - USDT/USDC/USDe Peg Deviation API",
        "description": "Track real-time peg deviation for 380+ stablecoins (USDT, USDC, USDe, DAI, sUSDe, FRAX, PYUSD, etc.) with severity labels and Telegram alerts. DefiLlama-powered.",
        "version": "0.1",
        "x-build-id": "ejZKMG5aZ4mgOyrgf"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/gochujang~stablecoin-depeg-monitor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-gochujang-stablecoin-depeg-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/gochujang~stablecoin-depeg-monitor/runs": {
            "post": {
                "operationId": "runs-sync-gochujang-stablecoin-depeg-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/gochujang~stablecoin-depeg-monitor/run-sync": {
            "post": {
                "operationId": "run-sync-gochujang-stablecoin-depeg-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "symbols": {
                        "title": "Symbol Filter",
                        "type": "array",
                        "description": "Filter to specific stablecoins (e.g. USDT, USDC, USDe). Empty = all 380+ tracked stables.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "minCirculatingUsd": {
                        "title": "Min Circulating Supply (USD)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Skip stablecoins below this circulating supply. Default $10M excludes micro/test tokens.",
                        "default": 10000000
                    },
                    "minDeviationBps": {
                        "title": "Min Deviation (bps)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Only return stablecoins whose peg deviation exceeds this in basis points (1 bp = 0.01%). 0 = include all matching the supply filter.",
                        "default": 0
                    },
                    "pegType": {
                        "title": "Peg Type",
                        "enum": [
                            "all",
                            "peggedUSD",
                            "peggedEUR",
                            "peggedCNY",
                            "peggedKRW",
                            "peggedJPY",
                            "peggedVAR"
                        ],
                        "type": "string",
                        "description": "Filter by peg type. Most users want USD-pegged only.",
                        "default": "peggedUSD"
                    },
                    "sortBy": {
                        "title": "Sort By",
                        "enum": [
                            "deviation_desc",
                            "circulating_desc",
                            "symbol_asc"
                        ],
                        "type": "string",
                        "description": "Sort order for results.",
                        "default": "deviation_desc"
                    },
                    "alertDeviationBps": {
                        "title": "Telegram Alert Deviation Threshold (bps)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Alert when any stablecoin's |deviation| crosses this in basis points. 0 = disabled. Recommended: 25 bps (0.25%) for early warning.",
                        "default": 0
                    },
                    "telegramBotToken": {
                        "title": "Telegram Bot Token",
                        "type": "string",
                        "description": "Telegram bot token for depeg alerts. Leave empty to disable."
                    },
                    "telegramChatId": {
                        "title": "Telegram Chat ID",
                        "type": "string",
                        "description": "Chat ID to receive depeg alerts.",
                        "default": ""
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
