Stablecoin peg monitor
GET /api/stablecoin-pegLive $1-peg deviation for the top USD stablecoins (USDT, USDC, USDS, DAI, USDe, PYUSD, USDD, TUSD, FDUSD by default, or pass your own list): current price, deviation in basis points, 24h high/low, worst 24h deviation, market cap, and an on-peg / stressed / depegged status. Send GET /api/stablecoin-peg with no required fields (1 optional) and pay $0.003 per call over x402 or MPP (there is no free tier). It returns a JSON object with peg, count and coins.
Backed by CoinGecko's public API.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
coins | string | no | Optional comma-separated symbols or CoinGecko ids to check instead of the default top-stablecoin set (e.g. "USDT,USDC"). Max 15. |
Example request
curl -i "https://agent402.tools/api/stablecoin-peg"
Without payment this returns HTTP 402 Payment Required with the exact price for stablecoin-peg; any x402 v2 or MPP client pays it and retries.
Example response
{
"peg": "USD $1.00",
"count": 2,
"coins": [
{
"id": "tether",
"symbol": "USDT",
"name": "Tether",
"price": 0.998868,
"deviationBps": -11.32,
"high24h": 0.999372,
"low24h": 0.998674,
"maxDeviation24hBps": 13.26,
"marketCap": 184092462233,
"status": "on-peg"
},
{
"id": "usd-coin",
"symbol": "USDC",
"name": "USDC",
"price": 0.999819,
"deviationBps": -1.81,
"high24h": 0.999923,
"low24h": 0.99953,
"maxDeviation24hBps": 4.7,
"marketCap": 73033499074,
"status": "on-peg"
}
]
}
| Field | Type | Always present | In the example |
|---|---|---|---|
peg | string | yes | USD $1.00 |
count | number | yes | 2 |
coins | array of objects | yes | 2 items in the example |
From an MCP client
catalog.call {
"slug": "stablecoin-peg",
"params": {}
}
The hosted connector at https://agent402.tools/mcp needs a payment for stablecoin-peg; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.
Errors and behavior
- Every field is optional. An input the tool rejects returns an HTTP 4xx whose body carries
error,tool,expected,requiredandexample. - A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement is cancelled when the tool fails. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - A
POSTwith a JSON body to /api/stablecoin-peg is served as this GET, with the body as the input. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/stablecoin-peg");
Related tools
Stablecoin supply by asset
POST /api/stablecoinsStablecoins ranked by circulating supply from DefiLlama's free stablecoin dataset: name, symbol, peg currency and type (…
DeFi yield screener
POST /api/defi-yieldsScreen DeFi yield pools (lending, LP, staking, vaults) across every chain from DefiLlama's free Yields dataset: filter b…
Stablecoin supply history
POST /api/stablecoin-supply-historyDaily total stablecoin circulating supply (in USD) over time from DefiLlama's free stablecoin charts, for all chains or …
Token balances (named contracts)
POST /api/token-balancesERC-20 balances of one wallet for a NAMED list of token contracts (1-20) - the targeted complement to the full-portfolio…
Known-address label lookup
POST /api/address-labelLabel a known EVM address from a curated, committed dataset: major stablecoin + token contracts (the USDC and USDG contr…
Wallet token transfers (filtered)
POST /api/asset-transfersRecent token transfers for a wallet on Base, Ethereum and other EVM chains, newest first. Filtered transfer log for an E…