Cloud Architecture

Cloud-Based Live Risk with Code Generation AAD

Achieve cost-efficient, secure cloud Live Risk using Code Generation AAD for fast sensitivity computation. Deploy encrypted binary kernels without exposing proprietary models or trade data.

20-50×
Faster Execution
~100×
Cost Reduction
ms
Portfolio Risk
Secure
Binary Kernels

The Cloud Live Risk Challenge

Costs, flexibility, and scalability drive banks to transition risk systems to the cloud. The ultimate goal is "Live Risk" - real-time portfolio risk that updates with every market tick. However, achieving this cost-effectively remains elusive with traditional "lift-and-shift" cloud migration approaches.

Two Standard Approaches and Their Limitations

There are two distinct approaches to cloud Live Risk:

On-Demand Scaling

Problems:

  • Spawning new instances takes significant time
  • Introduces latency precisely when you need speed - during market turbulence
  • Banks compete for resources during volatility, leading to higher prices and/or resource shortages
Verdict: Fails when you need it most

Always-On

Benefits:

  • Pre-loaded portfolio, analytics, and scenarios - no provisioning time

Problems:

  • Extremely costly - running full infrastructure 24/7
  • Effectively throwing money at the problem
Verdict: Works but economically unsustainable

The Code Generation AAD Solution

A cost-efficient and future-proof alternative: Use modern Code Generation AAD to generate efficient binary kernels representing curve-building, portfolio pricing, and risk calculations. These kernels can be securely deployed on cloud at the start of the trading day for continuous tick-level risk throughout the day.

20-50x faster than original analytics

~100x cost reduction vs always-on approach

Millisecond portfolio risk computation

Secure deployment - models and data stay on premises

No latency - kernels ready at market open

MatLogica's Automatic Adjoint Differentiation Compiler (AADC) delivers precisely this.

What is AADC? Understanding Binary Kernels

Consider a large portfolio including various trades with models of varying complexity, plus curve-building functionality. The objective is **tick-level pricing and risk** for this complex model.

Achieving this with an always-on "lift & shift" approach would be prohibitively expensive and expose proprietary models and trade data to cloud environments.

How AADC Works

During a single execution of the original analytics, AADC generates binary kernels representing the optimized and compressed elementary operations of the original program. Optionally, an extra kernel computes the backward pass of automatic differentiation to calculate all risks.

Performance Characteristics

  • 20-50x faster than original analytics
  • Constant time risk computation (all Greeks simultaneously)
  • AVX2/AVX512 vectorization - native CPU optimization
  • Multi-thread safe by design - extra scalability unavailable in original analytics
  • Hardware-specific - no Docker containers needed, immediate serialization

Security: Almost Enigma-Secure

Remarkably, these kernels are almost Enigma-secure. AADC receives a sequence of elementary operations from the original analytics with all loops unrolled and only hard-coded values representing strikes, expiry dates, or valuation dates.

With no visibility of the original models, AADC generates optimized and compressed kernels where all business-critical information is hidden between the ones and zeros. Even the same portfolio generates different binary representations from one trading day to another.

For cloud execution, AADC kernels are generated for specific hardware, meaning the kernel can be serialized immediately and sent for execution on the cloud at the start of a trading day. Proprietary models and trade data remain on premises.

Target Architecture for Cloud-Based Live Risk

Several architectural options are available depending on trading business nature, existing infrastructure, and processes. You can implement AADC for all trades or retain valuation of certain instruments in original analytics while aggregating with AADC-computed measures.

How It Works

  1. 1 When a pricing request comes in, the Quant Library checks if a kernel exists for that configuration
  2. 2 If not, AADC generates the kernel and sends it to the cloud
  3. 3 If yes, the library calls the kernel and aggregates results

This might sound like "always-on," but thanks to AADC, computational resources required are **far less than normal "lift-and-shift" always-on approaches.** Expensive cloud resources are not wasted.

Quant Library Extensions Required

  • Identify objects that benefit from AADC
  • Manage kernel lifecycle
  • Distribute market data
  • Aggregate results
  • Handle kernel expiration

Kernel Generation Optimization

When pricing a new configuration, kernel generation time is part of overall execution. To reduce this overhead, MatLogica has developed a specialized graph compiler that generates machine code directly during program execution without relying on external compilers.

However, kernel generation can take seconds to minutes for complex structures. We suggest two approaches to optimize performance:

Large Static Valuations

Portfolio pricing and risk that remains predominantly static during the trading day.

Approach: Generate kernel at beginning of day, reuse throughout. Regenerate on events (significant portfolio changes).

For larger functions, kernel generation takes longer - evaluate regeneration frequency accordingly.

Smaller Ad-Hoc Valuations

New trades, pre-trade analysis, intraday activities.

Approach: Generate kernels on-the-fly and send to cloud for execution. Aggregate with existing position and risks.

In practice, solution architects should segregate recordings according to business nature, portfolio structure, instruments, update frequency, business requirements, and existing technology stack to deliver optimal performance.

Market Data Calibration Design

  • Within pricing/risk kernel: Integrated calibration
  • Separate recording: Ensures all trades priced on same market data/models, guaranteeing consistency between independent calculations and easy reproducibility

The AADC Kernel Lifecycle

Kernel creation is triggered by the Quant Library on events that change portfolio state

  • Automatic: Based on business logic (book reconciliation, trading day start)
  • Manual: Trader pricing a new trade

Once generated, the kernel ships to cloud (grid), ready to receive market data updates, process them (including curve building, solvers/minimizers), and return risk/pricing information for aggregation and display to traders.

Summary: Benefits of AADC Cloud Live Risk

This document presents a high-level solution architecture using MatLogica AADC for cloud execution without exposing any proprietary data or models.

Performance

  • 20-50x faster than original analytics
  • Portfolio risk in milliseconds
  • ~100x cost reduction
  • Reuse for scenario analysis

Security & Integration

  • Water-tight security - binary kernels only
  • Proprietary analytics stay on premises
  • Semi-automated integration
  • Automated IFT for calibration
  • Reuse existing grid infrastructure

Ready to Implement Cloud Live Risk?

Contact us to discuss your cloud migration strategy and Live Risk requirements