# Optimism Token Price API (OP Mainnet)

> Optimism Token Price API (OP Mainnet) is a paid API for AI agents from x402.donnyautomation.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Returns real-time USD spot price for any ERC-20 token on Optimism (OP Mainnet) by ticker symbol or contract address, sourced live from SushiSwap and Uniswap v3 pools.

## Facts

- Endpoint: GET https://x402.donnyautomation.com/optimism/price
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/optimism-token-price-api-op-mainnet-e07a4dcd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_9XfKgMALjSrnBrBEEn6ea

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 optimism-token-price-api-op-mainnet-e07a4dcd
```

Example prompt: What's the current USD price of OP on Optimism right now — and how deep is the liquidity backing that quote?

## When to prefer this

Use this endpoint when you need a real-time, on-chain USD price for any ERC-20 token on Optimism (OP Mainnet) — especially when you need confidence ratings and liquidity depth alongside the price, rather than just a raw number. Prefer this over centralized price APIs when you need decentralized, DEX-sourced quotes directly from SushiSwap and Uniswap v3 pools on Optimism. Ideal for trading bots, price oracles, and DeFi dashboards operating on the Optimism L2.

## Known failure modes

- Token symbol not found or not traded on OP Mainnet DEXs — returns error or null price
- Thin or zero liquidity pool — returns low confidence rating, indicating price may be unreliable
- Contract address invalid or not an ERC-20 on Optimism — returns error
- No active SushiSwap or Uniswap v3 pool exists for the token — price unavailable
- Payment not processed (x402) — request blocked before reaching price logic

## How this service works

Spot token price in USD on OP Mainnet, read from SushiSwap and Uniswap v3 fee tiers pools at call time. Returns priceUsd, the routed pair, backing liquidityUsd, confidence and blockNumber. Requires ?symbol=TICKER (e.g. OP) or ?token=0xADDRESS. Errors: 400 missing_symbol|unknown_token, 404 no_reliable_price when pools are too thin, 502 upstream_read_failed. Depth is /liquidity; a size-aware quote is /slippage. Chain-pinned; bare /price = BSC.

## Output

Returns priceUsd (current USD spot price), the DEX trading pair used to derive the quote (e.g. WETH/USDC on Uniswap v3), the USD liquidity backing the pool, and a confidence rating indicating how reliable the price is relative to pool depth.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "symbol"
     ],
     "properties": {
      "symbol": {
       "type": "string",
       "description": "Token symbol on OP Mainnet (e.g. WETH, OP, WBTC, USDC, USDT, DAI)."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ts": "2026-07-31T00:00:00.000Z",
  "chainId": 10,
  "network": "optimism"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/optimism-token-price-api-op-mainnet-e07a4dcd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.donnyautomation.com](https://www.zero.xyz/host/x402.donnyautomation.com/llms.txt)
