by fidetolabs
An MCP server for quant factor processing and backtesting. Connect it to your agent and ask.
# Add to your Claude Code skills
git clone https://github.com/fidetolabs/qanatSee how qanat compares with popular alternatives.
qanat is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by fidetolabs. An MCP server for quant factor processing and backtesting. Connect it to your agent and ask. It has 269 GitHub stars.
qanat's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/fidetolabs/qanat" and add it to your Claude Code skills directory (see the Installation section above).
qanat is primarily written in Python. It is open-source under fidetolabs on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh qanat against similar tools.
No comments yet. Be the first to share your thoughts!
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
Qanat is an agent-first backtesting engine that turns your raw data into portfolio weights through a pipeline of steps you define.
In Qanat, you build a strategy as a pipeline of tables.
It starts with your raw data: prices, news, or anything else you track. From there, you define each step of the pipeline. A step reads one or more tables and writes a new one, so you can clean the data, calculate metrics, and score your symbols. The final step outputs your portfolio weights, detailing exactly what to hold and how much.
Qanat replays this pipeline across historical data, one date at a time. It prices the portfolio's holdings, accounts for fees, and outputs a complete PnL table.
Nothing is hidden. Every table is visible on your screen, with its row count and the logic that created it. If a number looks off, you open that table and inspect the data.
As your project grows, you can plug in new data sources and build new steps on top of them.
You don't have to write the code yourself. Describe what you want in plain English, and the agent will build the step, run it, and show you the resulting table.
Qanat is built for retail traders who rebalance daily or weekly. You can't out-race an institutional hedge fund on speed, and with a longer horizon, you don't need to.
You need Python 3.10 or newer.
uv tool install qanat-fdtl # or: pip install qanat-fdtl
qanat init my-alpha --demo && cd my-alpha
qanat serve
The console opens on http://127.0.0.1:8420.
--demo builds four working strategies, runs the pipeline, and prices each one, so the console
opens with real numbers in it. It takes about fifteen seconds. The data is synthetic, so this
works with no API key and no network. Leave --demo off for an empty project.
Qanat makes no network calls on its own. The only outbound requests are the ones your data sources make.
Needs nothing but Docker, and brings its own Postgres:
git clone https://github.com/fidetolabs/qanat.git && cd qanat
docker compose up --build
Postgres is on localhost:5433, not 5432, because 5432 is often taken already. User, password
and database are all qanat. Bind a directory to /project to use your own project instead of
the demo.
If a port is already in use, set the host ports yourself:
POSTGRES_HOST_PORT=5434 QANAT_HOST_PORT=8421 docker compose up --build
To start over, docker compose down -v && docker compose up --build.
This is the main way to work with Qanat. You describe what you want, and the agent writes the step, runs it, and shows you the table it produced.
Add it to any MCP client:
{ "mcpServers": { "qanat": { "command": "qanat", "args": ["mcp"], "cwd": "/path/to/my-alpha" } } }
For Claude Code, claude mcp add qanat -- qanat mcp. Add --read-only and the agent can look at
everything but change nothing.
Things you can ask for:
The console and the agent are two views of the same project, so they can never disagree about its state -- and in the console they are one view. The agent talks to the console's own API, so what it reads and changes appears in the thread as it happens and the panel beside it follows along: ask about a table and the table opens, ask for a replay and the equity curve is what you are looking at when the answer lands.
The full tool list is in docs/agents.md, and what the console does with it is in docs/console.md.
Everything lives in one qanat.yaml. Nothing hides in application code.
project: equity
store: ./data/qanat.duckdb
universes: # which symbols a portfolio may hold
- id: sp500
symbols: ./universes/sp500.csv
stages: # order here is order in the pipeline
- { id: raw, kind: raw }
- { id: normalized, kind: features }
- { id: features, kind: features }
- { id: weights, kind: weights }
- { id: pnl, kind: pnl }
sources: # where data comes from
- id: prices
to: [raw.daily_prices]
connector: rest
options:
url: https://api.example.com/v1/bars
headers: { Authorization: "Bearer ${PRICE_API_KEY}" }
steps: # each one reads tables and writes tables
- id: momentum
from: [normalized.prices]
to: [features.momentum]
script: steps/momentum.py
options: { lookback: 20 }
- id: alpha_momentum # the step that writes weights is the strategy
from: [features.momentum, features.risk]
to: [weights.momentum]
script: steps/alpha_momentum.py
universe: sp500
rebalance: 20d
backtest: # what prices the portfolio, and what it costs
prices: normalized.prices
fee_bps: 5
slippage_bps: 10
live: false # true, and `qanat serve` keeps scoring it forward
live_alphas: [] # which one to price: not ours to guess once you have two
A step is a .sql file, or a .py file with a run(ctx) function:
def run(ctx):
bars = ctx.read("normalized.prices") # only tables the step declared in `from`
held = ctx.universe() # the symbols it may hold
return df
ctx.read() refuses any table the step did not list, so a missing dependency is an error instead
of a wrong number.
Each stage holds tables, and data only moves forward through them.
| stage | what it holds |
|---|---|
raw |
data exactly as it arrived. Never edited |
normalized |
typed, deduplicated, one key set |
features |
anything you measure or calculate |
weights |
one table per strategy. What to hold, and how much |
pnl |
what each strategy earned. Written by qanat backtest |
qanat check enforces the rules that keep this honest, and refuses to run a project that breaks
one. They are written out in
docs/contract.md.
| command | |
|---|---|
qanat init |
create a project |
qanat run |
run the pipeline once |
qanat serve |
scheduler and console |
qanat backtest |
replay over history and price what it held |
qanat report |
one backtest, period by period |
qanat --help lists the rest. qanat tui gives you the console in the terminal if you prefer to
stay there.
A source or a step can also run on a clock, or run whenever its input changes. Set schedule: or
when: on it, or fill it in from the console.
A backtest replays the pipeline over a period that already happened and prices what i