Guardrail: Building Systematic Trading Infrastructure from First Principles
Single-family office · multi-agent architecture · risk engineering · AI behavioral analysis · infra 2025–Present
Executive Summary
Guardrail is a single-family office operating an autonomous capital-allocation system across digital assets, hard commodities, real estate, and frontier technology. Principal capital only — no investors, no LPs, no clients, no redemption gates. For this portfolio site it also reads as a side personal project in finance: domain versatility next to Hashstack and Parashar, not the lead cold-outreach story.
I’m building the trading infrastructure stack that makes that posture real — a multi-agent execution system with 9 specialized sub-agents coordinated by an orchestrator over a Redis event bus, a 7-check programmatic risk plane, an AI-powered behavioral analysis engine, and a build orchestrator that manages a 43-task deployment DAG. Public positioning on guardrail.fund: from signal to settlement — no human in the loop.
Venue focus for the live stack includes derivatives (Hyperliquid) and prediction markets (Polymarket), inside a broader SFO mandate. The infrastructure is live. Capital remains 100% principal — no third-party LP capital deployed.
Two design principles run through every decision: risk is a gate, not a dashboard, and the human is the weakest link — every casual intervention point is a failure mode to engineer out.
Current Status
| Item | Status |
|---|---|
| Entity | Single-family office (public: ACTIVE) |
| Capital | 100% principal — no investors, no LPs, no redemption gates |
| Inception | 2017 (per guardrail.fund) |
| Horizon | 10Y+ / no redemptions |
| Infrastructure | Live multi-agent stack (risk plane, journal, event bus, Attention) |
| Case-study framing | Side finance project for domain versatility; secondary to Hashstack |
1. Mandate (Public Positioning)
Per guardrail.fund, allocation spans four verticals — digital assets, precious metals, real estate, and technology (health-tech, insurance, defence, aerospace, bio-tech, quantum). Operating theses include hard-money scarcity (BTC + XAU), programmable settlement, tangible real-yield real estate, and concentrated deep-tech bets.
This case study is not a pitch for external capital. It documents the systematic trading infrastructure behind principal-capital allocation — how risk, journaling, and behavioral oversight are enforced in software.
2. The Problem: Why Most Traders Lose
Retail and small-operator traders fail for three reasons that have nothing to do with strategy:
No systematic journaling. They can’t identify what’s working because they don’t track decisions with enough granularity. A trader who doesn’t know their win rate by setup type, timeframe, and market regime is guessing at their own edge.
No real-time risk enforcement. Risk rules exist on paper, not in code. A drawdown limit that only fires when you check it manually isn’t a limit — it’s a suggestion.
Emotional override. Discipline degrades under stress — systematically, predictably, and measurably. The hardest trade to skip is the revenge trade after a loss.
The terminal solves all three by removing casual human override from the execution loop and replacing judgment calls with programmatic constraints. The system doesn’t advise discipline — it enforces it.
3. Multi-Agent Architecture
The system runs 9 specialized sub-agents coordinated by an orchestrator over a Redis pub/sub event bus. Each agent owns one domain, publishes typed events, and consumes events from other agents. No agent has global state — coordination happens through the bus.
| Agent | Domain | Key Function |
|---|---|---|
| Exchange (HL) | Hyperliquid | Position sync, order execution, balance tracking, funding rate monitoring |
| Exchange (PM) | Polymarket | Market resolution tracking, position management, outcome probability sync |
| Risk | Enforcement | 7-check risk plane — hard blocks, not warnings |
| Journal | Record-keeping | 29-field trade journal (22 auto + 4 pre-trade + 3 post-trade) |
| Portfolio | Analytics | Kelly sizing, Monte Carlo, cross-position correlation |
| Alerts | Notification | Threshold-triggered alerts, multi-channel delivery |
| Attention (AI) | Behavioral analysis | LLM anomaly detection — tilt, pattern drift, regime mismatch |
| Summary | Synthesis | Session reports, performance attribution |
| Wallet Decay | Diagnostics | Balance drift every 15 minutes — fees, funding, slippage |
Why Agents, Not a Monolith
Each agent can fail independently. Exchange going down doesn’t disable Risk. Journal offline doesn’t stop position monitoring. Attention failing degrades insight quality but doesn’t block execution. Fault isolation matters when a cascading failure can mean capital loss.
Event Bus Design
Events are typed (POSITION_OPENED, RISK_CHECK_FAILED, ANOMALY_DETECTED, DECAY_ALERT), timestamped, and source-tagged. The orchestrator routes cross-agent responses — e.g. POSITION_LIMIT_BREACH → Exchange reduction; TILT_DETECTED → session pause escalation.
4. The AI Layer: Attention + Summary
Most trading systems treat AI as a signal generator. The Attention agent doesn’t generate trade ideas — it watches the operator.
It scores live behavior against the operator’s own Journal baseline: sizing drift after losses, entry-frequency spikes, hold-time compression, regime mismatch, conviction–outcome divergence, session-pattern change. Deviations emit typed bus events. Haiku handles real-time scoring; Sonnet generates narrative explanations only when an anomaly is confirmed and context is requested.
The Summary agent synthesizes cross-agent state into session reports, performance attribution, behavioral digests, and portfolio risk snapshots — a read layer on collective agent state, not a second research engine.
5. The 7-Check Risk Plane
Risk isn’t a dashboard — it’s a gate. Every trade passes through seven checks before execution. Any single failure blocks the trade. The plane is designed for no casual bypass; exceptions, if any, require an audited path — not an in-the-moment override button.
| Check | What It Enforces | Why It Exists |
|---|---|---|
| Daily loss cap | Max loss per 24h rolling window | Stops revenge trading after a bad morning |
| Weekly drawdown | Max drawdown from weekly HWM | Catches slow bleeds daily caps miss |
| Kelly sizing | Fractional Kelly (0.25–0.5×) | Sizing from edge math, not gut feel |
| Max positions | Hard concurrent-position limit | Prevents fake diversification |
| Correlation | Cross-position correlation check | Blocks the same bet under new names |
| Stop loss | Mandatory stop on every position | No undefined exits |
| Session check | Hours / fatigue enforcement | No 3 AM “I have a feeling” trades |
Kelly inputs come from the operator’s own Journal history by setup type. Monte Carlo on the Portfolio agent models book-level tail risk before a new position is approved — catching five individually-safe legs that collectively blow up on one macro factor.
6. Build Orchestrator: 43-Task Deployment DAG
Development and deployment use a 43-task DAG: dependency resolution, auto-resume on API rate limits, per-node checkpoints, multi-model routing (Haiku / Sonnet / Opus by task type), and per-agent rollback so a failed deploy doesn’t take the full system down.
7. Wallet Decay Diagnostic
Funding, fees, slippage, and rounding create a slow bleed that looks like noise trade-by-trade. The Wallet Decay agent checks expected vs actual balance every 15 minutes and attributes erosion to funding, fees, slippage, or rounding — making invisible capital decay visible.
8. The Auto-Journal: 29 Fields
The system auto-fills 22 of 29 fields from exchange data, leaving 4 manual pre-trade and 3 manual post-trade inputs (22 + 4 + 3 = 29). Attention-agent fields and the TradingView chart link are overlays — not an additive count that would inflate the journal to 33.
Absolute dollar amounts are never shown — percentages, ROE, and R-multiples only. For prediction markets, a Calibration Score tracks how well stated confidence matches outcomes over time. That score is not commonly treated as a first-class metric in public prediction-market terminals.
9. Four-Layer Separation
Strict downward-only dependencies:
- Orchestrator — agent coordination, event routing, workflows
- Integrity — hash-chained audit log, dead-man switch, kill switch
- Observability — BetterStack, Retool, Summary agent
- Security — read-only keys, namespaced events, per-agent permissions
Every decision and risk check lands in an append-only SHA-256 hash-chained log. Kill switch (manual flatten) and dead-man switch (missed heartbeat → safe mode) stay separate so one failure mode can’t erase both protections.
10. Compounding Advantages
| Advantage | What It Is | Why It Compounds |
|---|---|---|
| Behavioral dataset | 29-field journal + AI overlays | Personalized history a new stack doesn’t have |
| Prediction-market first-class design | Calibration Score, resolution tracking | PM venues rarely get native treatment in public terminals |
| Risk plane as infrastructure | 7-check enforcement API, not a dashboard | Separable enforcement layer |
| Feedback loop | Journal ↔ Attention ↔ Summary | Smarter about this operator with every trade |
| Audit integrity | Hash-chained logs + layered safety | Tamper-evident record for principal capital |
11. QA — Target Operating Discipline
Target cadence (not a claim that every practice is already ritualized monthly): unit + integration tests per deploy, pre-release regression suite, chaos engineering (target monthly), penetration testing (target quarterly), and CI/CD with per-agent rollback via GitHub Actions.
12. Key Takeaways
On positioning: Guardrail is an SFO with principal capital only — not a client fund, not an LP vehicle. The case study shows the infra that makes autonomous allocation enforceable.
On risk engineering: A risk dashboard reports damage. A risk gate prevents it. Casual override turns a gate into a suggestion box.
On AI: Attention monitors the trader, not the market. Alpha loss often comes from good strategy executed badly under stress.
On domain versatility: Same person who shipped DeFi protocol product work also builds systematic trading infra — different domain, same “risk as interface” instinct.
Stack: TypeScript · Bun · Redis (pub/sub) · BullMQ · PostgreSQL · Hyperliquid SDK · Polymarket API · Claude API (Haiku/Sonnet) · BetterStack · Retool · GitHub Actions · TradingView
Sources
- guardrail.fund — authoritative public positioning (SFO, principal-only, inception, mandate)