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
Finance & Fintech20 min

Fintech AI Adoption Report 2026

Financial services organizations are navigating a pivotal transition in AI adoption — moving from exploratory pilots toward enterprise-scale deployments that are becoming load-bearing infrastructure within core business processes. The 2026 landscape is defined not by whether to adopt AI, but by how to deploy it responsibly, at what pace, and within which governance architecture. Incumbent banks, c...

Read report
Finance & Fintech18 min

Banking Automation Trends 2026

Banking automation has moved well past the proof-of-concept phase. The institutions that have captured the most value are not those that deployed the most bots or launched the most AI pilots — they are the ones that built automation as a strategic capability, with deliberate governance, disciplined sequencing, and organizational structures that treat process intelligence as a core competency. In 2...

Read report
Finance & Fintech19 min

Fraud Detection Market Analysis 2026

Fraud detection has entered a structural transformation driven by the convergence of real-time payment rails, AI-native decisioning architectures, and increasingly sophisticated adversarial fraud operations. For financial institutions, payment processors, and fintech platforms, the ability to detect and prevent financial crime in real time is no longer a compliance checkbox — it is a core operatio...

Read report

Work With Halkwinds

Build Something Exceptional

Partner with the team that built AstraFi.

View Platform