Cross-asset price monitor
Side-by-side snapshot of a stock and a crypto asset: the equity's latest close against a live crypto quote, a trailing-year series for each, and a date-stamped comparison.
5 tools run server-side in one request. You pay once, settle once, and get a single response - no orchestration, no per-step payments, and a partial-success envelope if any step fails. Paid in USDC over x402 or MPP; this pack has no proof-of-work tier.
When to use this pack
An agent or analyst wants to compare a traditional equity with a crypto asset - e.g. 'How has AAPL performed versus BTC over the last year?' Running stock-quote and crypto-price individually gives two disconnected numbers; adding historical data from both sides plus a date-format timestamp turns it into a dated comparison card the caller can track over time or feed into a report. Useful for portfolio dashboards, market-update bots, newsletter generators, and any agent that needs a quick cross-asset health check.
Tools in this pack
All 5 run inside the single $0.021 call above. Each is also callable on its own if you only need one part.
- Stock quote GET /api/stock-quote End-of-day US equity quote: last close, day range, consolidated volume, previous close and the change between them. US equities only; indices, FX and crypto are not covered (crypto-price serves those). Built from the official consolidated end-of-day summary across all US exchanges and ATSs, so price, range and volume are market totals. If that dataset is unavailable for a read, the answer comes from a consolidation of three U.S. exchange venues instead and says so: coverage reads three-venue, venueVolume counts those venues only and volume is null. No 52-week range and no intraday print: for a date range call stock-history. Each answer names its dataset and coverage, and says whether its bars came from this session's cache (cached, fetchedAt).
- Stock historical bars GET /api/stock-history Daily OHLCV bars for a US equity: the last `days` sessions, 1 to 250, default 30. Daily only, no intraday. Built from the official consolidated end-of-day summary across all US exchanges and ATSs, so price, range and volume are market totals. If that dataset is unavailable for a read, the answer comes from a consolidation of three U.S. exchange venues instead and says so: coverage reads three-venue, venueVolume counts those venues only and volume is null. On that fallback each bar's high and low are the extremes across the three venues and open and close come from the venue that traded the most that session. A flat ascending array ready for charting or backtests. Set indicators to also get technical analysis computed from the same bars: RSI(14), MACD(12,26,9), EMA 20/50/200, SMA 20/50, Bollinger(20,2) and ATR(14), with a plain summary (close vs EMA50, RSI zone, MACD cross). Indicators need enough sessions (EMA200 needs days >= 200) and are descriptive, not a trading recommendation.
- Crypto price GET /api/crypto-price Live crypto prices for one or many coins in any vs_currency (usd, eur, btc, eth, etc). Returns last price, 24h change %, 24h volume, and market cap per coin. The simplest crypto price read - for ranked market-cap tables use crypto-market, for candles use crypto-history. Accepts ticker symbols (BTC, ETH, SOL) for the top ~50 by market cap, or canonical coin ids (e.g. "render-token") for any of the ~15k tracked coins. Batched: up to 25 coins per call. Data provided by CoinGecko.
- Crypto price history GET /api/crypto-history Historical price, market cap, and volume time series for a coin. Granularity is automatic: <=1 day = 5-min bars, 2-90 days = hourly, >90 days = daily. Days: 1, 7, 14, 30, 90, 180, 365, or "max". Returns aligned arrays of {time, price, marketCap, volume}. Data provided by CoinGecko.
- Date format GET /api/date-format Parse a datetime from any format (ISO 8601, Unix timestamp in seconds or milliseconds, RFC 2822, or natural date string) and return it in every common format: ISO 8601, Unix (seconds), Unix (ms), RFC 2822, date-only, time-only, day of week, and human-relative (e.g. '3 days ago'). ?datetime=1719100800.
Bought one at a time, these 5 tools cost $0.023 together; the pack is that sum less a 10% bundle discount, rounded up to the $0.001 settlement floor, which is $0.021.
Workflow
- Call date-format with datetime='now' (or the current ISO timestamp) to get a formatted snapshot timestamp - ISO, date-only, and day of week. This anchors the comparison to a specific point in time so the caller can track changes across repeated runs. The unix timestamp is useful as a cache key or filename.
- Call stock-quote with symbol=<ticker> to get the equity's latest close: price, previousClose, changeAbs, changePct, dayHigh, dayLow and volume. This is end-of-day, not an intraday print; volume is the consolidated market total (null, with coverage three-venue, when a read fell back to three venues) - note the timestamp from step 1 so the caller knows which session it is.
- Call stock-history with symbol=<ticker> and days=250 to get a trailing-year price series (250 sessions is the maximum this endpoint serves). Extract the first and last data points to compute the year-over-year return: ((last - first) / first * 100). This is the equity's trailing-12-month performance.
- Call crypto-price with coins=<coin> and currency=usd to get the live crypto price: price, market_cap, 24h_volume, 24h_change. This is the 'right now' read for the crypto side.
- Call crypto-history with coin=<coin>, days=365, and currency=usd to get the 1-year price series. Compute the year-over-year return the same way as step 3, then return { timestamp: <step 1>, stock: { symbol, price, change, changePercent, yearReturn }, crypto: { coin, price, change24h, yearReturn }, comparison: { stockOutperforms: stockYearReturn > cryptoYearReturn, spreadPct: Math.abs(stockYearReturn - cryptoYearReturn) } } as the final payload.
Arguments
| Name | Required | Description | Example |
|---|---|---|---|
ticker | yes | Stock ticker symbol (e.g. AAPL, MSFT, TSLA) | AAPL |
coin | yes | Crypto coin ID (e.g. bitcoin, ethereum, solana) | bitcoin |
What one call returns
A JSON object with pack, args, steps, summary; steps holds one entry per tool (stock-quote, stock-history, crypto-price, crypto-history, date-format), each with its own result or error. Full example on the API page.
Call it directly
Any x402 client pays the 402 and gets the whole workflow back in one response. With the agent402-client SDK (npm i agent402-client, an ES module):
import { Agent402 } from "agent402-client";
// payFetch: an x402-wrapped fetch your wallet signs (@x402/fetch).
// Tools on the free tier need no options: new Agent402() pays them by proof-of-work.
// an existing prepaid credits key also works: new Agent402({ creditsKey })
const client = new Agent402({ fetch: payFetch });
const result = await client.call("skill-price-monitor", {"ticker":"AAPL","coin":"bitcoin"});
Run it in Claude
claude mcp add agent402 -s user -- npx -y [email protected]
Then paste this prompt into Claude:
Build a cross-asset price comparison for ticker=AAPL vs coin=bitcoin using Agent402.
(1) date-format with datetime=new Date().toISOString() - returns {iso, date, dayOfWeek, unix}. Save as snapshot timestamp.
(2) stock-quote with symbol=AAPL - returns {price, previousClose, changeAbs, changePct, dayHigh, dayLow, volume, venueVolume, coverage}.
(3) stock-history with symbol=AAPL, days=250 - returns {bars: [{day, close}]}. Compute stockYearReturn = ((bars[last].close - bars[0].close) / bars[0].close * 100).toFixed(2).
(4) crypto-price with coins=bitcoin, currency='usd' - returns [{price, market_cap, change_24h}].
(5) crypto-history with coin=bitcoin, days='365', currency='usd' - returns {prices: [[timestamp, price]]}. Compute cryptoYearReturn = ((prices[last][1] - prices[0][1]) / prices[0][1] * 100).toFixed(2).
Final return: {timestamp: {iso: <step 1 iso>, date: <step 1 date>, dayOfWeek: <step 1 dayOfWeek>}, stock: {symbol: 'AAPL', price: <step 2 price>, change: <step 2 change>, changePercent: <step 2 changePercent>, yearReturn: stockYearReturn}, crypto: {coin: 'bitcoin', price: <step 4 price>, change24h: <step 4 change_24h>, yearReturn: cryptoYearReturn}, comparison: {stockOutperforms: parseFloat(stockYearReturn) > parseFloat(cryptoYearReturn), spreadPct: Math.abs(parseFloat(stockYearReturn) - parseFloat(cryptoYearReturn)).toFixed(2)}}. Budget ~$0.005 paid; all 5 tools are wallet-only (external API calls).