Functional Programming in Financial Markets by Damián Soriano

September 13, 2023


In this talk we showcase the application of functional programming in a very large industrial setting. At Standard Chartered Bank, Haskell forms the core of a software library supporting the entire Financial Markets (FM), a business line with 5.7 billion USD operating income in 2022. Typed functional programming is used across the entire tech stack, including foundational APIs and CLIs for deal valuation and risk analysis, server-side components for long-running batches or sub-second RESTful services, and end-user GUIs. Thousands of users interact with software built using functional programming, and over one hundred write their own functional code.

We present the history of how functional programming established itself in FM, including the rationale for having our own compiler and dialect of Haskell. We then focus on how we leverage it to orchestrate type-driven large-scale pricing workflows. The same API can be used to price one trade locally, or millions of trades across thousands of nodes in the cloud. We build upon decades of research and experience in the functional programming community, relying on concepts such as monads, lenses, datatype generics, and closure serialisation.

Damián Soriano
Damian pursued a Licentiate in Computer Science, completing a comprehensive 5-year program at Universidad Nacional de Rosario, Argentina. Subsequently, he achieved a Master of Science in Computer Engineering from Politecnico di Milano, Italy. In September 2017, he joined Standard Chartered Bank, where he currently serves as a Senior Quantitative Developer within the Strats team. Damian’s professional background encompasses diverse experiences across various companies in Argentina, Italy, and the United Kingdom, prior to his tenure at Standard Chartered.

https://www.linkedin.com/in/damiansoriano/

Overview of the presentation

Introduction to financial markets context: Damian introduces the context of financial markets, emphasizing the complexity of legally binding contracts and the necessity for quantitative analysts to price these contracts accurately.

Team structure at Standard Chartered: Damian outlines the team structure at Standard Chartered, mentioning Core Strat (a Haskell development team) and MAG (Modeling and Analytic Group), which includes quants (quantitative analysts) and project managers.

Role of quants: The talk highlights the critical role of quants in creating models and implementing them to price financial contracts effectively.

History of Functional Programming in finance: Damian delves into the history of using functional programming languages, specifically Haskell and Mu, at Standard Chartered. He explains the creation of Mu to address the need for a more robust programming language within the existing ecosystem.

Introduction to cortex pricing library: The presentation introduces Cortex, the primary pricing library at Standard Chartered, and explains how Mu is employed in Cortex for quantitative finance.

GUI Applications for traders: Damian emphasizes the team’s reliance on GUI (Graphical User Interface) applications for traders, mentioning Widget and Virtual Widget libraries used for building interfaces.

Code example using Mu in Cortex: A brief code example is presented to demonstrate how Mu is used in Cortex. The example involves computing interest rate delta and sending the results via email.

Key differences between Mu and Haskell: Damian discusses significant differences between Mu and Haskell, including Mu’s strict runtime and its discouragement of explicit recursion.

Ongoing developments and integration with GHC: The talk concludes with insights into ongoing developments, including plans to integrate Mu with GHC (Glasgow Haskell Compiler) to streamline the compilation process.

Statistics and team growth: Damian shares statistics, including the number of contributors, commits, lines of code, and information about the team’s growth over time.

Invitation for Haskell developers: The presentation concludes with an invitation for Haskell developers to explore job opportunities at Standard Chartered.

Overall, the talk provides a detailed exploration of Mu, Haskell, and functional programming in the specific context of financial modeling and analytics at Standard Chartered. It showcases real-world examples and highlights the unique features and applications of Mu within the financial industry.

 

The overview is summarized with ChatGPT using Deepgram to transcribe the video.

Check out more from the MeetUp Func Prog Sweden. Func Prog Sweden is the community for anyone interested in functional programming. At the MeetUps the community explore different functional languages like Erlang, Elixir, Haskell, Scala, Clojure, OCaml, F# and more.