Agent skill

Market Data Source Router

by HKUDS in HKUDS/Vibe-Trading

Maps backtest data sources and research data needs to the right provider or tool, with each one's markets, required environment keys and network constraints.

MITAuto-check passedBusiness, Finance & HR

Install Market Data Source Router

skills CLI
$ npx skills add HKUDS/Vibe-Trading --skill data-routing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install HKUDS/Vibe-Trading data-routing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/HKUDS/Vibe-Trading.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agent/src/skills/data-routing .claude/skills/data-routing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
data-routing
GitHub stars
35k
Token cost
~2.4k tokens
SKILL.md length
1,068 words
Files
1
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

Maps backtest data sources and research data needs to the right provider or tool, with each one's markets, required environment keys and network constraints.

  • Works in 3 steps: Identify the data need, then read the… → If the need is plain OHLCV, call… → Set any required env key before calling…
  • Choosing a data source before running a backtest on A-shares, US stocks or crypto
  • SKILL.md covers Source Overview, Capability → Tool Routing, Decision Tree and Symbol Format Reference, plus 2 more sections
  • Needs TUSHARE_TOKEN and FINNHUB_API_KEY

What it does

This skill is a lookup table the agent loads before any backtest, data fetch or research task. It lists every registered backtest data source with the markets it covers, whether it needs an environment key, what network access it needs and which skill documents it. Examples include tushare for A-shares (needing a TUSHARE_TOKEN), akshare, yfinance, okx and ccxt for crypto, baostock, tencent, mootdx, eastmoney, futu through a local OpenD gateway, MetaTrader 5 and a hosted tickerall feed, and local CSV or parquet files.

A second part maps each research data need to the concrete tool that serves it, its market and its required key. The aim is to pick the best available source, respect authentication requirements and avoid providers that carry a ban risk. Some sources are chosen only by explicit request, such as the Iran-market crypto feeds or tickerall. The excerpt is cut off partway through the source table.

When your agent uses it

  • Choosing a data source before running a backtest on A-shares, US stocks or crypto
  • Checking which environment keys a data provider requires
  • Finding the right tool for a research data need without hitting rate limits or bans

Example prompts

  • “Which data source should I use to backtest Hong Kong stocks without an API token?”
  • “I need daily crypto candles from OKX, so what access does that require?”
  • “Route this research task and tell me which environment keys I need to set first.”

Requirements

  • Environment keys for the chosen provider, such as TUSHARE_TOKEN for tushare

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Identify the data need, then read the Capability table for the tool + env key.
  2. If the need is plain OHLCV, call get_market_data and let source fallback run.
  3. Set any required env key before calling a key-gated tool; if it is missing,

What it can do on your machine

Read from SKILL.md and the folder at commit 7f6908b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • TUSHARE_TOKEN
    • FINNHUB_API_KEY
    • ALPHAVANTAGE_API_KEY
    • TIINGO_API_KEY
    • FMP_API_KEY
    • FRED_API_KEY
    • VIBE_TRADING_IWENCAI_KEY
    • TICKERALL_API_KEY
    • GILDATA_TOKEN
    • QVERIS_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Market Data Source Router loads about 2.4k tokens when it runs. Until then it costs about 55 tokens; SKILL.md has 1,068 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~55
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from HKUDS/Vibe-Trading at commit 7f6908b, republished under its MIT licence (© HKUDS). 1,068 words, ~2,407 tokens.

Download SKILL.mdSave it as .claude/skills/data-routing/SKILL.md (or your agent's skills folder).
name
data-routing
description
The single ROUTER for every data need. Load this skill BEFORE any backtest, data-fetch, or research task to pick the best available source/tool, honour auth (env) requirements, and avoid ban-risk providers.
category
data-source

Data Routing (Router)

This is the one router. It maps (a) every registered backtest data source to its markets / auth / skill, and (b) every research data need to the concrete tool that serves it, its market, and the env key it requires. Source names below are a strict subset of backtest.loaders.registry.VALID_SOURCES (enforced by tests/test_data_routing_sources_subset.py).

Source Overview

Every name here is a registered OHLCV/backtest source in VALID_SOURCES. "Runner-internal" sources are selected by the backtest runner, not authored as a per-source skill.

SourceMarketsAuth (env key)NetworkSkill
tushareA-shares, funds, futures, macroYes (TUSHARE_TOKEN)China networktushare
akshareA-shares, US, HK, futures, macro, forexNoUnrestrictedakshare
yfinanceUS, HK, Canada (TSX/TSXV) stocks, ETFsNoNeeds Yahoo accessyfinance
okxCrypto (OKX exchange)NoNeeds okx.com accessokx-market
nobitexCrypto, IRT/Toman-quoted pairs (BTC-IRT, USDT-IRT — Iran market premium)NoNeeds apiv2.nobitex.ir accessdata-routing (explicit *IRT routing only)
wallexCrypto, TMN/Toman-quoted pairs (USDT-TMN, BTC-TMN — Iran market premium)NoNeeds api.wallex.ir accessdata-routing (explicit *TMN routing only; truly serves 1m/1h/1d)
ccxtCrypto (100+ exchanges)NoNeeds exchange accessccxt
baostockA-shares (free daily/min)NoChina networkdata-routing
tencentA-shares, HK, US (never-banned)NoUnrestricteddata-routing
mootdxA-shares (TDX servers, never-banned)NoChina networkdata-routing
futuA/HK/US via OpenD gatewayYes (OpenD running)Local gatewaydata-routing (runner-internal)
mt5Forex & metals (your broker's MT5 feed)Yes (running, logged-in MT5 terminal; optional ~/.vibe-trading/mt5.json)Local terminal (Windows)data-routing (runner-internal)
tickerallForex & metals (same broker MT5 feed, hosted)Yes (TICKERALL_API_KEY + TICKERALL_ACCOUNT_ID; read-only)Hosted API (any OS, no terminal)data-routing (runner-internal; explicit source=tickerall only)
localUser CSV/parquet on diskNoOfflinedata-routing (runner-internal)
eastmoneyA-shares, HK, US equitiesNo (IP-throttled)Unrestricteddata-routing
sinaUS equities (daily OHLCV)No (IP-throttled)Unrestricteddata-routing
stooqUS equities (daily OHLCV)NoUnrestricteddata-routing
yahooUS, HK, Canada (TSX/TSXV) equitiesNo (IP-throttled)Needs Yahoo accessdata-routing
finnhubUS equitiesYes (FINNHUB_API_KEY)Unrestricteddata-routing
alphavantageUS equitiesYes (ALPHAVANTAGE_API_KEY)Unrestricteddata-routing
tiingoUS equitiesYes (TIINGO_API_KEY)Unrestricteddata-routing
fmpUS equitiesYes (FMP_API_KEY)Unrestricteddata-routing
gildataA-shares (Hundsun Juyuan commercial feed, forward-adjusted dailies)Yes (GILDATA_TOKEN / Settings)Gildata MCP APIdata-routing
qverisGlobal multi-asset (paid, credits)Yes (QVERIS_API_KEY / Settings)QVeris APIqveris <!-- QVERIS-INTEGRATION -->

Capability → Tool Routing

Pick the tool by the data need. "Market" is the universe the tool covers; "Env key" is required only where listed (no key listed = free / no auth).

Data needToolMarketEnv key
OHLCV price barsget_market_dataA-share / US / HK / Canada / crypto / futures / forexper-source (see Source Overview)
Fund flow (资金流向)get_fund_flowA-share, HK, US—
Dragon-tiger (龙虎榜)get_dragon_tigerA-share—
Northbound flow (北向资金)get_northbound_flowA-share—
Margin trading (融资融券)get_margin_tradingA-share—
Block trades (大宗交易)get_block_tradesA-share—
Shareholder count (股东户数)get_shareholder_countA-share—
Lockup expiry (限售解禁)get_lockup_expiryA-share—
Sector / board taxonomy (板块)get_sector_infoA-share—
Sell-side research reportsget_research_reportsA-share—
Stock newsget_stock_newsA-share, US, HK—
SEC filings (EDGAR)get_sec_filingsUS—
Financial statementsget_financial_statementsA-share, US, HK—
Options chainget_options_chainUS—
Stock profile / fundamentalsget_stock_profileUS—
Market screenscreen_marketA-share—
Symbol searchsearch_symbolA-share, US, HK, Canada, crypto/index/FX—
Macro / FRED seriesget_macro_seriesMacro (US/global)FRED_API_KEY
iWenCai NL search (问财)iwencai_searchA-shareVIBE_TRADING_IWENCAI_KEY

Notes:

  • get_financial_statements reads US statements from SEC EDGAR companyfacts (ticker -> CIK -> XBRL concepts) and A-share/HK statements from the Eastmoney datacenter report API (per-market F10 report names).
  • get_stock_news routes A-share (SH/SZ/BJ) to an Eastmoney news client and US (.US) / HK (.HK) to a Yahoo search client; a failure on one upstream is returned as an error envelope, never raised, so a single bad symbol never aborts a batch.

Decision Tree

Backtest scenario (writing config.json)

Use source: "auto" — the runner routes by symbol pattern and falls back across same-market sources automatically. Only set a concrete source when the user asks.

Analysis / research scenario
  1. Identify the data need, then read the Capability table for the tool + env key.
  2. If the need is plain OHLCV, call get_market_data and let source fallback run.
  3. Set any required env key before calling a key-gated tool; if it is missing, report the missing key rather than failing silently.
Show full SKILL.md (409 more words)Show less
Source priority (for OHLCV by market)
  • A-shares: tencent / mootdx (never banned) > tushare (TUSHARE_TOKEN) > baostock / akshare > eastmoney (throttled).
  • US stocks: stooq / yahoo > tiingo / finnhub / fmp / alphavantage (key-gated) > sina / eastmoney (throttled) > yfinance.
  • HK stocks: tencent (never banned, daily) > eastmoney / yahoo > futu (local OpenD) > akshare (Eastmoney-backed, daily only) > yfinance > tushare (TUSHARE_TOKEN) / longbridge (key-gated).
  • Canada (TSX/TSXV): yahoo > yfinance > local; use Yahoo's canonical .TO / .V suffixes (for example TD.TO, PNG.V).
  • Crypto: okx (single exchange) > ccxt (multi-exchange).
  • Futures / macro: tushare > akshare.
  • Forex / metals: mt5 (local MetaTrader 5 terminal, Windows) > akshare. TickerAll (source="tickerall") is a hosted, no-terminal alternative to the same broker feed (any OS) — opt-in and explicit-only: it never joins this automatic chain, so a user's broker credential is used only when deliberately requested.

Symbol Format Reference

MarketFormatExamples
A-sharesNNNNNN.SZ/SH/BJ000001.SZ, 600000.SH, 430139.BJ
US stocksTICKER.USAAPL.US, MSFT.US
HK stocksNNNNN.HK00700.HK, 09988.HK
Canada TSX / TSXVTICKER.TO / TICKER.VTD.TO, BBD-B.TO, PNG.V
CryptoSYMBOL-USDTBTC-USDT, ETH-USDT
FuturesXXNNNN.EXCHANGECU2406.SHFE
ForexXXX/YYYUSD/CNY, EUR/USD

Ban-Risk & Fallback Notes

  • Prefer never-banned sources: tencent and mootdx have no observed IP ban; reach for them first for A-share OHLCV when no token is set.
  • Eastmoney rate-limits by IP and must be throttled. Every Eastmoney-backed tool/loader routes through the shared per-host throttle; do not hammer it. On a throttle/timeout, fall back to the same-market source above (tencent/baostock).
  • Sina / Yahoo also throttle by IP — same per-host wrapper, same fallback rule.
  • Key-gated sources need their env key (FINNHUB_API_KEY, ALPHAVANTAGE_API_KEY, TIINGO_API_KEY, FMP_API_KEY, FRED_API_KEY, VIBE_TRADING_IWENCAI_KEY, TUSHARE_TOKEN). If the key is absent the tool/loader is unavailable — route to a free same-market source instead of erroring out.
  • A single failing symbol or transient HTTP error is reported inside the envelope; it never aborts the surrounding batch.

Data Verification Discipline

When a number will drive a conclusion (valuation, screening, report), do not trust a single source. Cross-check it:

  • Verify material figures across ≥2 independent sources before citing them. Prioritize original disclosures (company annual/quarterly reports, exchange filings) over third-party aggregators.
  • Flag any deviation >1% between sources as a ⚠️ caliber mismatch — usually a definition difference (GAAP vs Non-GAAP, consolidated vs parent-only, currency, TTM vs annual). Do not silently pick one; state both and which you adopt.
  • Use the financial_rigor tool's cross_validate command to do this exactly: pass {source: value, ...} and it returns the median consensus + per-source deviation + an all_consistent flag at a configurable tolerance (default 2%).
  • Mark unverified numbers as "single-source" or "estimate" — never present an uncorroborated figure as established fact.

This discipline is what separates analysis from aggregation.

© HKUDS, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in agent/src/skills/data-routing of HKUDS/Vibe-Trading.

Open the folder on GitHubat commit 7f6908b

Compare with similar skills

Market Data Source Router next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Market Data Source Router compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Market Data Source Router this skillHKUDS/Vibe-Trading35k—~2.4kAutomated safety check: PassMIT
Regimejackson-video-resources/markov-hedge-fund-method483—~1.6kAutomated safety check: PassCustom licence
Okx Sentiment Trackerdex-original/okx-agent-trade-kit1101 repos~3.8kAutomated safety check: PassMIT
Okx Cex Skill Mpokx/agent-skills1852 repos~2.3kAutomated safety check: PassMIT
Okx Cex Tradeokx/agent-skills1852 repos~7kAutomated safety check: PassMIT
Stock Correlationhimself65/finance-skills3.4k—~3.3kAutomated safety check: PassMIT

Similar skills

  • Regime

    jackson-video-resources/markov-hedge-fund-method

    Detect the market regime (Bull / Bear / Sideways) for ANY asset and turn it into a tradeable signal or a risk filter.

    483 GitHub stars~1.6k tokensUpdated 4 mo ago
    Business, Finance & HRAuto-check passed
  • Okx Sentiment Tracker

    dex-original/okx-agent-trade-kit

    A skill your agent uses when the user asks about: 'any crypto news', 'latest news', 'market update', 'daily briefing', 'BTC news', 'ETH news', 'news on SOL', 'search SEC ETF', 'regulation news'…

    110 GitHub starsUsed in 1 repo~3.8k tokens
    Business, Finance & HRAuto-check passed
  • Okx Cex Skill Mp

    okx/agent-skills

    A skill your agent uses when the user asks to: 'find a trading skill', 'search for skills', 'install a skill', 'add a skill', 'download a skill', 'browse skill marketplace', 'what skills are…

    185 GitHub starsUsed in 2 repos~2.3k tokens
    Business, Finance & HRAuto-check passed
  • Okx Cex Trade

    okx/agent-skills

    A skill your agent uses when the user asks to 'buy BTC', 'sell ETH', 'place a limit order', 'place a market order', 'cancel my order', 'amend my order', 'long BTC perp', 'short ETH swap', 'open a…

    185 GitHub starsUsed in 2 repos~7k tokens
    Business, Finance & HRAuto-check passed
  • Stock Correlation

    himself65/finance-skills

    Analyze how stocks move together using Yahoo Finance price history (yfinance): find correlated peers for a ticker, measure correlation, beta, and spread between specific tickers, cluster a group…

    3.4k GitHub stars~3.3k tokensUpdated 2 days ago
    Business, Finance & HRAuto-check passed
  • Stock Liquidity

    himself65/finance-skills

    Analyze how liquid a stock is using Yahoo Finance data (yfinance): bid-ask spreads, volume and dollar volume (ADTV), top-of-book and options depth, square-root market impact and slippage estimates…

    3.4k GitHub stars~4.9k tokensUpdated 2 days ago
    Business, Finance & HRAuto-check passed

More from HKUDS/Vibe-Trading

All 89 skills in this repo
  • Eastmoney Market Data

    HKUDS/Vibe-Trading

    Index of Eastmoney's free, no-token market data interfaces for China A-shares and Hong Kong stocks: fund flows, dragon-tiger lists, margin trading, reports and news.

    35k GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • OKX Market Data

    HKUDS/Vibe-Trading

    Retrieves public OKX cryptocurrency market data such as spot prices, candlesticks, funding rates and open interest through the OKX V5 REST API, with no authentication.

    35k GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • SEC EDGAR Filings Fetcher

    HKUDS/Vibe-Trading

    Fetches U.S. SEC EDGAR data: resolves tickers to CIK numbers, lists recent 10-K, 10-Q and 8-K filings with document URLs, and pulls XBRL financial series.

    35k GitHub stars~1.4k tokensUpdated yesterday
    Auto-check passed
  • A-Share ST Risk Screener

    HKUDS/Vibe-Trading

    Predicts whether a mainland China A-share company risks an ST or *ST warning after its next annual report, using financial thresholds and Sina penalty records.

    35k GitHub stars~4.9k tokensUpdated yesterday
    Auto-check passed
  • Breaks a structural trend such as AI infrastructure into its physical supply chain and ranks lesser-known listed companies sitting on each bottleneck.

    35k GitHub stars~2.7k tokensUpdated yesterday
    Auto-check passed
  • Plans and drafts an eight-part, roughly 120k-word investigative series on one company, built around a strict fact-check pass rather than fast drafting.

    35k GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Market Data Source Router

What does Market Data Source Router do?

Maps backtest data sources and research data needs to the right provider or tool, with each one's markets, required environment keys and network constraints. This skill is a lookup table the agent loads before any backtest, data fetch or research task. It lists every registered backtest data source with the markets it covers, whether it needs an environment key, what network access it needs and which skill documents it.

When should I use Market Data Source Router?

Market Data Source Router fits situations like: choosing a data source before running a backtest on A-shares, US stocks or crypto; checking which environment keys a data provider requires; finding the right tool for a research data need without hitting rate limits or bans.

How do I install Market Data Source Router in Claude Code?

Run `npx skills add HKUDS/Vibe-Trading --skill data-routing -a claude-code`. Or copy the skill folder (agent/src/skills/data-routing in HKUDS/Vibe-Trading) into .claude/skills/data-routing in your project. Claude Code loads it when a task matches its description.

How do I install Market Data Source Router in Codex?

Run `npx skills add HKUDS/Vibe-Trading --skill data-routing -a codex`. Or copy the skill folder (agent/src/skills/data-routing in HKUDS/Vibe-Trading) into .agents/skills/data-routing in your project. Codex loads it when a task matches its description.

Can I use Market Data Source Router in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add HKUDS/Vibe-Trading --skill data-routing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/data-routing, .gemini/skills/data-routing, .github/skills/data-routing and .opencode/skills/data-routing in your project.

What does Market Data Source Router need to run?

Going by SKILL.md and its folder, Market Data Source Router needs credentials named TUSHARE_TOKEN, FINNHUB_API_KEY, ALPHAVANTAGE_API_KEY and TIINGO_API_KEY. Our summary lists: Environment keys for the chosen provider, such as TUSHARE_TOKEN for tushare.

Does Market Data Source Router access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Market Data Source Router safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Market Data Source Router use?

Market Data Source Router is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Market Data Source Router use?

About 2.4k tokens (SKILL.md is roughly 9.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Market Data Source Router?

Skills that share tags, products or a category with Market Data Source Router: Regime (jackson-video-resources/markov-hedge-fund-method, 483 stars), Okx Sentiment Tracker (dex-original/okx-agent-trade-kit, 110 stars), Okx Cex Skill Mp (okx/agent-skills, 185 stars) and Okx Cex Trade (okx/agent-skills, 185 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Market Data Source Router?

HKUDS (a GitHub organization) maintains it in HKUDS/Vibe-Trading, which has 34,884 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on October 6, 2026.

Source: HKUDS/Vibe-Trading on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.