Quantlet Box is a real-time, event driven framework for analytic computing. The main objective of this project – in a nutshell – is to emphasize reuse and simplify the development of software to support just-in-time use cases in quantitative finance.

The full fledged Quantlet project is described here

“The Box”

“The Box”, the framework, is the designation for a number of services aimed to simplify the development of event-driven solutions in general and analytical applications in particular.

An outline of the functional blocks of this architecture:

  • Mediation Engine
  • Normalized Event Bus
  • Complex Event Processor
  • Analytical Engine
  • Q-Let Container
  • Compute and Storage Grid

We will describe each of these functions in further writings.

Q-Let: the Building Block

The most fundamental building block in the Box is called a Q-Let. Each Q-Let is a service: stateless, language agnostic and designed from the grounds up for performance, testability and reusability. They operate on real-time streams of data.

Q-Lets are defined in terms of the fundamental function they perform: calculating the implied volatility; value an american option using vectorial lattices and so forth.

Q-Lets execute in a container. The container abstracts concerns related to multi-threading and real-time processing.

A Q-Let container is built primarily for reliability and performance. In a typical 2008-ish laptop the default container is able to handle transactionally hundreds of thousands of events in a second.

Gentlemen, bring your Models

There is more to The Box than just Q-Lets. All components necessary to support specific use cases are bundled together in what is called a Model. A Model is the unit of deployment and is put together based on a configuration, and is the materialization of specific use cases:

Typical real-time risk scenario: You have hundreds of thousands of portfolios. Some data sources publish an updated price tick for a set of securities wherein some of these securities match the ones in your portfolio. You have to calculate, store and publish your value at risk at aggregated intervals (say 5 minutes) for price change, for different confidence levels say 90% and 95%.

Or,

On demand option pricing: You subscribe to a number of feeds from where you receive up to date prices of securities. You only care about securities serving as underlying for a portfolio of American calls and puts. On a price change you have to calculate all necessary parameters to price these calls and puts, store and publish parameters and price.

A Model is the definition – based in a configuration – of the relationship between multiple types of components and functions in The Box:

  • One or more Q-Lets
  • An (optional) implementation of a normalized event
  • One or more mediation rules
  • Zero or more transformation rules
  • Zero or more event querying rules
  • Zero or more analytical functions

Each instance of the Box can support multiple components. On the next sections we will dissect each of the components listed before.