How EdgeQuant is built.
An architecture deep dive into EdgeQuant, an experimental personal project with 17 specialized AI agents and 7 automated strategies across crypto and U.S. equities. The focus is reliability under failure, not prompts.
Overview
Most AI projects stall between a working demo and a system that can run unattended. EdgeQuant was built to cross that gap. It treats every model response as untrusted input, runs it through typed contracts, evaluations, and deterministic rules, and logs every decision, including every decision not to act.
- 01Model output is untrusted until it passes schema and deterministic checks.
- 02Every repeated job is idempotent.
- 03Stale data is rejected, not used.
- 04Risk limits are code, never model output.
- 05Every decision, including a skip, is logged with a reason.
1. The decision pipeline
Six stages, each with a defined input, job, and output. A candidate can be dropped at any stage, and the reason is recorded.
- STAGE 01Universe FilterInput
Raw market and on chain feeds
What it doesDrops illiquid names, wide spreads, and any feed older than its freshness watermark.
OutputClean, tradable candidate list
- STAGE 02Regime ClassifierInput
Macro, volatility, breadth, flows
What it doesLabels the market as trending, mean reverting, compressing, or expanding.
OutputRegime tag that decides which strategies may act
- STAGE 03Prediction EngineInput
Candidate plus regime context
What it doesGPT, Claude, and Gemini produce typed predictions with direction, confidence, horizon, and invalidation.
OutputValidated prediction set, disagreement recorded
- STAGE 04Trading CommitteeInput
Predictions plus evidence
What it doesSix engines assess, estimate probability, recommend, stress test, check portfolio fit, then decide.
OutputAttributable proposal with dissent noted
- STAGE 05A+ Gate and Risk EngineInput
Proposal plus portfolio state
What it doesExplicit checks and deterministic limits. Every rejection is logged with one of 14 typed skip reasons.
OutputApprove, or skip with a reason
- STAGE 06Execution and TelemetryInput
Approved action
What it doesPaper execution first, idempotent dispatch, and a full audit trail of every step.
OutputJournal entry, outcome tracking, alerts
feeds ──► [01 Universe Filter] ──► [02 Regime] ──► [03 Prediction Engine]
│ stale / illiquid │ │ GPT · Claude · Gemini
▼ ▼ ▼ (routed, with failover)
SKIP(reason) strategy allow list [04 Trading Committee]
│
▼
[05 A+ Gate + Risk Engine] ── SKIP(1 of 14 reasons)
│ approve
▼
[06 Execution + Telemetry] ──► journal · alerts · outcome tracker
│
accuracy tracker ◄────────┘ (feeds routing and calibration)2. The 17 specialized agents
Agents are split by responsibility so that no single model both proposes and approves an action.
Trading Committee Engines
No single model makes the final call.
Trading Bots
Two equity and two crypto bots that scan, propose, and measure.
Governance and Learning Agents
The layer that keeps the platform honest and improving.
Separately from the agents, EdgeQuant runs 7 automated strategies. Strategies define when to look for a setup; agents decide whether the setup is good enough.
3. Multi model routing
EdgeQuant uses tiered model specialization. Each workload is assigned the model that fits its latency and depth needs, by design. Running every prompt through three models and voting would triple cost, burn rate limits in volatile sessions, and wait on the slowest model, which destroys intraday edge. It would also be one model grading another, with no ground truth.
Low latency, high volume work: news sentiment, the macro session gate, market context, rapid prediction sweeps, and signal enrichment. A deeper Gemini tier runs the platform's full self audit.
Structured logic and deep synthesis: the Hedge Fund Engine, short conviction screening, where to focus, the institutional memo, blow up analysis, and the daily brief.
Connected and health monitored as a provider, ready to take on workloads. Not assigned a production task in the current release.
Deterministic first ensemble
Models never invent prices. A pure code forecast ensemble computes multi horizon expected returns, Bull, Base and Bear targets, regime tags, and entry, stop and target zones from market data alone. It is reproducible and uses no AI. Models are layered on top to synthesize and stress test the thesis, not to produce the numbers.
Picking the best model by evidence, not opinion
The best model is decided by measured outcomes. Every prediction from every engine is recorded with its price, horizon and targets. When the horizon matures, the system scores direction hit rate, target hit rate, and whether high conviction calls actually hit more often than low ones, across 1 day, 7 day, 30 day and 90 day horizons. When several engines flag the same asset, a composite conviction score decides which signal wins.
Resilient circuit breaking
Scheduled jobs sit behind a circuit breaker. After 3 consecutive failures a job pauses for 30 minutes and logs CIRCUIT_BREAKER_TRIPPED. Retrying every minute would hammer a degraded API, exhaust database connections, and risk duplicate actions. Pausing lets rate limits reset and keeps one failing provider from cascading across the platform. A health check samples every data and AI provider, and output that fails validation counts as a failure. The system never repairs a broken answer by guessing.
4. Production failure modes
Prompt engineering gets a model to answer. AI engineering keeps the system correct when the model, the data, or the infrastructure misbehaves. These are the failures EdgeQuant is built around.
| Failure | How it shows up | Engineered response |
|---|---|---|
| API rate limits and throttling | Provider returns 429 or slows down during market hours | After 3 consecutive failures the job's circuit breaker pauses it for 30 minutes |
| Cron runs late or twice | Scheduled job overlaps its previous run | Idempotency key per job window; a repeated run cannot repeat an action |
| Web extraction payload changes | Scraped page structure shifts and fields go missing | Schema validation at ingestion; invalid payloads are quarantined and alerted |
| Database timeouts | Writes stall under load | Bounded retries, then skip with a logged reason instead of acting on partial state |
| Silent data gaps | Feed keeps returning the last known value | Freshness watermarks; stale inputs are rejected before any model sees them |
| Malformed model output | Response is not valid JSON or misses fields | Treated as a failure, never as an answer; the run is skipped with a reason |
| Model quality drift | An engine gets worse at a task over time | Accuracy tracker scores every prediction at its horizon and exposes the decline |
5. Evaluations and guardrails
Every agent output is scored before it can influence a decision. Behavioral evaluations and a red teaming conformance harness run against synthetic shocks, misleading headlines, and missing fields.
Output parses against the typed contract
Data timestamp is inside the window for its horizon
Rationale cites only data that was in the input
Direction, confidence, and rationale agree
Holds up under injected misleading headlines and missing fields
Stated confidence matches observed hit rate over time
A self measurement loop records every prediction and scores it against what actually happened across four horizons: scalp, intraday, swing, and long term. Calibration results feed back into the agents' scoring, so the system improves from evidence rather than opinion.
6. Where AI is not allowed to decide
Models can propose. They cannot override risk. These limits are plain deterministic code, evaluated after every proposal, and they always win.
Operator controlled. When on, nothing new is approved.
If equity falls to the floor, new risk stops until reviewed.
After a loss or a burst of activity, a strategy must wait.
Concentration in one sector or theme is capped.
Total open risk across all positions is capped.
Size is computed by rules, never chosen by a model.
The 18 A+ gate skip reasons
Every candidate that fails the final quality gate is logged with one of these typed reasons, taken directly from the production code.
Risk/reward below the minimum
Price too far from EMA21, no chasing
Long blocked, regime is risk off
Short blocked, regime is risk on
Not in a high conviction theme
Chop or range regime, wait for a trend
Composite conviction below threshold
Max new trades per day reached
Max new trades per scan reached
Operator pause is on
Regime confidence below threshold
Pullback or flag has a weak retest
Max trades for this theme reached
Theme cluster exposure cap reached
Long blocked, capital rotating out
Short blocked, capital rotating in
Long blocked, high confidence risk off macro
Trade memory shows 20+ similar setups losing
The human operator sets the rules and can stop the system at any time. The platform is designed to know when not to trade.
7. How changes reach production
The governance agents run a gated release loop. No improvement goes live without a historical replay and peer review, and any change that degrades measured results is reverted.
What stays private
Strategy parameters, feature formulas, thresholds, account data, and credentials are not published. This write up covers the architecture and engineering practices, not the trading edge. EdgeQuant is an experimental personal project, not a commercial product or investment advice.