
Market Data
bitcoin-price-feed
Provides a real-time Bitcoin price feed via the Bitquery GraphQL WebSocket, streaming live OHLC ticks, volume, and on-the-fly derived metrics (mean, SMA, EMA, WMA, and tick-to-tick percent change).
概要
Provides a real-time Bitcoin price feed via the Bitquery GraphQL WebSocket, streaming live OHLC ticks, volume, and on-the-fly derived metrics (mean, SMA, EMA, WMA, and tick-to-tick percent change).
Provides a real-time Bitcoin price feed via the Bitquery GraphQL WebSocket, streaming live OHLC ticks, volume, and on-the-fly derived metrics (mean, SMA, EMA, WMA, and tick-to-tick percent change). Because data is pushed over a WebSocket (no polling), consumers get low-latency updates suitable for trading systems, live dashboards, alerting, and algorithmic strategies. Built-in streaming calculations reduce client-side computation and bandwidth. The skill requires a BITQUERY_API_KEY passed as a query parameter in the WebSocket URL, so follow secure practices: keep the key in environment variables, avoid logging full URLs, and rotate if exposed. Use this skill when you need continuous, low-latency BTC market data or streaming indicators for visualization, automated signals, or prototype trading analytics.
Skill.md
この Skill の仕組み
Provides a real-time Bitcoin price feed via the Bitquery GraphQL WebSocket, streaming live OHLC ticks, volume, and on-the-fly derived metrics (mean, SMA, EMA, WMA, and tick-to-tick percent change).
Bitcoin price feed — real-time streaming
This skill gives you a real-time streaming Bitcoin price feed over WebSocket: live OHLC ticks, volume, and derived metrics on the stream (Mean, SMA, EMA, WMA, and tick-to-tick % change). Data is streamed in real time from the Bitquery API — no polling.
When to use this skill
- Stream the Bitcoin price in real time (live feed)
- Get derived metrics on the stream: moving averages and % change per tick
- Live OHLC and volume for trading or dashboards
What to consider before installing
This skill implements a Bitquery WebSocket Bitcoin price stream and uses one external dependency and one credential. Before installing:
- Registry metadata: The registry may not list
BITQUERY_API_KEYeven though this skill and its script require it. Ask the publisher or update the registry metadata before installing so installers surface the secret requirement. - API key in URL: The API key must be passed in the WebSocket URL as a query parameter, which can leak to logs or histories. Avoid printing the full URL, store the key in a secure environment variable, and rotate it if it may have been exposed.
- Sandbox first: Review and run the included script in a sandboxed environment (e.g. a virtualenv) to confirm behavior and limit blast radius.
- Source and publisher: If the skill’s homepage or source is unknown, consider verifying the publisher or using an alternative with a verified source. If the registry metadata declares
BITQUERY_API_KEYand the source/publisher are validated, this skill is likely coherent and benign.
Prerequisites
- Environment:
BITQUERY_API_KEY— your Bitquery API token (required). The token must be passed in the WebSocket URL only as?token=...(e.g.wss://streaming.bitquery.io/graphql?token=YOUR_KEY); Bitquery does not support header-based auth for this endpoint. Because the token appears in the URL, it can show up in logs, monitoring tools, or browser/IDE history — treat it as a secret and avoid logging or printing the full URL. - Runtime: Python 3 and
pip. Install the dependency:pip install 'gql[websockets]'.
Step 1 — Check API Key
import os
api_key = os.getenv("BITQUERY_API_KEY")
if not api_key:
print("ERROR: BITQUERY_API_KEY environment variable is not set.")
print("Run: export BITQUERY_API_KEY=your_token")
exit(1)
If the key is missing, tell the user and stop. Do not proceed without it.
Step 2 — Run the stream
Install the WebSocket dependency once:
pip install 'gql[websockets]'
Use the streaming script (subscribes to the Bitcoin price feed in real time):
python ~/.openclaw/skills/bitcoin-price-feed/scripts/stream_bitquery.py
Optional: stop after N seconds:
python ~/.openclaw/skills/bitcoin-price-feed/scripts/stream_bitquery.py --timeout 60
Or subscribe inline with Python (real-time stream):
import asyncio
from gql import Client, gql
from gql.transport.websockets import WebsocketsTransport
async def main():
token = os.environ["BITQUERY_API_KEY"]
url = f"wss://streaming.bitquery.io/graphql?token={token}"
transport = WebsocketsTransport(
url=url,
headers={"Sec-WebSocket-Protocol": "graphql-ws"},
)
async with Client(transport=transport) as session:
sub = gql("""
subscription {
Trading {
Tokens(where: {Currency: {Id: {is: "bid:bitcoin"}}, Interval: {Time: {Duration: {eq: 1}}}}) {
Token { Name Symbol Network }
Block { Time }
Price { Ohlc { Open High Low Close } Average { Mean SimpleMoving ExponentialMoving } }
Volume { Usd }
}
}
}
""")
async for result in session.subscribe(sub):
print(result) # each tick streamed in real time
asyncio.run(main())
Step 3 — What you get on the stream
Each tick includes:
- OHLC (Open, High, Low, Close) and Volume (USD) for the 1-second interval
- Derived metrics (from Bitquery): Mean, SimpleMoving (SMA), ExponentialMoving (EMA), WeightedSimpleMoving (WMA)
- Session-derived: % change vs previous tick (computed from the stream)
The stream runs until you stop it (Ctrl+C) or use --timeout.
Step 4 — Format output clearly
When presenting streamed ticks to the user, use a clear format like:
Bitcoin (BTC) — ethereum network @ 2025-03-06T14:00:00Z
OHLC:
Open: $85,200.00 High: $86,100.00 Low: $84,950.00 Close: $85,780.00
Derived (on stream):
Mean: $85,500.00 SMA: $85,400.00 EMA: $85,520.00
Tick Δ: +0.12% vs previous
Volume (USD): $1,234,567.00
Interval (subscription)
The default subscription uses duration 1 (1-second tick data). The same Trading.Tokens subscription supports other durations in the where clause (e.g. 5, 60, 1440 for 5m, 1h, 1d candles) if the API supports them for subscriptions.
Error handling
- Missing BITQUERY_API_KEY: Tell user to export the variable and stop
- WebSocket connection failed / 401: Token invalid or expired (auth is via URL
?token=only — do not pass the token in headers) - Subscription errors in payload: Log the error message and stop cleanly (send complete, close transport)
- No ticks received: Check token and network; Bitquery may need a moment to send the first tick
Reference
Full field reference is in references/graphql-fields.md. Use it to add filters or request extra fields (e.g. date range) in the subscription.
こんな用途に最適
どんなときに使うか
Provides a real-time Bitcoin price feed via the Bitquery GraphQL WebSocket, streaming live OHLC ticks, volume, and on-the-fly derived metrics (mean, SMA, EMA, WMA, and tick-to-tick percent change).

01 · 会議前
意思決定用のブリーフを準備
投資委員会の前に、散らばった材料を構造化した論拠にまとめます。

02 · チームのワークフロー
引き継ぎを標準化
アナリスト、ポートフォリオマネージャー、Agent の間で一貫したリサーチ成果物を作ります。

03 · リアルタイム更新
投資仮説をアップデート
新しいカタリスト、KPI の発表、決算結果を受けてシナリオを更新します。
コミュニティのメモ
使うほど良くなる設計。
この Skill が使われ、レビューされるにつれて、フィードバックがここに表示されます。
さらに探す
関連する Skills
すべて見るgmgn-market
gmgn-market is a CLI-driven Skill for retrieving crypto and meme-token market data: K-line (candlestick/OHLCV) charts, trending token rankings by USD volume, Trenches token lists, and newly launched…
crypto-price
This Skill retrieves cryptocurrency prices and generates dark-themed candlestick charts via a simple CLI. Invoke the script with a token symbol and optional duration (e.g., 30m, 3h, 12h, 2d) to…
cmc-api-crypto
This skill documents the CoinMarketCap (CMC) Cryptocurrency REST API for programmatic access to market and token data. It details authentication (API key via X-CMC_PRO_API_KEY), base URL, and…