# Stablecoin Peg Safety Decision API

> Stablecoin Peg Safety Decision API is a paid API for AI agents from peg.weatherriskapi.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-12).

Returns a SAFE, CAUTION, or AVOID decision for USDC or USDT based on live Chainlink price feed deviation from $1 peg, using caller-defined thresholds.

## Facts

- Endpoint: POST https://peg.weatherriskapi.com/v1/stablecoin/peg-safety?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/stablecoin-peg-safety-decision-api-575e5af5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_IPwkaNb_gnDvqDXhgrfaM

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability stablecoin-peg-safety-decision-api-575e5af5 -d '<json body>'
```

Example prompt: Before we proceed with the USDC payment, check whether USDC is safe right now — flag it CAUTION or AVOID if it's more than 50 basis points off the $1 peg, and treat any Chainlink data older than 10 minutes as stale.

## When to prefer this

Choose this endpoint when an AI agent needs a deterministic, threshold-based peg safety signal — not just a raw price — before taking action on USDC or USDT on Base Mainnet. Ideal when you want caller-controlled SAFE/CAUTION/AVOID classification with configurable deviation and staleness limits, backed by Chainlink's canonical oracle. Prefer over raw price feeds when you need an opinionated go/no-go decision with auditable reasoning rather than a number to interpret yourself.

## Known failure modes

- Chainlink data exceeds maxDataAgeSeconds — fails closed, returns error, no charge
- Chainlink feed unavailable or reverted — fails closed without settlement
- Invalid asset enum value — request rejected
- maxDeviationBps or maxDataAgeSeconds out of allowed range — validation error
- Network/connectivity issues reaching Base Mainnet — service unavailable error

## How this service works

Check USDC or USDT peg risk before a Base treasury or payment-asset decision. Send asset, maxDeviationBps and maxDataAgeSeconds to receive SAFE, CAUTION or AVOID, deviation, oracle freshness and reasons from official Chainlink feeds. Deterministic thresholds avoid interpreting raw prices; this checks peg deviation and freshness, not liquidity, redeemability or total stablecoin safety. Price: 0.005 USDC per successful result. Not financial advice.

## Output

A JSON object containing the peg safety decision (SAFE, CAUTION, or AVOID), the current USD price, deviation in basis points and direction (ABOVE/BELOW), data freshness status (FRESH/STALE), confidence level, human-readable reasons explaining the decision, and methodology thresholds used. Stale or unavailable data fails closed without charge.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "asset": {
   "enum": [
    "USDC",
    "USDT"
   ],
   "type": "string",
   "description": "Stablecoin to evaluate using its official Chainlink USD feed on Base Mainnet."
  },
  "maxDeviationBps": {
   "type": "integer",
   "maximum": 1000,
   "minimum": 1,
   "description": "Largest absolute deviation from $1, in basis points, that the caller considers SAFE."
  },
  "maxDataAgeSeconds": {
   "type": "integer",
   "maximum": 86400,
   "minimum": 60,
   "description": "Maximum acceptable age of the Chainlink round. Stale data fails closed and is not charged."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "asset": "USDC",
  "source": {
   "pair": "USDC / USD",
   "chainId": 8453,
   "network": "Base Mainnet",
   "provider": "Chainlink Data Feeds",
   "cacheStatus": "MISS"
  },
  "reasons": [
   "USDC/USD is 1 bps below the $1 peg.",
   "Decision threshold: SAFE <= 50 bps, CAUTION <= 100 bps, AVOID > 100 bps.",
   "Chainlink round age is 120s, within the requested 86400s maximum."
  ],
  "decision": "SAFE",
  "priceUsd": "0.9999431",
  "direction": "BELOW",
  "freshness": "FRESH",
  "confidence": "HIGH",
  "disclaimer": "Decision support only; not financial advice, a guarantee of redeemability, or a substitute for independent risk controls.",
  "methodology": {
   "pegUsd": "1.00",
   "rounding": "conservative-ceiling",
   "avoidAboveBps": 100,
   "safeAtOrBelowBps": 50,
   "cautionAtOrBelowBps": 100
  },
  "deviationBps": 1,
  "dataAgeSeconds": 120,
  "maxDeviationBps": 50,
  "maxDataAgeSeconds": 86400
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/stablecoin-peg-safety-decision-api-575e5af5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from peg.weatherriskapi.com](https://www.zero.xyz/host/peg.weatherriskapi.com/llms.txt)
