Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/api-reference/agent-wallet-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Solana batch funding challenges identify the configured public resource URL, not

- Read the current model list. `openai/gpt-4.1-nano` was retired by OpenAI on October 23, 2026, and on Base chat requests for it now route to `openai/gpt-5-nano`. `openai/gpt-4.1-mini` is available, though OpenAI has scheduled its dated snapshot for removal on January 14, 2027.
- Music costs **$0.20 per track including the transaction fee**. Read the live `402` quote before signing.
- Crypto, FX and commodity spot prices are free daily closes (`realtime: false`). FX and commodity history is unsupported (`501`). Equity prices are not currently served: the equity `/price` and `/history` routes answer `501` before any payment, and the equity symbol lists return `available: false` — a listed symbol is not a promise of price coverage. See [Market Data](market-data.md).
- Crypto, FX and commodity spot prices are free daily closes (`realtime: false`). FX and commodity history is unsupported (`501`). US stock prices are on-chain and paid ($0.005): each gateway prices its own chain (Base or Solana), and a ticker with no on-chain market there answers `404` before payment — check `onchain` in the US list, or `?covered=true`. US history and non-US price/history answer `501` before any payment. See [Market Data](market-data.md).
- UMA markets requires `state`. Kalshi trades requires `ticker` or `event_ticker`.
- Smart activity requires at least one meaningful threshold: PnL of 5000, ROI of 0.15, 100 trades, or volume of 10000. Per-market smart money uses a PnL threshold of 1000; the alternative thresholds remain valid.
- The Base gateway rejects requests missing these market parameters before payment. The Solana gateway does not pre-check them, so send them yourself.
Expand Down
110 changes: 87 additions & 23 deletions docs/api-reference/market-data.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
---
title: Market Data
description: Free spot prices for crypto, FX and commodities and free crypto OHLC history. Equity prices are not currently served; the equity symbol catalogs stay free.
description: Free spot prices for crypto, FX and commodities, free crypto OHLC history, on-chain US stock prices from tokenized-stock DEX pools, and free equity symbol catalogs.
---

# Market Data

Spot prices for crypto, FX and commodities, historical OHLC bars for crypto,
and symbol catalogs for US and international equities.
on-chain prices for US stocks, and symbol catalogs for US and international
equities.

**Crypto, FX and commodity prices are free** — no payment header, no wallet.
They are **daily closes, not realtime ticks**: every response carries
`realtime: false` and a `note` saying so. Realtime feeds and full global
coverage are available on request ([hello@blockrun.ai](mailto:hello@blockrun.ai)).

:::warning Equity prices are not currently served
The equity `/price` and `/history` routes (`/api/v1/usstock/*` and
`/api/v1/stocks/{market}/*`) answer `501` with
`"We do not currently serve equity prices"`, before any payment challenge, so
nothing is ever charged. The equity `/list` catalogs still work and still
enumerate every ticker, with `available: false`.
:::info US stock prices are on-chain
`/api/v1/stocks/us/price/{symbol}` returns the price of a US stock's
**tokenized share on a blockchain**, read from decentralized-exchange pools —
not an exchange quote. Each gateway reports **its own chain**:

- `blockrun.ai` (pays in USDC on Base) — Coinbase Tokenized Stocks in Aerodrome
Slipstream and Uniswap v3 pools on Base.
- `sol.blockrun.ai` (pays in USDC on Solana) — xStocks in Raydium CLMM and Orca
Whirlpool pools on Solana.

$0.005 per call. A ticker with no on-chain market on that chain answers `404`
before any payment and is never charged; `/api/v1/stocks/us/list?covered=true`
lists the covered set. US history and every non-US price and history still
answer `501`, also before payment.
:::

## Endpoints
Expand All @@ -34,12 +43,14 @@ enumerate every ticker, with `available: false`.
| `/api/v1/commodity/list` | GET | Free | Available commodities |
| `/api/v1/commodity/price/{symbol}` | GET | Free | Commodity spot price (daily close) |
| `/api/v1/commodity/history/{symbol}` | GET | — | `501`: no free OHLC source for commodities |
| `/api/v1/usstock/list` | GET | Free | US tickers (`available: false`) |
| `/api/v1/usstock/price/{symbol}` | GET | — | `501`: equity prices not currently served |
| `/api/v1/usstock/history/{symbol}` | GET | — | `501`: equity prices not currently served |
| `/api/v1/stocks/{market}/list` | GET | Free | Tickers for one market (`available: false`) |
| `/api/v1/stocks/{market}/price/{symbol}` | GET | — | `501`: equity prices not currently served |
| `/api/v1/stocks/{market}/history/{symbol}` | GET | — | `501`: equity prices not currently served |
| `/api/v1/stocks/us/price/{symbol}` | GET | $0.005 | On-chain US stock price on this gateway's chain |
| `/api/v1/usstock/price/{symbol}` | GET | $0.005 | Alias of `/api/v1/stocks/us/price/{symbol}` |
| `/api/v1/stocks/us/list` | GET | Free | US tickers, each with `onchain: { base, solana }`; `?covered=true` lists only this chain's covered set |
| `/api/v1/usstock/list` | GET | Free | Alias of `/api/v1/stocks/us/list` |
| `/api/v1/stocks/us/history/{symbol}` | GET | — | `501`: equity history is not served |
| `/api/v1/stocks/{market}/list` | GET | Free | Tickers for a non-US market (`available: false`) |
| `/api/v1/stocks/{market}/price/{symbol}` | GET | — | `501` for every market except `us` |
| `/api/v1/stocks/{market}/history/{symbol}` | GET | — | `501`: equity history is not served |

`GET` and `POST` both work on the `/price` and `/history` paths; `POST` exists
so callers that cannot attach headers to a `GET` still have a route. `/list` is
Expand All @@ -54,13 +65,14 @@ Always resolve symbols from the matching `/list` endpoint rather than guessing.
| Crypto | `BASE-QUOTE` | `BTC-USD`, `ETH-USD`, `SOL-USD` |
| FX | `BASE-QUOTE` | `EUR-USD`, `GBP-USD`, `JPY-USD` |
| Commodity | `METAL-USD` / ticker | `XAU-USD` (gold), `XAG-USD` (silver) |
| US equity | Plain ticker | `AAPL`, `TSLA`, `NVDA`, `SPY` |
| US equity | Plain ticker; share classes with a dash. The issuer's own token symbol in its lower-case suffix (`TSLAx` on Solana, `TSLAc` on Base) also works | `AAPL`, `TSLA`, `NVDA`, `SPY`, `BRK-B` |
| Non-US equity | Per-market convention | HKEX `-HK` suffix (`0005-HK`), TSE 4-digit (`7203`), KRX 6-digit (`005930`), LSE/XETRA/Euronext alpha (`HSBA`, `SAP`, `MC`) |

`/list` takes `q` (substring filter) and `limit` (max 2000, default 100) and
returns `{ category, label, count, example, endpoints, symbols: [{ symbol,
description }] }`; equity catalogs add `available: false`, a `note` and a
`contact`.
description }] }`. The US catalog adds `onchain: { base, solana }` and
`available` (true when this gateway sells that ticker) per symbol; non-US
catalogs add `available: false`, a `note` and a `contact`.

## Markets

Expand Down Expand Up @@ -89,6 +101,57 @@ it before treating the number as current.

---

## On-chain US stock price

```bash
# 1st call answers 402 with the price; an x402 client pays and repeats it.
curl -i https://blockrun.ai/api/v1/stocks/us/price/NVDA # Base
curl -i https://sol.blockrun.ai/api/v1/stocks/us/price/TSLA # Solana
```

How the price is made:

1. Only curated pools are read: verified on chain to pair the issuer's token
with USDC (or SOL on Solana). Nothing comes from a price aggregator.
2. A pool counts when it holds at least $20,000 on its USDC side (a SOL side
counts at its USD value) and has liquidity active at its current price.
3. With three or more such pools, any more than 3% from their weighted median
is dropped. With exactly two that disagree by more than 3%, the deeper one
is kept, the other is listed with `excludedReason: "outlier"`, and the
answer carries `staleWarning: ["pools_disagree"]`.
4. The price is the USDC-weighted mean, divided by the token's dividend
multiplier, so it is per share of the underlying stock.

Everything is read in one call at one slot (Solana) or block (Base).

The response carries:

| Field | Meaning |
|-------|---------|
| `chain` | `base` or `solana` — the chain the price comes from |
| `price` | USD per share |
| `kind`, `note` | `onchain_dex_mid`, and a sentence saying it is the token's price on that chain, not an exchange quote |
| `token` | issuer, address, standard, decimals |
| `multiplier` | the dividend multiplier in force and any scheduled change (`next`) |
| `pools[]` | every pool: `dex`, `quote`, `price`, `quoteSideUsd`, `tvlUsd`, `weight`, `included`, `excludedReason`, `lastTxAt`, `ageSeconds` |
| `quoteSideUsd`, `tvlUsd`, `poolSpreadBps` | totals and the spread across the pools used |
| `staleWarning`, `staleWarningText` | present when it applies: `single_pool` (one pool priced it, nothing cross-checks it), `pools_disagree` (two pools more than 3% apart; the deeper one priced it), `inactive_pool` (a used pool with no transaction in 6 hours), `paused` |
| `slot` / `blockNumber`, `chainTime`, `readAt` | when and at what chain height it was read |
| `usMarket` | `session` (`pre`, `regular`, `post`, `closed`) and `nextOpen` |
| `asset` | on-chain token data, SEC EDGAR company facts, shares outstanding, and `marketCapUsd` (on-chain price × SEC shares; `null` when SEC has no single current count) |
| `otherChains` | whether the other gateway's chain has a market for the ticker, and its URL |

Neither failure after payment charges you; both answer `503` with
`payment_status: "not_charged"` and release the payment:

- `source_unavailable` — the chain could not be read in time. It carries
`Retry-After: 30`; retry with the same payment header.
- `no_qualifying_pool` — the ticker is listed but no pool qualifies right now
(thin, inactive or paused). No `Retry-After`: an immediate retry will not
help; check `otherChains` or try later.

---

## OHLC history

Crypto only. FX and commodity `/history` answer `501` (`"Historical bars are not
Expand Down Expand Up @@ -118,19 +181,20 @@ start in unix seconds). A valid symbol with no bars in the window returns
Free endpoints answer `HEAD` with a `402` whose body is x402
discovery metadata (`"error": "Payment Required (discovery)"`, `free: true`,
amount `0`) so indexers can register them — that is not a charge. A plain
`GET` returns `200` and the data. The equity `/price` and `/history` routes
answer `501` to every method, `HEAD` included.
`GET` returns `200` and the data. The US on-chain price answers `HEAD` with
its real `402` (the $0.005 requirement); an uncovered ticker answers `404`.
The routes that answer `501` do so to every method, `HEAD` included.

## Errors

| Status | Meaning | Charged? |
|--------|---------|----------|
| `400` | Bad `resolution`, missing/invalid `from`, or `to` ≤ `from` on `/history` | No |
| `402` | Discovery metadata (`HEAD`/`OPTIONS` on free feeds) | No |
| `404` | Symbol not covered (`"Symbol not covered by our free daily-close feeds"`, body has a `hint`), unknown `{market}`, or no bars in the requested window | No |
| `501` | Equity `/price` or `/history` (not currently served), or FX/commodity `/history` (no free OHLC source) | No |
| `402` | Discovery metadata (`HEAD`/`OPTIONS` on free feeds), or the payment challenge on the US on-chain price | No |
| `404` | Symbol not covered (`"Symbol not covered by our free daily-close feeds"`, body has a `hint`), `no_onchain_market` for a US ticker with no market on that chain, unknown `{market}`, or no bars in the requested window | No |
| `501` | US history, non-US `/price` or `/history`, or FX/commodity `/history` (no free OHLC source) | No |
| `502` | History upstream unavailable | No |
| `503` | The free price source for that symbol is not answering — `Retry-After: 60` | No |
| `503` | A free price source is not answering (`Retry-After: 60`); or, after payment, the chain could not be read (`source_unavailable`, `Retry-After: 30`) or no pool qualifies (`no_qualifying_pool`) — the payment is released | No |

## What's next?

Expand Down
2 changes: 1 addition & 1 deletion docs/mcp/blockrun-mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ blockrun_polymarket action:"buy" token_id:"<id>" amount_usd:5 order_type:"FOK" c

#### `blockrun_price`

Daily-close quotes for crypto, FX and commodities, plus crypto OHLC history — free (realtime feeds on request). Actions: `price`, `history`, `list`. The stock ticker catalog (`action:"list" category:"stocks"`) is free too, but equity quotes and history are not served: those calls return a `501` before any payment.
Daily-close quotes for crypto, FX and commodities, plus crypto OHLC history — free. Actions: `price`, `history`, `list`. US stock prices are on-chain and cost $0.005 (from `@blockrun/mcp` 0.56.0): `action:"price" category:"stocks" market:"us"` reads tokenized-stock DEX pools on your **active chain** (Base: Coinbase Tokenized Stocks; Solana: xStocks) and returns the price, every pool, the dividend multiplier, the US session and SEC company facts. The stock ticker catalog (`action:"list" category:"stocks"`) is free; US history and non-US quotes return a `501` before any payment.

#### `blockrun_dex`

Expand Down
10 changes: 8 additions & 2 deletions docs/mcp/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,15 @@ claude mcp add blockrun -s user -- npx -y @blockrun/mcp@latest

### `blockrun_price` says equity quotes are not served

**Cause:** Stock and US-equity price/history were withdrawn; the gateway answers `501` before any payment. Not an outage.
**Cause:** Only the US stock **price** is served, on-chain. US history and every non-US price/history answer `501` before any payment. Not an outage.

**Solution:** Nothing was charged and retrying will not help. The stock ticker catalog (`action:"list" category:"stocks"`) and crypto / FX / commodity quotes still work and are free.
**Solution:** Nothing was charged and retrying will not help. Use `action:"price" category:"stocks" market:"us"` for a US price ($0.005). The stock ticker catalog (`action:"list" category:"stocks"`) and crypto / FX / commodity quotes are free.

### `blockrun_price` says a US ticker has no on-chain market

**Cause:** The ticker has no tokenized-stock pool deep enough to price on your active chain. Base and Solana cover different tickers (for example, SPY trades as an xStock on Solana but is not issued on Base).

**Solution:** Nothing was charged. The answer's `otherChains` says whether the other chain has it; switch with `blockrun_wallet action:"chain"` if so.

### Modal sandbox charged more than expected

Expand Down
5 changes: 3 additions & 2 deletions docs/products/trading/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Earlier versions of these pages documented `alpha-mcp`, a standalone MCP server.
## What It Does

- **Technical Analysis** — `TradingSignal`: price, RSI, MACD, Bollinger Bands, volatility, and a bullish / bearish / neutral verdict, computed locally from live market data
- **Multi-asset market data** — `TradingMarket`: crypto spot, trending coins, market overview, FX pairs and commodities via the BlockRun gateway (the equity action is wired, but the gateway does not currently serve equity prices)
- **Multi-asset market data** — `TradingMarket`: crypto spot, trending coins, market overview, FX pairs and commodities via the BlockRun gateway, plus on-chain US stock prices (paid, from tokenized-stock DEX pools)
- **Paper trading** — open and close simulated positions at live prices, with a persistent portfolio and trade log across sessions
- **Prediction markets** — research odds across Polymarket, Kalshi and others (`PredictionMarket`), and place real bets on Polymarket (`PolymarketBet`)
- **DEX routes** — read-only quotes on Solana (Jupiter) and Base (0x)
Expand Down Expand Up @@ -57,7 +57,8 @@ Franklin calls `TradingSignal` and returns a signal report with a verdict. Signa
| Live market data | Crypto spot, trending, market overview | Free |
| Local indicators | RSI, MACD, Bollinger, volatility | Free (computed on your machine) |
| BlockRun gateway | FX pairs, commodities | Free |
| BlockRun gateway | Equity prices (12 markets) | Not currently served (the gateway answers `501`, nothing charged) |
| BlockRun gateway | US stock prices, on-chain | $0.005 per call |
| BlockRun gateway | Non-US equity prices | Not served (the gateway answers `501`, nothing charged) |
| BlockRun gateway | Prediction-market search, wallet profiles, smart money | Pay-per-call |
| BlockRun gateway | Read-only JSON-RPC across 40 chains | Pay-per-call |
| Jupiter (Solana) / 0x (Base) | DEX quotes | Free (quote only) |
Expand Down
2 changes: 1 addition & 1 deletion docs/products/trading/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Market data across asset classes.
- `overview` — top 20 by market cap (free)
- `fxPrice` — FX pairs like `EUR-USD` via the BlockRun gateway (free)
- `commodityPrice` — `XAU-USD` (gold), `XAG-USD` (silver), … (free)
- `stockPrice` — equities across `us`, `hk`, `jp`, `kr`, `gb`, `de`, `fr`, `nl`, `ie`, `lu`, `cn`, `ca` (`market` is required). The BlockRun gateway does not currently serve equity prices, so this action returns an error and nothing is charged — see [Market Data](../../api-reference/market-data.md)
- `stockPrice` — with `market: "us"`, the on-chain US stock price ($0.005, from tokenized-stock DEX pools on the gateway's chain). Other markets return an error from the gateway and nothing is charged — see [Market Data](../../api-reference/market-data.md)

**Example usage:**

Expand Down
3 changes: 2 additions & 1 deletion docs/resources/ecosystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ Projects, integrations, and partners building with BlockRun and x402. Every row
| **Prediction Markets** | `/api/v1/pm/*` | $0.0085 | ✅ Live |
| **DefiLlama** | `/api/v1/defillama/*` | $0.002–0.006 | ✅ Live |
| **Market Data** | `/api/v1/{crypto,fx,commodity}/*` | Free | ✅ Live |
| **Equity Prices** | `/api/v1/{usstock,stocks}/*` | — (ticker list free) | ⛔ Not served — price/history answer `501` before payment |
| **US Stock Prices (on-chain)** | `/api/v1/stocks/us/price/*` | $0.005 | ✅ Live — Base (Coinbase Tokenized Stocks) at blockrun.ai, Solana (xStocks) at sol.blockrun.ai |
| **Other Equity Data** | `/api/v1/{usstock,stocks}/*` | — (ticker list free) | ⛔ US history and non-US price/history answer `501` before payment |
| **RealFace Enrollment** | `/api/v1/realface/enroll` | $0.011 | ✅ Live |
| **Virtual Portrait** | `/api/v1/portrait/enroll` | $0.011 | ✅ Live |
| **Polymarket Funding** | `/api/v1/polymarket/fund` | $0.011 fee | ✅ Live |
Expand Down
2 changes: 1 addition & 1 deletion docs/sdks/go.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ answer, err := client.ExaAnswer(ctx, "What is x402?", nil)

### Market Data

Daily-close quotes and OHLC history for crypto, FX and commodities — free. Equity prices are not currently served: `CategoryStocks` / `CategoryUSStock` price and history calls answer `501`.
Daily-close quotes and OHLC history for crypto, FX and commodities — free. US stock prices are on-chain and paid ($0.005): a `CategoryStocks` price with market `us` (or `CategoryUSStock`) returns the on-chain price on Base; a ticker with no on-chain market answers `404` before payment. US history and non-US price/history answer `501`.

```go
btc, err := client.Price(ctx, blockrun.CategoryCrypto, "BTC-USD", nil)
Expand Down
2 changes: 1 addition & 1 deletion docs/sdks/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ bars = px.history("crypto", "BTC-USD", resolution="D", from_ts=now - 30 * 86400,
symbols = px.list_symbols("crypto", q="ETH", limit=20)
```

Equity prices are not currently served: `usstock` and `stocks` price/history calls answer `501` (the `list_symbols` catalog still answers, with `available: false`). Resolutions: `1,5,15,60,240,D,W,M`.
US stock prices are on-chain and paid ($0.005): `p.price("stocks", "NVDA", market="us")` returns the price plus every field the gateway sends (`chain`, `pools`, `multiplier`, `usMarket`, `asset`) as extra attributes. The Base client reads Base (Coinbase Tokenized Stocks); a ticker with no on-chain market answers `404` before payment. US history and non-US price/history answer `501`. Resolutions: `1,5,15,60,240,D,W,M`.

#### `SurfClient` — retired

Expand Down
Loading
Loading