# Token Volatility Calculator (CoinGecko-backed)

> Token Volatility Calculator (CoinGecko-backed) is a paid API for AI agents from x402-deployer.x402-deployer.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Computes daily and annualized historical volatility (log-return standard deviation) for any CoinGecko-listed crypto token over a configurable lookback window

## Facts

- Endpoint: POST https://x402-deployer.x402-deployer.workers.dev/token-volatility
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-ebc72638
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_gG9OWnB7bqnQP-Wt1Fl1G

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 x402-deployer-x402-deployer-workers-dev-ebc72638 -d '<json body>'
```

Example prompt: What's the annualized historical volatility of Ethereum (ethereum on CoinGecko) over the last 60 days? I want the daily and annualized vol as percentages.

## When to prefer this

Use this endpoint when you need a quick, computed historical volatility figure for a CoinGecko-listed token without building your own price-history pipeline. Ideal for options pricing inputs, risk scoring, portfolio analytics, or any agent task that needs annualized vol as a ready-to-use number. Prefer this over raw price endpoints when you specifically need the standard deviation of log returns already annualized.

## Known failure modes

- Token ID not found on CoinGecko — returns error indicating invalid coin ID
- Insufficient price history for requested window — fewer observations than expected
- CoinGecko rate limit hit on the free public endpoint — upstream 429 error
- Invalid or missing request body fields — validation error response
- Network timeout reaching CoinGecko market_chart API

## How this service works

Token volatility / historical volatility / annualized vol / standard deviation of returns / crypto vol calculator. For any CoinGecko-listed token, computes log-return standard deviation over the last N days (default 30) and annualizes by sqrt(365). Returns daily and annualized volatility as percent, count of return observations, first and last close prices. Backed by CoinGecko's free public market_chart endpoint.

## Output

Returns daily volatility as a percent, annualized volatility as a percent (scaled by sqrt(365)), the count of log-return observations used, and the first and last closing prices from the lookback window.

## Example request

```json
{
 "input": {
  "body": {
   "days": 60,
   "coingecko_id": "ethereum"
  },
  "type": "http",
  "method": "POST",
  "bodyType": "json"
 }
}
```

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "properties": {
      "coingecko_id": {
       "type": "string",
       "description": "CoinGecko coin id (e.g. 'ethereum', 'bitcoin', 'solana'). Lower-case slug, not the symbol."
      },
      "days": {
       "type": "number",
       "description": "Lookback window in days. Range [7, 365]. Default 30."
      }
     },
     "required": [
      "coingecko_id"
     ]
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "coingecko_id": {
       "type": "string"
      },
      "days": {
       "type": "integer"
      },
      "returns_count": {
       "type": "integer"
      },
      "daily_volatility_pct": {
       "type": "number"
      },
      "annualized_volatility_pct": {
       "type": "number"
      },
      "first_price_usd": {
       "type": "number"
      },
      "last_price_usd": {
       "type": "number"
      },
      "source": {
       "type": "string"
      }
     }
    }
   },
   "required": [
    "type"
   ]
  }
 },
 "required": [
  "input"
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-ebc72638/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-deployer.x402-deployer.workers.dev](https://www.zero.xyz/host/x402-deployer.x402-deployer.workers.dev/llms.txt)
