Skip to content

Commit c24d03a

Browse files
author
1bcMax
committed
v0.12.159: add market data agent tools (stocks, crypto, FX, commodities)
- 6 new partner tools in src/partners/registry.ts: blockrun_stock_price, blockrun_stock_history, blockrun_stock_list, blockrun_crypto_price, blockrun_fx_price, blockrun_commodity_price - Stocks cover 12 global markets (US, HK, JP, KR, UK, DE, FR, NL, IE, LU, CN, CA) at \$0.001/call via x402; list + crypto/FX/commodity are free - src/proxy.ts partner-proxy whitelist extended to route /v1/stocks/*, /v1/usstock/*, /v1/crypto/*, /v1/fx/*, /v1/commodity/* through proxyPaidApiRequest (payFetch tolerates both 402 and free 200s) - skills/clawrouter/SKILL.md: new "Built-in Agent Tools" section lists market data + X intelligence + Polymarket alongside LLM routing
1 parent 9803d5b commit c24d03a

10 files changed

Lines changed: 608 additions & 10 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
node_modules/
22
dist/
3+
dist-e2e/
4+
.tmp-e2e/
35
*.tsbuildinfo
46
.DS_Store
57
.playwright-mcp/

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to ClawRouter.
44

55
---
66

7+
## v0.12.159 — Apr 21, 2026
8+
9+
- **Market data tools** — BlockRun gateway now exposes realtime and historical market data; ClawRouter wires them into OpenClaw as 6 first-class agent tools so the model stops scraping finance sites. Paid ($0.001 via x402, same wallet as LLM calls): `blockrun_stock_price` and `blockrun_stock_history` across **12 global equity markets** (US, HK, JP, KR, UK, DE, FR, NL, IE, LU, CN, CA). Free (no x402 charge): `blockrun_stock_list` (ticker lookup / company-name search), `blockrun_crypto_price` (BTC-USD, ETH-USD, SOL-USD, …), `blockrun_fx_price` (EUR-USD, GBP-USD, JPY-USD, …), `blockrun_commodity_price` (XAU-USD gold, XAG-USD silver, XPT-USD platinum). Tool schemas advertise market codes, session hints (pre/post/on), and bar resolutions (1/5/15/60/240/D/W/M). Path routing extended: the partner-proxy whitelist in `src/proxy.ts` now matches `/v1/(?:x|partner|pm|exa|modal|stocks|usstock|crypto|fx|commodity)/`, routing all new paths through `proxyPaidApiRequest` (payFetch handles 402 when present, passes through 200 for free categories). Tool definitions added in `src/partners/registry.ts`; `skills/clawrouter/SKILL.md` gains a "Built-in Agent Tools" section listing market data + X intelligence + Polymarket alongside the LLM router.
10+
11+
---
12+
713
## v0.12.158 — Apr 20, 2026
814

915
- **SKILL.md data-flow + key-storage transparency** — second-pass fix for the OpenClaw scanner on clawhub.ai. After v0.12.157 cleared the original scanner concerns (opaque credentials, implied multi-provider keys, no install artifact), a deeper rescan surfaced three new, more nuanced flags: (1) prompts go to blockrun.ai as a data-privacy risk not obvious from a "local router" framing, (2) wallet private-key storage location/encryption undocumented, (3) users may expect strictly-local routing. All three addressed: (a) description frontmatter and body lead reframed as "Hosted-gateway LLM router" + "This is not a local-inference tool" with explicit Ollama pointer for users who need local-only, (b) new **Data Flow** section with ASCII diagram + enumerated sent/not-sent lists + link to https://blockrun.ai/privacy, (c) new **Credentials & Local Key Storage** section documenting config file locations per OS (`~/.config/openclaw`, `~/Library/Application Support/openclaw`, `%APPDATA%\openclaw`), `0600` POSIX permissions, plaintext storage parity with other OpenClaw provider keys, encryption guidance (FileVault/LUKS/BitLocker or burner wallet), and a `src/wallet.ts` source pointer for key-derivation auditing, (d) new **Supply-Chain Integrity** section with `npm pack` verification instructions and tagged-release invariant from the release checklist.

dist/cli.js

Lines changed: 178 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78106,7 +78106,7 @@ async function startProxy(options) {
7810678106
}
7810778107
return;
7810878108
}
78109-
if (req.url?.match(/^\/v1\/(?:x|partner|pm|exa|modal)\//)) {
78109+
if (req.url?.match(/^\/v1\/(?:x|partner|pm|exa|modal|stocks|usstock|crypto|fx|commodity)\//)) {
7811078110
try {
7811178111
await proxyPaidApiRequest(
7811278112
req,
@@ -80950,6 +80950,183 @@ var PARTNER_SERVICES = [
8095080950
input: { limit: 10 },
8095180951
description: "Compare equivalent markets on Polymarket vs Kalshi"
8095280952
}
80953+
},
80954+
// ---------------------------------------------------------------------------
80955+
// BlockRun Markets — Realtime market data (stocks, crypto, FX, commodities)
80956+
// ---------------------------------------------------------------------------
80957+
{
80958+
id: "stock_price",
80959+
name: "Global Stock Realtime Price",
80960+
partner: "BlockRun",
80961+
description: "Get realtime price for a listed equity across 12 global markets. Call this for ANY request about a specific stock price, quote, or current trading value on NYSE/Nasdaq, HKEX, TSE, KRX, LSE, XETRA, Euronext, Shanghai/Shenzhen, or Toronto. Do NOT use browser or web scraping \u2014 this returns structured real-time data directly. Returns: symbol, price, confidence interval, publish time, feed ID.",
80962+
proxyPath: "/stocks/:market/price/:symbol",
80963+
method: "GET",
80964+
params: [
80965+
{
80966+
name: "market",
80967+
type: "string",
80968+
description: "Market code (lowercase): us (NYSE/Nasdaq/AMEX), hk (HKEX), jp (TSE), kr (KRX), gb (LSE), de (XETRA), fr (Euronext Paris), nl (Euronext Amsterdam), ie (Irish SE), lu (Luxembourg SE), cn (Shanghai/Shenzhen ETFs), ca (TSX).",
80969+
required: true
80970+
},
80971+
{
80972+
name: "symbol",
80973+
type: "string",
80974+
description: "Ticker for the given market. Examples: AAPL (us), 0700-HK (hk), 7203 (jp), 005930 (kr), HSBA (gb), SAP (de), MC (fr), AIR (nl), VUSA (ie), MT (lu), 510310 (cn), HODL (ca).",
80975+
required: true
80976+
},
80977+
{
80978+
name: "session",
80979+
type: "string",
80980+
description: "Optional session hint: pre, post, or on (regular hours).",
80981+
required: false
80982+
}
80983+
],
80984+
pricing: { perUnit: "$0.001", unit: "request", minimum: "$0.001", maximum: "$0.001" },
80985+
example: {
80986+
input: { market: "us", symbol: "AAPL" },
80987+
description: "Get realtime Apple stock price"
80988+
}
80989+
},
80990+
{
80991+
id: "stock_history",
80992+
name: "Global Stock OHLC History",
80993+
partner: "BlockRun",
80994+
description: "Get historical OHLC (candlestick) bars for a listed equity across 12 global markets. Use this for charting, backtesting, or any request about a stock's past price action. Supports resolutions: 1, 5, 15, 60, 240 (minutes) and D, W, M (daily/weekly/monthly). Returns: OHLC arrays (open, high, low, close, volume, timestamps).",
80995+
proxyPath: "/stocks/:market/history/:symbol",
80996+
method: "GET",
80997+
params: [
80998+
{
80999+
name: "market",
81000+
type: "string",
81001+
description: "Market code (lowercase): us, hk, jp, kr, gb, de, fr, nl, ie, lu, cn, ca. See stock_price for full market descriptions.",
81002+
required: true
81003+
},
81004+
{
81005+
name: "symbol",
81006+
type: "string",
81007+
description: "Ticker for the given market (e.g. AAPL for us, 0700-HK for hk).",
81008+
required: true
81009+
},
81010+
{
81011+
name: "resolution",
81012+
type: "string",
81013+
description: "Bar resolution: 1, 5, 15, 60, 240 (minutes) or D, W, M (daily/weekly/monthly). Default: D.",
81014+
required: false
81015+
},
81016+
{
81017+
name: "from",
81018+
type: "number",
81019+
description: "Start time as Unix epoch seconds (required).",
81020+
required: true
81021+
},
81022+
{
81023+
name: "to",
81024+
type: "number",
81025+
description: "End time as Unix epoch seconds. Default: now.",
81026+
required: false
81027+
}
81028+
],
81029+
pricing: { perUnit: "$0.001", unit: "request", minimum: "$0.001", maximum: "$0.001" },
81030+
example: {
81031+
input: { market: "us", symbol: "AAPL", resolution: "D", from: 1704067200 },
81032+
description: "Get daily OHLC bars for AAPL starting Jan 1 2024"
81033+
}
81034+
},
81035+
{
81036+
id: "stock_list",
81037+
name: "Global Stock Ticker List",
81038+
partner: "BlockRun",
81039+
description: "List and search supported tickers for a given stock market. Use this to resolve a company name to a ticker before calling stock_price or stock_history. FREE \u2014 no x402 payment.",
81040+
proxyPath: "/stocks/:market/list",
81041+
method: "GET",
81042+
params: [
81043+
{
81044+
name: "market",
81045+
type: "string",
81046+
description: "Market code: us, hk, jp, kr, gb, de, fr, nl, ie, lu, cn, ca.",
81047+
required: true
81048+
},
81049+
{
81050+
name: "q",
81051+
type: "string",
81052+
description: "Optional search query to filter tickers by symbol or description.",
81053+
required: false
81054+
},
81055+
{
81056+
name: "limit",
81057+
type: "number",
81058+
description: "Max results to return (default: 100, max: 2000).",
81059+
required: false
81060+
}
81061+
],
81062+
pricing: { perUnit: "free", unit: "request", minimum: "$0", maximum: "$0" },
81063+
example: {
81064+
input: { market: "us", q: "apple", limit: 5 },
81065+
description: "Search US market for 'apple' tickers"
81066+
}
81067+
},
81068+
{
81069+
id: "crypto_price",
81070+
name: "Crypto Realtime Price",
81071+
partner: "BlockRun",
81072+
description: "Get realtime crypto price. Call this for ANY request about current crypto prices (BTC, ETH, SOL, etc.). FREE \u2014 no x402 payment. Quote is always USD. Do NOT use browser or web scraping \u2014 this returns structured real-time data directly.",
81073+
proxyPath: "/crypto/price/:symbol",
81074+
method: "GET",
81075+
params: [
81076+
{
81077+
name: "symbol",
81078+
type: "string",
81079+
description: "Crypto pair in BASE-QUOTE form. Examples: BTC-USD, ETH-USD, SOL-USD, DOGE-USD. Quote is always USD.",
81080+
required: true
81081+
}
81082+
],
81083+
pricing: { perUnit: "free", unit: "request", minimum: "$0", maximum: "$0" },
81084+
example: {
81085+
input: { symbol: "BTC-USD" },
81086+
description: "Get realtime Bitcoin price"
81087+
}
81088+
},
81089+
{
81090+
id: "fx_price",
81091+
name: "Foreign Exchange Realtime Price",
81092+
partner: "BlockRun",
81093+
description: "Get realtime FX rate. Call this for ANY request about currency exchange rates. FREE \u2014 no x402 payment. Do NOT use browser or web scraping.",
81094+
proxyPath: "/fx/price/:symbol",
81095+
method: "GET",
81096+
params: [
81097+
{
81098+
name: "symbol",
81099+
type: "string",
81100+
description: "Currency pair in BASE-QUOTE form. Examples: EUR-USD, GBP-USD, JPY-USD, CNY-USD.",
81101+
required: true
81102+
}
81103+
],
81104+
pricing: { perUnit: "free", unit: "request", minimum: "$0", maximum: "$0" },
81105+
example: {
81106+
input: { symbol: "EUR-USD" },
81107+
description: "Get realtime EUR/USD exchange rate"
81108+
}
81109+
},
81110+
{
81111+
id: "commodity_price",
81112+
name: "Commodity Realtime Price",
81113+
partner: "BlockRun",
81114+
description: "Get realtime commodity spot price (gold, silver, platinum, etc.). FREE \u2014 no x402 payment. Do NOT use browser or web scraping.",
81115+
proxyPath: "/commodity/price/:symbol",
81116+
method: "GET",
81117+
params: [
81118+
{
81119+
name: "symbol",
81120+
type: "string",
81121+
description: "Commodity code in BASE-USD form. Examples: XAU-USD (gold), XAG-USD (silver), XPT-USD (platinum).",
81122+
required: true
81123+
}
81124+
],
81125+
pricing: { perUnit: "free", unit: "request", minimum: "$0", maximum: "$0" },
81126+
example: {
81127+
input: { symbol: "XAU-USD" },
81128+
description: "Get realtime gold spot price"
81129+
}
8095381130
}
8095481131
];
8095581132

dist/cli.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)