Case Study — AstraFi

Risk Monitoring Dashboard

Real-Time Portfolio Risk Intelligence for a Multi-Strategy Hedge Fund

Sub-200ms risk runs replacing a 4-hour overnight batch across 50,000+ positions

Industry

Institutional Finance / Hedge Fund

Timeline

12 weeks

Team

6 engineers

Tech

Python + ClickHouse + WebSocket

The Challenge

A multi-strategy hedge fund needed real-time portfolio risk calculations across 50,000+ positions spanning equities, fixed income, derivatives, and digital assets. Their existing Murex-based system required a 4-hour overnight batch to produce risk figures — figures that were stale before traders saw them. Intraday risk was managed by intuition.

Our Approach

How We Solved It

01

Real-Time Position Feed Integration

Built a unified position feed aggregating from prime brokers, OMS systems, and digital asset custodians, normalizing all positions into a canonical risk data model with sub-second latency from trade execution.

02

Incremental Risk Calculation Engine

Designed an incremental risk calculation architecture that recalculates risk only for positions affected by market data changes or trade executions — reducing per-update computation by 97% versus full portfolio recalculation.

03

Multi-Model Risk Framework

Implemented 8 concurrent risk models (Historical VaR, Monte Carlo, Greeks, Factor, Liquidity, Concentration, Leverage, Drawdown) running on the same position data with a shared market data cache.

04

Limit Breach Alerting

Real-time limit monitoring across all 8 risk dimensions with configurable thresholds per fund, strategy, and portfolio manager — alerting within 200ms of any limit approach or breach.

Engineering Process

How We Built It

Risk Calculation Vectorization

Rewrote Python risk calculations using NumPy vectorization and Numba JIT compilation, achieving 40x speedup over the prior loop-based implementation — critical for sub-second incremental recalculation.

Shared Market Data Cache

Redis Streams publishes market data updates to all 8 risk models simultaneously with microsecond latency, ensuring all models compute risk on exactly the same market snapshot.

Historical Scenario Pre-Computation

Historical VaR scenarios are pre-computed and stored in ClickHouse, reducing real-time VaR to a single weighted aggregation rather than a full scenario replay — bringing P99 VaR latency to 18ms.

Architecture Decisions

Key Technical Choices

Incremental Over Full Recalculation

Full portfolio recalculation on every market data tick would require 100x the compute. Incremental recalculation — updating only affected positions — is the architectural decision that makes real-time risk feasible.

ClickHouse for Scenario Analytics

Historical scenario storage in ClickHouse vs PostgreSQL delivered 200x query speedup on VaR scenario lookups, reducing the database from the bottleneck to a non-factor in overall risk latency.

WebSocket Push for Trader Consumption

Risk figures are pushed to trader dashboards via WebSocket as soon as they update — traders see risk changes within 200ms of a market move rather than refreshing a dashboard.

Results

What We Delivered

50,000+
Positions Monitored
<200ms
Risk Recalculation (was 4 hrs)
99.99%
Uptime
8
Risk Models Running Concurrently

Solution Blueprint

How It All Fits Together

Position Feed Layer
  • Prime broker integrations
  • OMS connectivity
  • Digital asset position normalization
Risk Calculation Engine
  • 8 concurrent risk models
  • Incremental recalculation
  • Shared market data cache (Redis)
Monitoring & Alerting Layer
  • WebSocket risk push to traders
  • Limit breach alerting (<200ms)
  • Risk attribution dashboard

Lessons Learned

What We Improved

01

Incremental Architecture Must Be Designed From Day One

We prototyped full recalculation first to validate correctness, then redesigned for incremental — retrofitting incrementality is much harder than designing for it from the start.

02

Traders Need Context, Not Just Numbers

Risk figures alone weren't adopted. Adding the top 5 contributors to each risk metric and comparison to prior-day positions made the dashboard the primary risk tool within 2 weeks.

03

Real-Time Risk Changes Risk Management Behavior

With real-time risk visibility, portfolio managers began using intraday risk figures for active position management. This was the desired outcome but required new operational procedures we hadn't initially scoped.

Related Research

Research Reports for This Industry

Enterprise AI24 min

Enterprise AI Adoption Trends 2026

Enterprise AI has crossed the operational threshold. Seventy-two percent of Fortune 500 organizations now run at least one AI system in production — and the average enterprise manages 3.4 concurrent AI initiatives. This report maps the state of enterprise AI across healthcare, manufacturing, financial services, retail, and beyond.

Read report
SaaS Engineering19 min

SaaS Development Benchmarks 2026

What does it actually cost to build and scale a SaaS product in 2026? This report benchmarks engineering team size, deployment frequency, infrastructure spend, and time-to-market across 521 SaaS companies — from $1M ARR seed-stage startups to $100M+ enterprise SaaS leaders.

Read report
AI Agents21 min

AI Agent Adoption Report 2026

AI agents are the most transformative enterprise technology category of the 2025–2026 cycle. This dedicated report examines architecture patterns, deployment economics, governance approaches, and the emerging multi-agent production landscape across 634 organizations — the most comprehensive agent-specific enterprise research available.

Read report
Cloud18 min

Enterprise Cloud Cost Benchmark Report 2026

Enterprise cloud spend reached $780 billion globally in 2025 — yet 32% remains unoptimised waste according to our benchmark data. This report quantifies cloud cost maturity across AWS, Azure, and GCP, mapping FinOps practice adoption, reserved capacity utilisation, and savings plan optimisation against peer benchmarks.

Read report

Work With Halkwinds

Build Something Exceptional

Partner with the team that built AstraFi.

View Platform