TRA

io.github.BijectiveLabs由 GitHub 账号 BijectiveLabs 发布v0.13.0更新于 Nov 7, 2026

Read-only gates of autonomous trading agents with deterministic execution: cost, data, validation.

已验证STDIO仅桌面金融AI 与机器学习

概览

AI 生成的概览

把自主交易代理系统的只读闸门(成本、数据、校验)作为 MCP 工具提供给任意宿主。

可以做什么
  • 以工具形式运行交易台的只读闸门:成本、数据与校验检查
  • 查看系统计算与决策的内容,每次拒绝都会点名其依据的数字
  • 读取交易台写下的记录:周期、筛选、持仓、往返交易与用量
  • 清单未列出任何工具,因此具体工具集在此无法说明
适用场景
适合让助手查看或解释 TRA 交易台的决策与拒绝理由,同时不赋予其定价、定量或下单的能力。
运行要求
以 PyPI 包 bitra 通过 uvx 在本地以 stdio 运行;README 的安装方式需要 Python 3.11 或更高版本。交易台本身需要含设置的工作目录,并在 .env 中配置模型提供商密钥;清单未声明认证、环境变量或请求头。
安装前请注意
该服务器被描述为只读闸门,但底层产品在实盘模式下会用真实资金交易,应只指向自己掌控的交易台。模型提供商密钥(如 GROQ_API_KEY、ANTHROPIC_API_KEY)与交易所密钥存放在交易台的 .env 中;README 称模型无法接触密钥或下单,真实资金的责任由用户承担。

安装

在 SourceWeft 中

  1. 打开 控制台中的 TRA,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[TRA by Bijective Labs]

TRA

Autonomous trading agents with deterministic execution. The agents propose; the system decides.

[CI] [PyPI] [Python versions] [License: MIT] [Status: alpha]

[Managed with uv] [Linted and formatted with Ruff] [Type checked with mypy] [Venues through ccxt] [Tested on Linux and Windows]

[Website] [Documentation] [Insights] [Changelog] [Security policy]


TRA (trading research agents) is published as bitra on PyPI and runs as tra. Before 0.10.1 the package was called trading-research-agents, and the same package is still published under that name.

Language models are good at reading a market and saying what they think. They are bad at arithmetic, they don't know what a trade costs, and they will happily overrule a limit you set. This project uses them for the first part only. The system itself, fixed rules with no model involved, fetches the data and works out every figure. The agents read those figures and give an opinion. Then the system prices the trade, applies your limits, sizes it, and either writes it down or sends one order with the stop attached. Every decision and every refusal is kept on disk with its reason, so you can check afterwards what happened and why.

It's an early release, so expect settings to change between versions. What works today: linear perpetuals, spot pairs (stock perpetuals and tokenized stocks among them) and prediction market outcomes through one order path, a universe of perpetuals found and measured by the system and ordered by the room its own paths expect, the full autonomous cycle on live data, a structure lead that proposes, three readings of your own series computed by the system, up to three reviewers, stops and targets the lead names inside bounds you set, the gates that decide, sizing from your own rules, real orders on a venue's practice environment behind a mandate you sign and a signed risk gate, and two auditors that read the records. Under it, a market data plane records order flow, the order book, liquidations, derivatives and news minute by minute into a verified archive, and an arena replays any policy over that archive beside baselines built to be beaten, net of the desk's own costs.


Contents

What it solves

The usual problem with trading agentsWhat happens here
The model invents or miscalculates a numberModels never compute. Every figure comes from the system, and a figure a model cites is checked against its brief, value included.
Nobody knows what a trade cost until it's doneThe round trip (fees, spread, impact, funding, slippage) is priced before an order exists, and a trade whose claimed edge doesn't clear it is refused.
The agent sizes its own positionSize comes from your conviction ladder and your risk limit. No model can make a trade bigger.
A model "decides" to ignore your settingsYour declared thresholds decide. A model's opinion is recorded beside them, never instead of them.
Something went wrong and there is no traceEach cycle keeps its snapshot, briefs, answers, the intent and what the venue said. Nothing is rewritten.
A crash leaves a position with no stopThe stop and take profit go to the venue with the entry, or right after the fill where the venue takes them no other way, so they survive this process dying.
Text from a feed tells the model what to doThe model that proposes a direction reads numbers the system computed; outside text reaches no model at all, and no model can send an order or reach a key.
A strategy looks good on a lucky sampleThe arena replays it over the recorded market beside buy-and-hold, momentum, its own fade and a seeded random null, net of costs, and says "sample too small" until the sample is not.

None of these is hypothetical. Why it is built this way lists the documented failures behind each one, with their sources.

How it is built

Three kinds of work, kept apart because they fail differently. The system is in control; Jev, TypeSafe's typed judge, is the fast System One model that perceives and verifies; the reasoning seats deliberate only inside what the system computed, and their answers are checked before anything counts.

DoesNever doesToday
The systemrecords the market, computes every figure, reads your own series against your lines (the macro, on-chain and sentiment readings), prices the round trip, applies your limits, sizes, sends one order with its exits, settles every replayed ideaguess, or carry a stale value forward as currenteverything around the model call
A reasoning modelreads figures the system computed and proposes a direction, a setup and its levels, citing the figures it usedcompute a number, size a trade, touch an order or a key, loosen a limitthe structure lead, with a blind confirmer and a flow specialist when you declare the team; reviewers when you declare them
Jev, the typed judgeturns dated text into typed events with probabilities, screens text for instructions to a machine, checks each structure reason against the regime the system measured, and from 0.13 checks every claim against its briefdecide a direction from numbers, size, or reach an orderJev through the TypeSafe adapter, behind a vendor-neutral port ([judge]): the archived headlines into text features, and the deciding team's reasons checked before a trade
mermaid
flowchart LR    subgraph venues["venues, through ccxt"]        direction TB        streams["live streams<br/>trades, order book, liquidations"]        rest["REST history<br/>funding, open interest, mark, index, long/short"]        archives["daily trade archives"]    end    subgraph plane["market data plane: the system"]        direction TB        record["tra record<br/>one bar builder, hour parts, gap marks"]        bars["tra data bars<br/>the same builder over the archive"]        store[("verified archive<br/>Parquet, sha256 per file<br/>flow, book, derivatives, text")]    end    subgraph decide["decision: the system around the deciding team"]        direction TB        judge["Jev, the typed judge<br/>headlines into typed events<br/>reasons checked against the regime"]        features["features<br/>41 figures known at the bar's close"]        readings["readings: macro, on-chain, sentiment<br/>your series against your lines, no model"]        analyst["deciding team<br/>lead, blind confirmer, flow specialist<br/>propose, cite figures"]        gates["gates<br/>cost, exits, paths, confluence, conviction"]    end    shelf[("sources/<br/>dated series you declare")]    subgraph act["risk and execution: the system"]        direction TB        risk["risk gate, signed<br/>caps, loss at the stop, switches,<br/>daily loss, drawdown"]        order["one order<br/>stop and take profit attached"]    end    arena["tra arena<br/>policies replayed, settled net of costs,<br/>beside baselines and a random null"]    streams --> record --> store    archives --> bars --> store    rest --> record    rest --> bars    store --> features    store --> judge --> features    analyst --> judge --> gates    shelf --> readings --> gates    features --> analyst --> gates --> risk --> order --> venues    store --> arena    features --> arena

The shipped cycle reads its own live snapshot; the archive feeds the arena today and the decision path as the work below lands. Where it is going, in the order it is being built:

ReleaseAdds
0.11, in 0.12.0the market data plane (tra data bars, tra record), the feature library, the arena; the macro, on-chain and sentiment analysts become readings that ask no model
0.12, in 0.12.0the lead's levels read against the instrument's own paths, a forecast and a calibrator fitted on recorded outcomes, risk as its own signed gate; Jev for dated text and the team's reasons
0.13the core as the default desk, with every other layer an experiment kept only if it beats the core out of sample; the arena prices each market at its own costs and replays the desk's one-market-per-pass selection; the model's decisions proven forward, on paper or demo, after its knowledge cutoff

Each step is measured in the arena before it is trusted, and the four guarantees at the end of this page hold through all of it.

Get started

A few minutes and one model key. Every setting has a working default, so a new desk runs before you change anything; the table under step 6 says what those defaults are.

1. Install. You need Python 3.11 or newer. uv is the quickest way:

bash
uv tool install 'bitra[ccxt,openai,anthropic,google,data]'

That brings every model provider and every exchange in. Without uv, run pip install 'bitra[ccxt,openai,anthropic,google,data]' inside a virtual environment. To move to the newest release later:

bash
uv tool upgrade bitra      # or: pip install -U 'bitra[ccxt,openai,anthropic,google,data]'tra --version

That is the release, and the version to run. The develop branch on GitHub is where the next one is built; a commit there is not a release (more).

2. Make a desk. A desk is a folder holding your settings and everything the agents decide. Name the provider you have a key for:

bash
tra init my-desk --profile autonomous --agent groqcd my-desk
--agentKey in .envModel, when you name none
groqGROQ_API_KEY (free tier)openai/gpt-oss-120b
googleGEMINI_API_KEYgemini-flash-latest
anthropicANTHROPIC_API_KEYclaude-opus-5-5
openai, deepseek, xai, openrouter, ...see Models and providersname one with --model; tra models <provider> lists them

Add --venue okx (or any ccxt id) to trade somewhere other than Bybit.

3. Add your key. Copy the example file and put your key in it. Every command reads the .env next to strategy.toml on its own.

bash
cp .env.example .env        # then set GROQ_API_KEY=... in .env

4. Check. tra check reads every setting against the others and names the one thing to fix next. A desk that is ready ends with:

ok    provider groq: readyready to run `tra run`

5. Run. tra run decides once on live market data, in the sandbox: nothing leaves your machine. tra run --every 15m keeps deciding, once per fifteen-minute bar, on the clock. Or type tra on its own for the console, which takes the same commands.

bash
tra runtra run --every 15m

6. When you want real orders. Start on the exchange's demo or testnet API. Make the desk for that exchange from the start, and the rest is three commands:

bash
tra init my-desk --profile autonomous --agent groq --venue bitgetcd my-desk                       # put the exchange's keys in .env beside your model keytra keys --probe --prepare       # reads the account; on a demo or testnet sets one-way modetra mandate --sign "Your Name" --venue-modetra check

--venue writes what that exchange needs into [execution]: its demo or testnet API, 3x isolated leverage, at most 200 per order, and how its stop and take profit are placed. Change any of it. How to make the key on each exchange is in Exchange accounts and keys, and Toward real orders has the whole path.

What a new desk does before you change anything

DefaultWhere to change it
Ordersnone: the sandbox writes each decision down and sends nothing[execution].mode
What it tradesBTCUSDT on Bybit, as a taker[run].instrument, [universe], --venue
Timeframedecides on 15-minute bars, reads 1h and 4h as context[run].bar_interval_s, context_intervals
Strategynone fixed: the analyst picks the setup the measured regime supports, or stays flat[agents].mechanism
Stop and targetthe analyst names them; the stop is held between 0.2% and 3% and never inside one ATR, the target brought in past 4x the stop[exit]
Risk per trade0.5% of equity lost at the stop, whatever the stop's distance[controls].max_risk_per_trade_bps
Bad daysno new entry after a 3% loss on the day or a 10% fall from the peak[controls]
Time limita position closes after 4 hours[exit].timeout_bars
Trades worth takingworth more than nothing over the instrument's own paths at the trade's levels, net of the round trip; at most 6 a day[targets]
Oversightthe risk gate on every new order; two auditors that report[controls], [audit]

Working on the code itself? See Development.

What you see, in order

1. The console. Run tra inside your desk and it opens the console: what is ready, what isn't, and the next command to run. Under it is a prompt that takes every command and draws it right there. Arrow keys go back through what you typed, tab completes, help lists the commands and exit leaves. For scripts and cron, tra -c "run --now" runs one command and exits.

[the console]

2. The pass over your instruments. Type run --every 15m and the desk first refreshes any data series that are due, one line each. Then it looks at every instrument on your list, one data pull apiece, and measures it. The screen steps through them live:

[the screen pass]

3. One cycle per instrument it takes. The system found the candidates, measured them and ordered them by the room their own paths expect over the spread; no model chooses. The instruments taken get a full cycle. The terminal shows the whole pipeline from the start and updates it as each step begins and ends. Steps that run at the same time spin at the same time, each with its own clock, and the line underneath says who is working right now:

[a scheduled desk at work]

4. The result. When the cycle finishes, the table gives way to the pass over the universe: what the system took, what waited and what was held, and why. Then the cycle itself: what the analyst proposed and from which figures, and every refusal with the number behind it. Here an ETH short in a ranging market stopped at its exits: with its own stop and target and the round trip, more than half of trades like it would have had to win just to break even (the break-even bound of the time, an experiment since 0.13):

[one cycle]

Then the data the cycle used and how old it was, the series the readings read, the stop and take profit it would have placed, and which agents answered. A cycle that goes further adds what each reviewer argued, how conviction weighed the voices, the risk at the stop and the targets:

[data, series, exits and agents]

5. Between cycles. The desk says when the next pass is, on the clock and in minutes, for example next pass at 14:30:00 UTC, in 10m 57s, and counts down to it. An auditor woken by an alarm gets a spinner of its own.

The same cycle as plain text (--plain, a pipe or a log): the figures of a real run on live data (2026-09-29), printed by this release with the template's conviction weights, shortened:

cycle 2026-09-29T02-59-16Z BTCUSDT: 5.344s of agents, 15.042s of reviewers  funding        ccxt:bybit         age 4.267s  ohlcv          ccxt:bybit         age 32.746s  orderbook      ccxt:bybit         age 7.544smacro      read by the system: bullish (risk-on)sentiment  read by the system: bullish (positive)lead:      long on range_reversion at 0.65 over 5 bars: the close is stretched low in the windowread: zscore=-0.587, vwap_gap_bps=-3.99, ret_1_bps=1.59reviewer contra    oppose on 2 cited figure(s)reviewer pro       support on 3 cited figure(s)conviction: 0.800 of 1.0 (macro 1.0 of 1.0, sentiment 0.5 of 0.5, structure_lead 1.300 of 2.0)risk: 8.29 bps of equity at the stop against the declared 50 bps, size 0.010cost: 12.87 bps round trip, 2.00 of it estimatedgate: 25.0000 bps claimed clears 12.8723 bps cost plus 0.0000 bps margin  refused targets: the claimed edge is 1.94x the round trip and the desk declared 2.0x; the cost is certain and the edge is not

That trade was refused. It cleared the cost gate and still died, because this desk asks for an edge of twice the cost and got 1.94 times. A refusal names the figure behind it, every time.

How one cycle decides

mermaid
flowchart TD    find[["the system finds the universe and measures each instrument<br/>one data pull each; every value carries its source and age"]] --> wake    wake{"trigger<br/>has anything moved since the last look?"}    wake -- "no" --> held["held: one data pull, no tokens spent"]    wake -- "yes" --> pick["the system orders what it admitted<br/>the room its own paths expect over the spread"]    pick -- "none taken" --> held    pick -- "taken" --> briefs    briefs["the system writes the briefs<br/>each role sees only the figures its job needs"] --> readers    readers["readings, by the system, no model<br/>macro, on-chain, sentiment against your lines"] --> tech    tech["structure lead, alone or with its team<br/>a blind confirmer that must agree, a flow specialist<br/>a direction, a confidence, a horizon"] --> price["the system prices the round trip<br/>fee, spread, impact, funding, slippage"]    price --> exits{"the stop and the target<br/>the analyst's levels, held inside your bounds<br/>worth more than its cost over its own paths?"}    exits -- "no" --> refused    exits -- "yes" --> round2["reviewers, as many as you declare<br/>a claim that cites no figure is thrown away"]    round2 --> matrix{"confluence<br/>do your declared states agree with the direction?"}    matrix -- "no" --> refused["a refusal that names its figure"]    matrix -- "yes" --> size["conviction<br/>how much, from your ladder"]    size --> risk{"risk per trade<br/>what does it lose at the stop?"}    risk --> gate{"cost gate and targets<br/>does the edge clear the cost, by your margin?"}    gate -- "no" --> refused    gate -- "yes" --> intent["the intent, written into the cycle"]    intent --> venue["venue mode only<br/>one order, the stop and take profit attached"]

Who does what:

RoleReadsAnswersCan never
structure leadcandles, spread, funding, book imbalance, open interest change, and the regime on its timeframe and the higher ones you declarea direction, a setup from a fixed list, a confidence, a horizon, and where its stop and target sitsize the trade, place a level outside your [exit] bounds, run a trend setup in a range, or fade a market that is not a measured range
blind confirmer (optional)the structure lead's own brief, blind to its answer, ideally on another model familythe same schema, independentlytrade alone: the two reads must name the same side, and the lower confidence counts
flow specialist (optional)the book, the spread, funding and open interest, which then leave the analyst's briefa side and a confidence, with the figures it rests onname a level or a size; it is one voice in conviction
macro, on-chain and sentiment readings (the system, not agents)dated rates and levels, chain and derivatives figures, scores and notes you curatea declared state and a graded score: each series against the lines you drewask a model, or propose a direction
reviewers: pro and contrathe proposal and the figures behind it, each without the other's casethe strongest case for or against, as cited claimssee the other side's case, or cite a figure it wasn't given
reviewer: neutral, as judge (Jev when [judge] is declared)the same, and both cases once the system has checked every claimsupport, oppose or abstain, the one verdict that counts; from the typed judge, a probability for eachsee the advocates' verdicts, or count claims instead of weighing them
technology and quant auditorsthe cycles this desk recordedfindings and proposed changeschange anything

The macro, on-chain and sentiment readings are the system's arithmetic over dated series you declare under sources/, and ask no model: until 0.11 each was an analyst whose model labelled the same figures, no decision ever rested on that label, and the calls were retired. Each series is either a file you keep or a feed the desk refreshes itself (FRED, the Crypto Fear & Greed Index, or any paid vendor that answers JSON over https). tra sources show lists every series with where it came from and how old its last value is, and a value older than its max_age is shown as stale and never counted. Data sources has the details.

Which reviewers run is yours to declare. A vote never decides on its own: it moves conviction by the weight you give it ([conviction].reviewer_weight), and a stance counts for what it says beyond its assignment, since a pro that supports is expected to.

Voices are allowed to disagree. Each reading becomes a score between -1 and 1, computed from its own figures against the lines you drew, so a macro reading barely past its line counts as a small voice and one far past it counts as a big one. Conviction adds them up: agreement grows the size, opposition shrinks it in proportion, and only opposition that outweighs the case stops the trade. A short at 0.70 confidence against a barely bullish macro and sentiment scores 0.56 and trades at half size; against a strongly bullish context it scores 0 and doesn't trade.

The structure lead knows what kind of market it is working in before it decides. The system measures the regime on its timeframe (trending up, trending down, ranging or mixed) and on the higher timeframes you list in [run].context_intervals, and it hands over what your macro thresholds say this cycle as well. A setup that doesn't fit the regime, such as a trend trade in a sideways market, is refused by name; [regime] holds the lines.

Everything after the models answer is arithmetic over numbers you declared. No model can place, cancel or resize an order, read a file outside the project, or edit your configuration. Agents has the full table of what an agent can reach, and The cycle walks through every step.

Venues

A cycle reaches venues through ccxt, so every exchange ccxt supports is already integrated: the same order path, the same gates and the same checks, with nothing in the core naming a venue. What differs from one venue to the next is what ccxt reports it can do, the second column, and how far it has been tested, the last:

VenueWhat a cycle can do therePractice environmentRun end to end by us
Bybit (the default)everything: orders with the stop and take profit attacheddemo, testnetyes, on the demo API: real orders, exits attached, a resting order cancelled
OKXeverythingdemo (ccxt's testnet switch)yes, on the demo API: real orders, exits attached, closed by the venue's own exits
Bitgeteverything, on a classic or a unified trading accountdemoyes, on the demo API, unified account
BingXeverythingdemo (VST, ccxt's testnet switch)yes, on the demo API
Binance, Gateorders, with the stop and take profit placed right after the fill (exits = "separate")demo (Binance), testnet (Gate)yes, on their practice APIs
WEEX, BloFin, WOO Xeverythingtestnetready for its run
Hyperliquid, Pacifica, WOOFi Pro, ModeTrade (decentralised)everythingtestnetready for its run; report wanted for Hyperliquid
KuCoin Futures, Deepcoineverythingnoneintegrated; no practice environment
dYdX, Paradex, Extended, Lighter (decentralised); Deribit, Crypto.com, Coinbase Internationalorders, but no exits at the venue through ccxt, and some cannot set leveragetestnetnot for a desk that needs its exits at the venue
Kraken, Kraken Futures, Phemexdata for now: ccxt does not report their positions, and no order is sent into a position nobody can see

"Everything" means ccxt reports the five things a safe order needs: send it, attach the exits, read the position, read the open orders, cancel. "Run end to end" is the stronger claim, a full run with real orders on the venue's demo or testnet API, and Bybit, OKX, Bitget, BingX, Binance and Gate have had it so far. How to make a key on each is in Exchange accounts and keys. Any other venue that takes orders can have that run at any time: start on its practice environment, watch a few cycles and read what it sends. Each report moves a venue into the last column.

Adding the venue you trade on is four steps, and one command writes most of it:

bash
tra venues okx            # what it can do, and which keys it signs withtra venues okx --setup    # the blocks to paste into envelope.toml, data.toml, strategy.toml and .env

Your fees are filled in from your account when it reports them, and from the venue's standard tier until then, labelled as such; a fee you write yourself is kept and checked against the account. Venues has the full table, the keys each venue needs, and the four steps.

Models and providers

You choose the provider and the model; nothing is hard-coded. Each provider reads its key from the environment (or the .env beside your config) and nowhere else.

ProviderKey in .envInstall withStructured outputTested live here
groqGROQ_API_KEYopenaiJSON schema, falling back to JSON mode; checked by the systemyes: openai/gpt-oss-120b and openai/gpt-oss-20b, every live cycle in our records
googleGEMINI_API_KEY or GOOGLE_API_KEYgoogle-genaiJSON schemayes: gemini-flash-latest, as the fallback
anthropicANTHROPIC_API_KEYanthropicJSON schemaunit-tested; default model claude-opus-5-5
openaiOPENAI_API_KEYopenaistrict JSON schemaunit-tested
deepseekDEEPSEEK_API_KEYopenaiJSON modepreset only
mistralMISTRAL_API_KEYopenaiJSON schemapreset only
xaiXAI_API_KEYopenaiJSON modepreset only
openrouterOPENROUTER_API_KEYopenaiJSON modepreset only
qwenDASHSCOPE_API_KEYopenaiJSON modepreset only; pass --base-url for your region
ollamanoneopenaiJSON modepreset only; a local server
localnoneopenaiJSON modeany OpenAI-compatible server; pass --base-url
9router9ROUTER_API_KEYopenaiJSON schemapreset only; a local router

TypeSafe is not in this table because Jev is not a model for [agents]: it is the typed judge, declared in data.toml under [judge] with TYPESAFE_API_KEY (a key from https://console.typesafe.ai/keys) and a pinned version such as jev-1.14.0. tra models typesafe lists the versions your key may use; tra keys --probe proves the key without asking a question.

Whatever the provider, every answer is parsed against a closed schema by the system before anyone reads it, so a model that only offers JSON mode is held to the same shape as one with strict schemas.

toml
[agents]provider = "groq"model = "openai/gpt-oss-120b"effort = "medium"                    # minimal | low | medium | high | xhigh | max, where the                                     # vendor takes it; left out, the vendor's default appliesfallback = ["google:gemini-flash-latest", "anthropic:claude-opus-5-5"]
[agents.roles.reviewer]             # a role can run on its own modelmodel = "a-cheaper-model"effort = "low"

fallback is tried in order when a provider is rate limited or down, with the same brief. A vendor's free tier meters each model on its own, so roles can share a provider across two models and each model keeps its own allowance; tra check judges the load per model and says when one is too much. Every call is a line in usage.jsonl with its tokens and latency, and nothing caps spend unless you declare a ceiling. tra keys --probe proves each key works without sending a prompt. A vendor of your own is about thirty lines (Model providers).

Toward real orders

What it trades today, through one order path and the same gates:

  • Linear perpetuals (USDT- or USDC-margined swaps) on any venue ccxt reaches, long and short, with the leverage and margin mode you declare. The default, run end to end on six exchanges.
  • Spot pairs, long only and paid in full, for a desk that lists spot in [execution].markets.
  • Stock perpetuals and tokenized stocks, which are a perpetual and a spot pair to the venue, with the underlying exchange's hours respected.
  • Prediction market outcomes, for a desk that lists prediction, decided on a probability by their own analyst and priced to resolution.

That is where the project started, not where it stops. For spot, Venues says how to set a desk up. Spot, a stock perpetual and a tokenized stock have been run on the Bybit and OKX demos; prediction outcomes have run in sandbox on live data, and their order path is tested against ccxt's shapes until a practice venue is run. Dated futures, inverse contracts and options are on the way, each with its own cost model, exit rules and tests. Until a market type has those, venue mode checks the type on every order and refuses it, because a market the system cannot yet price and protect is not one it should send to. Boundaries says what each one takes.

An agent desk goes through three steps, and you can stay at any of them as long as you like:

StepHowWhat happensNeeds
1. Sandboxtra runthe full cycle on live data; every decision written down, no order senta model key
2. Demo or testnet APItra run with [execution].mode = "venue" and environment = "demo" or "testnet"real orders on the exchange's demo or testnet API, exits attached, positions looked aftera signed mandate, a leverage, max_notional, practice keys
3. Real capitalthe same, with environment = "mainnet"real orders with real moneyall of the above, plus the ladder at its canary tier (tra ladder promote, with evidence)

Steps 1 and 2 have been run end to end on the demo or testnet APIs of Bybit, OKX, Bitget, BingX, Binance and Gate. Step 3 has not been run by us; treat it as yours to verify, small, first.

If you bring a scripted strategy of your own instead of the agents, it has a research path of its own before any of this: tra data get BTCUSDT 2025-01-01 and tra backtest replay a day of the exchange's archive net of every cost, tra paper --minutes 30 runs it on the live feed with nothing sent, and tra live is a small canary session behind hard caps. The example core is there to show the path, not to make money, and the replay prints its net as it comes out, loss or gain. The live tier has the details.

Venue mode is the only mode that can lose money, so it has a door in front of it. Read the mandate with tra mandate; when you accept it, tra mandate --sign "Your Name" keeps it in the project as MANDATE.md and signs [execution] with your name and today's date, in one step. Signing alone does not switch anything on; --venue-mode signs and turns orders on together. tra check names whatever else is missing.

Your money, your orders, your positions

Once orders flow, three things look after the money, all of them the system's own rules and none of them a model:

Before an orderWhen it is sentWhile it is open
the account's real equity and free margin are readyour leverage is applied at the venue and read backat the start of every pass, each position is checked against the venue
sizing uses the smaller of the real equity and what you allow the deskan order whose liquidation would sit inside its stop is refusedone that outlives its hold limit is closed with a reduce-only order
an order may use only part of the free margina taker entry is a limit IOC within your slippage band, never a naked market orderone the venue's stop or take profit closed is written up with its real fees and funding
a day's loss past your limit stops new entriesthe stop and take profit go with the entry, so they outlive this processthe kill switch flattens everything before the desk stops

Who decides what, in one line each: the analyst proposes the direction, your risk rule sets the size, you choose the leverage, and no model touches the last two. Leverage never makes a trade bigger. It only decides how much margin the trade ties up and how far away liquidation sits.

toml
[execution]mode = "venue"environment = "demo"             # demo | testnet | mainnetleverage = 3                     # yours to choose; it never makes a trade biggermax_notional = 400               # the most one order may be worth, in quote currencymargin_mode = "isolated"         # isolated | crosshold_limit = "timeout"           # close by time after [exit].timeout_bars; or horizon, or none

Underneath, on every venue: the order goes only to the environment you declared (demo, testnet or mainnet); an open position or a working order refuses a second entry; a size off the venue's step is refused rather than rounded; a clock more than a second off the venue's refuses before anything is signed; and Ctrl-C or a service stop cancels a resting order before the process leaves. Every close goes to positions.jsonl and every finished trade to round_trips.jsonl. Capital, orders and positions has every setting, every refusal and the arithmetic behind each one.

One thing to know before you rely on it: the position checks run at the start of each pass of tra run --every. With no desk running, an open position has its venue-side stop and take profit and nothing else, so a desk meant to run unattended belongs under a supervisor.

Orders cross the book by default (taker-taker): they always fill, which is how most desks trade. Point [run].venue_key at a maker-taker channel and entries rest on the book as post-only orders instead - a lower fee, fewer fills, since a resting order can be left behind by the market. Either way the cost gate prices the fee of the channel you chose.

Watching a desk, and what is kept

The console runs commands in its own process, so closing it ends what it was running. A desk that should keep running belongs under a supervisor (systemd, a service manager, tmux), and then you look at it from anywhere with:

bash
tra watch --every 5s       # a read-only view built from the records the desk writes

tra watch opens no connection, holds no key and takes no lock, so opening and closing it does nothing to the desk.

What is kept, and where:

WhatWhereNotes
everything one cycle didruns/cycles/<id>/snapshot, briefs, answers, intent, placed.json, cycle.json, and inputs.json.gz with the raw inputs; cycle.json holds a sha256 of each file
the pass over the universeruns/screens/every instrument measured, the order the system took them in and why
every model callruns/cycles/usage.jsonltokens, latency, price
when the desk ran and what stopped itruns/cycles/scheduler.jsonlone line per start and stop
every position closed, by time, by the venue or by the kill switchruns/cycles/positions.jsonlvenue mode
every finished trade with entry, exit, fees and fundingruns/cycles/round_trips.jsonlvenue mode; what the quant auditor reads
the first equity reading of each dayruns/cycles/equity.jsonlwhat the daily loss limit is measured from
what you typed at the prompt.tra-historya convenience only; tra -c keeps none

Command line

Every command says what it did. Exit code 0 means cleared, 1 means a gate said no, 2 is a usage error. --json gives machine-readable output and --plain gives text instead of panels.

Getting started

CommandWhat it does
traopens the console
tra init my-desk --profile autonomousa desk wired as the core for the agents; every experiment written off, commented
tra checkevery setting read against the others, with what to fix
tra keys --probeproves every key works; no key is printed, no prompt or order sent
tra models groqthe models your key can use on a provider, read from the vendor; no prompt sent
tra init my-desk --profile autonomous --venue okxa desk wired for one exchange: data, orders, demo or testnet API, keys
tra venuesevery venue the docs describe, and what each can do
tra venues okx --setupwhat a venue can do, and the blocks to paste to trade on it
tra mandatethe text venue mode requires; --sign "Your Name" keeps it as MANDATE.md and signs [execution] in one step

Running

CommandWhat it does
tra runone autonomous cycle
tra run --every 15m --cycles 12twelve scheduled passes: the first now, then one on every fifteenth minute of the clock
tra run --nowask the roster even if the trigger would have held a quiet market
tra watch --every 5sa read-only view of a running desk
tra auditboth auditors over the records; nothing is applied
tra arena --instruments BTCUSDT,ETHUSDT --from 2025-07-01 --to 2025-09-30 --spread-bps 1 --slippage-bps 0every policy replayed over the archive, settled net of costs, beside baselines and a random null
tra backtest, tra paper, tra livereplay, shadow, canary

Data

CommandWhat it does
tra data get BTCUSDT 2025-01-01download a day, verify its checksum, audit it, write Parquet and funding
tra data audit export.csv --mapping mapping.tomlyour own CSV or Parquet, through the same audit
tra data pull BTCUSDTone live snapshot through the chains in data.toml
tra data bars BTCUSDT 2025-07-01 --to 2025-07-31one-minute flow bars from the venue archive and the market's derivatives history, into the verified archive
tra record, tra record --once 30morder flow, the book, liquidations, derivatives and news kept while they happen, per [record] in data.toml
tra record statuscoverage, gaps and latency of the recording over the last day
tra runs verify --market dataevery market day file and hour part against its manifest
tra sources show, tra sources pullwhere the readings' series come from and how old they are; refresh them now
tra sources add macro us10y --from fred --id DGS10 --high bearisha series onto the shelf in one step: pulled now, its lines drawn from its own history
tra universewhich perpetuals discovery finds on the venue now, and what each filter took out
tra runs verifyevery cycle's files against their hashes, and its briefs against its raw inputs
tra runs prune --keep 90dwhat old cycle directories would be removed; add --yes (and --archive) to do it

The ladder, research and hosts

CommandWhat it does
tra ladder show, promote, demotewhich tier the desk stands at; one step up with evidence, or down
tra chain floor, observe, check, validatethe research chain, layer by layer (The falsification chain)
tra ledger showevery idea that died, and what killed it
tra agent session, eval, tracethe research session, model comparison, a run read back
tra mcp servethe read-only gates as tools for any MCP host

What it guarantees, and what is not built yet

Some rules are guarantees, enforced by the system and tests, and every change has to keep them:

  • No model touches an order or a key. Models read figures and answer; the system sizes, prices, limits and sends.
  • No model can loosen a control. A model can tighten a limit, step the ladder down or arm the kill switch; never widen, promote or disarm.
  • One decision, at most one order. A venue error is recorded and the next cycle decides again; nothing is retried around real capital.
  • Stale or missing data is refused, never read as zero or as current.

Other things are simply not built yet, and contributions are welcome: inverse, dated futures and options; on-chain venues outside ccxt; more than one account; transfers and treasury; routing and execution algorithms; portfolio accounting. Boundaries lists each one with what it does today and what a contribution would need. The example strategy cores are examples: your edge is yours to declare.

Liability says plainly where responsibility sits when real capital is involved.

Where it is going

The project is in active development, and what this page describes is where it stands today, not where it stops.

  • More market types. Spot, stock perpetuals, tokenized stocks and prediction markets are built; inverse and dated futures and options follow, each added with its own cost model, exit rules, sizing and tests before venue mode accepts it.
  • More venues run end to end. Every venue ccxt supports already goes through the same order path and gates. Each one joins the six already in the last column of the venues table after a full run on its demo or testnet API, ours or yours.
  • The rest of the not-built-yet list, one piece at a time, without weakening a guarantee.

Use the release. What PyPI installs is the latest release, and it is the version to run. Releases come from master. The develop branch is where the next release is built: it moves often, a commit there is not a release, and it can carry work that is unfinished or changed again before it ships. A set of changes becomes a release when it is merged into master, tagged and published, and CHANGELOG.md says what each one brought.

Documentation

The full documentation is at docs.bijectivelabs.dev. Its source is in docs/, so a change in behaviour and the page that describes it go in the same pull request.

Read thisFor
Why it is built this waythe documented failures it is built against, each with its source, and what we found building it
The cyclethe cycle step by step, and every setting that shapes it
Agentseach role, what it reads, and what an agent can and cannot reach
Data sourceswhere the macro, on-chain and sentiment figures come from, fetching them, and freshness
Market data, The arenathe recorded archive and the recorder; replaying policies over it, net of costs
Capital, orders and positionsequity, margin, leverage, liquidation, daily loss, time exits, the kill switch, and the records they leave
Venueswhich venues work, and adding yours
Working with language models, Model providershow models are used: fallback, spend, adding a provider
The live tier, The trading agentthe ladder from replay to a live session
Your own data, The data gatetrade history, series and vendor feeds you bring, in CSV, JSON or Parquet, and the checks every file passes
Boundaries, Liabilitywhat is guaranteed, what is not built yet, and who is responsible
The agent, The MCP serverthe research agent, and the MCP server
Architecturepackages, import rules, file formats
The falsification chain, Execution realism, The kill ledgerthe research chain, execution realism, verdicts
Command lineevery tra command
CHANGELOG.mdwhat changed

Development

bash
git clone https://github.com/BijectiveLabs/bitra && cd bitrauv sync --all-extrasuv run ruff check . && uv run ruff format --check .uv run mypyuv run pytest

CONTRIBUTING.md has the branch flow and the standards the code is held to.

Where it comes from

This repository opened to the public in October 2026. Its history starts on 12 September 2026, when the code was separated from Bijective's internal work, and every commit, tag and contributor since then is here. The ideas it is built on are older: the falsification chain, the cost model and the controls in front of every order come from Bijective's research and from the trading platform it was building before this repository existed. The language-model agents came later and sit on top of those gates, which is why they can propose but never size, price or send.

License

MIT. See LICENSE; NOTICE lists the third-party software this package builds on.

Built by Bijective Labs.

来源:README.md,提交 aa2ada4

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

4
  1. v0.13.0最新Nov 7, 2026
  2. v0.12.2Oct 31, 2026
  3. v0.12.1Oct 29, 2026
  4. v0.10.2Oct 25, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分