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

Aligned to guardrail.fund
ItemStatus
EntitySingle-family office (public: ACTIVE)
Capital100% principal — no investors, no LPs, no redemption gates
Inception2017 (per guardrail.fund)
Horizon10Y+ / no redemptions
InfrastructureLive multi-agent stack (risk plane, journal, event bus, Attention)
Case-study framingSide 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.

Nine agents
AgentDomainKey Function
Exchange (HL)HyperliquidPosition sync, order execution, balance tracking, funding rate monitoring
Exchange (PM)PolymarketMarket resolution tracking, position management, outcome probability sync
RiskEnforcement7-check risk plane — hard blocks, not warnings
JournalRecord-keeping29-field trade journal (22 auto + 4 pre-trade + 3 post-trade)
PortfolioAnalyticsKelly sizing, Monte Carlo, cross-position correlation
AlertsNotificationThreshold-triggered alerts, multi-channel delivery
Attention (AI)Behavioral analysisLLM anomaly detection — tilt, pattern drift, regime mismatch
SummarySynthesisSession reports, performance attribution
Wallet DecayDiagnosticsBalance 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.

Seven checks
CheckWhat It EnforcesWhy It Exists
Daily loss capMax loss per 24h rolling windowStops revenge trading after a bad morning
Weekly drawdownMax drawdown from weekly HWMCatches slow bleeds daily caps miss
Kelly sizingFractional Kelly (0.25–0.5×)Sizing from edge math, not gut feel
Max positionsHard concurrent-position limitPrevents fake diversification
CorrelationCross-position correlation checkBlocks the same bet under new names
Stop lossMandatory stop on every positionNo undefined exits
Session checkHours / fatigue enforcementNo 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:

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

What compounds for a principal-only operator
AdvantageWhat It IsWhy It Compounds
Behavioral dataset29-field journal + AI overlaysPersonalized history a new stack doesn’t have
Prediction-market first-class designCalibration Score, resolution trackingPM venues rarely get native treatment in public terminals
Risk plane as infrastructure7-check enforcement API, not a dashboardSeparable enforcement layer
Feedback loopJournal ↔ Attention ↔ SummarySmarter about this operator with every trade
Audit integrityHash-chained logs + layered safetyTamper-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