System Overview

phase 1 · human-in-the-loop

Kairon is an AI-supervised trading platform. A TradingView strategy fires a webhook; an AWS-hosted AI agent validates the signal against five deterministic risk filters; the proposal lands in this terminal for the owner to approve; on approval, a Lambda places the order on OANDA. A reconciler reads broker fills back into the journal every five minutes. The system is currently wired to the OANDA practice account — no real capital is at risk.

Data Flow

signal → validation → approval → execution → reconciliation
01 SIGNAL02 APPROVAL03 RECONCILETradingViewPlus alert · webhookAPI GatewayWAF · IP allowlistWebhook λHMAC · idempotentAgentCore RuntimeStrands · Opus 4.7DynamoDBkairon-tradesPOST /v1/webhookInvokevalidatestatus=PENDING5 RISK-FILTER TOOLSstops · volatility · risk rules · correlation · market snapshotDynamoDBkairon-tradesUINext.js · CloudFrontOwnerapprove · rejectExecutor λcircuit breakersOANDApractice accountGET /tradesrenderPOST /approvemarket ordersame table — read by UIEventBridgeevery 5 minReconciler λbookmark in SSMOANDA Transactionsfills · closes · PnLDynamoDBwrites back fillstriggerpoll txnsmatch · updateLEGENDactive pathexternalhuman

The Validator Agent

strands + bedrock opus 4.7

Every webhook is forwarded to a Bedrock AgentCore runtime running a Strands agent on Claude Opus 4.7. The agent has access to five deterministic tools — not free-form decision making. It must call them, read their outputs, and emit a verdict of APPROVE or BLOCK with reasoning.

Median validation latency: ~13s. Tool calls per signal: 4–5. Cost: ~$0.05–$0.15 per validation.

Why Human-in-the-Loop

phase 1 control

The agent recommends, the owner decides. APPROVE proposals are visible in this terminal; the executor only places an OANDA order after a click. BLOCKED signals are persisted with reasoning for audit but never reach the order book.

Phase 2 (full autonomy) is gated on 30+ closed paper trades, Sharpe ≥ 1.0, max drawdown < 15%, and a clean run through a high-volatility news event.

Risk Filters

every signal must clear all five
01tool
check_stops_sanity
SL/TP direction valid relative to entry, sane reward:risk ratio.
blocks: Inverted stops, flat-line stops.
02tool
check_volatility_regime
Live spread, ATR ceiling, news-window guard.
blocks: Spreads > 3 pips, news-window trades.
03tool
check_risk_rules
Daily/weekly/monthly PnL gates and 10% margin cap.
blocks: Circuit-breaker breaches, oversize positions.
04tool
check_correlation_exposure
Currency-block exposure across open positions.
blocks: Pile-on into the same currency block.
05tool
get_market_snapshot
Live OANDA bid/ask used by the four checks above.
blocks: (read-only data tool)

Build Status

updated 2026-06-11
  • [✓]Phase 1 — AWS infra (4 CDK stacks)
  • [✓]Phase 2 — OANDA API wrapper
  • [✓]Phase 3 — Reconciliation loop + webhook receiver
  • [✓]Phase 4 — Approval UI on CloudFront
  • [✓]Phase 5 — Validator agent (Strands + Opus 4.7)
  • [~]Phase 6 — 1-month paper trading on OANDA practicein progress
  • [ ]Pre-go-live — Cognito auth, alarms + canaries, cost anomaly detectionqueued
  • [ ]Phase 2 future — Interactive Brokers integration, full autonomyqueued