High Performance Financial Modelling

About the Customer

The customer is a global reinsurance company and one of the world’s leading providers of reinsurance solutions. With approximately $10 billion in gross premiums written and over $10 billion in total capital under management, they specialise in matching well-structured risks with efficient sources of capital, helping companies and government entities manage risks including climate change, natural hazards, cyber threats, and significant societal upheaval.

The Challenge

The customer faced critical limitations with their on-premises risk modelling infrastructure that was hindering business growth and agility. Their portfolio rollup process—which executes Monte-Carlo-based risk models across over 7,000 deals with complex interdependencies—processed approximately 45TB of data per run, producing 600GB of analytic output. The existing system could only support 2-3 portfolio rollup runs per day, with each run taking up to 10 hours to complete, significantly limiting their ability to reassess risk positions as portfolios evolved.

Additionally, the business required real-time deal analytics capabilities to enable underwriters to price deals on demand, sometimes while on the phone with brokers. However, executing deal analytics on the same on-premises cluster created severe resource contention, requiring careful staff coordination and causing frustration that limited business agility.

If these challenges remained unaddressed, the customer risked falling behind competitors in market responsiveness, missing revenue opportunities due to delayed pricing decisions, and facing increasing infrastructure costs without the ability to scale for future growth. The high total cost of ownership and lengthy capacity planning cycles for the on-premises cluster made it clear that the existing approach was unsustainable.

The Solution

fourTheorem partnered with the customer to reimagine their risk modelling system using a serverless-first approach on AWS, migrating away from the legacy on-premises infrastructure. Rather than simply lifting and shifting the workload to Amazon EC2, fourTheorem designed a radically different architecture optimised for both batch processing and real-time analytics.

The solution leverages AWS Step Functions as the execution planner, building dynamic execution plans that account for the complex dependency graph between deals. These plans are stored in Amazon ElastiCache for Redis for rapid access and state management throughout execution. For job orchestration, fourTheorem implemented a dual-path architecture using Amazon Kinesis streams to route jobs based on priority. High-priority, real-time deal analytics are processed through AWS Lambda, which provides instant scaling and sub-second response times—critical for underwriters who need immediate pricing information. Lower-priority batch portfolio rollups execute on AWS Fargate, which offers a more cost-effective solution for large-scale computations while still providing substantial parallelisation with up to 3,000 containers running simultaneously.

The system uses Amazon S3 as a computational data lake, storing all input parameters, exposure data, and results. Job scheduling is handled by Lambda functions that consume from Kinesis streams, dynamically submitting new jobs as dependencies are satisfied. The solution includes intelligent caching—if a deal has been recently computed with identical parameters, cached results are used, dramatically reducing redundant computation. For resilience, fourTheorem implemented comprehensive error handling through Amazon EventBridge, with automatic retry logic (up to three attempts) before marking jobs as permanently failed and alerting operations teams.

A key technical challenge was optimising AWS Fargate scaling for batch computation workloads. Standard Fargate scaling rules are designed for web applications, not high-scale batch processing requiring rapid scale-out to thousands of containers. fourTheorem developed a custom scaling algorithm leveraging the Amazon ECS RunTask API, working directly with the AWS Fargate team to increase service limits appropriately. Additionally, to handle high-scale data transfer requirements (100GiB/s during full runs across 15-20k files), fourTheorem worked closely with the AWS S3 product team to optimise key-partitioning schemes for maximum request throughput.

The entire infrastructure was deployed using Infrastructure as Code (IaC) principles with CI/CD pipelines, ensuring reliable, repeatable automated deployments and reducing operational overhead.

Results

Performance Improvements

  • Full portfolio rollup execution time reduced from 10 hours to approximately 1 hour – a 90% reduction in processing time
  • Deal analytics response times became faster and more consistent, eliminating resource contention delays
  • The system now supports 15x the original data volume with room for future growth

Cost & Efficiency

  • Overall codebase reduced by 70%, significantly lowering the total cost of ownership
  • Pay-per-use pricing model eliminated the need for upfront capacity planning and reduced infrastructure waste
  • Development teams now focus on feature development

Agility & Scalability

  • The system seamlessly switches between Lambda and Fargate depending on execution context, optimising costs for each job type
  • On-demand scaling eliminates hardware constraints, positioning the business to support future portfolio growth
  • Infrastructure as Code and CI/CD pipelines enable rapid innovation and reliable deployments

Business Impact

  • The customer can now run 5+ portfolio rollup runs per day instead of 2-3, enabling more frequent risk reassessment
  • Real-time deal analytics run thousands of times per day without impacting batch operations, dramatically improving underwriter productivity and enabling pricing decisions during live broker conversations
  • Multiple ad hoc “what if” scenario analyses can now run in parallel with predictable time and cost parameters, enabling better strategic decision-making

About the Partner

fourTheorem is an AWS Advanced Tier Services Partner specialising in cloud-native application development and serverless architectures. With deep expertise in financial services modernisation, fourTheorem helps enterprises migrate mission-critical workloads to AWS using cutting-edge serverless technologies. The company’s senior cloud architects and serverless specialists work closely with AWS product teams to solve complex technical challenges and deliver transformational business outcomes. fourTheorem holds the AWS ECS Service Delivery specialisation, and AWS Lambda Service Delivery specialisation, demonstrating validated technical expertise and proven customer success in serverless and container-based solutions.