Optimization Engine
An engine that creates efficient frontiers under multiple constraints.

Project Inception

A US asset manager approached us to build a sophisticated portfolio optimization engine that fulfils the following requirements:

  • Let users choose from a range of target metrics to maximize (e.g. historical annual returns).
  • Let users choose from a range of risk metrics to minimize (e.g. downside standard deviation).
  • Allow for any number of constraints to be put on the portfolios (e.g. tracking error less than 10%, minimum allocation weight more than 5%).
  • Create efficient frontiers corresponding to different target/risk levels.
  • Perform analysis such as stress tests.

They gave us some sample data, but trusted us to implement the mathematical, computational and infrastructure aspects of the project. We quote them a fixed cost, and an estimate completion time of two months.

The Work

Creating the first version of the engine that satisfied all the requirements took only a month, thanks to the flexibility of the Python language. However, the run time of the engine was unacceptable, sometimes needing over 24 hours to complete. This was due to the myriad of constraints that portfolios had to satisfy.

We had to attack the performance issue from multiple angles. We sometimes reduced computational time through more extensive use of fast libraries such as numpy. Other times, we took mathematical approaches, such as through better initial guesses for optimization routines. We then overlaid many of the routines with parallel processing.

After implementing everything, we were able to reduce the run time down to a few minutes at most. We deployed the algorithm on the client's AWS servers. We continue to have a working relationship with the clients on other projects.

“Jin has built our Optimization engine with minimal guidance, and achieved our initial specifications ahead of schedule. He was very easy to work and communicate with, and we look forward to working with him again on future projects.”

Bill Himpele

Director of Product and Account Management

Get to know us
Let's talk