Skip to content

Financial Management

Betterment uses Julia to help clients better manage $29 billion

Betterment is a financial advisory company founded in 2008 to help clients invest their savings, plan for retirement and set and meet other financial goals.

Betterment’s Quantitative Investment team develops models designed to provide Betterment clients with accurate financial projections and recommendations to help them make important decisions about spending, saving and investment.

Betterment engineer Dan Felicetta explains:

“We’re using Julia to power the projections and recommendations we provide to help our customers achieve their financial goals. We’ve found it to be a great solution to our own version of the “two-language problem” – the idea that the language in which it is most convenient to write a program is not necessarily the language in which it makes the most sense to run that program.

We’ve invested significant resources in modernizing … by converting our codebase from R to Julia ... we’re now able to ship updates to our quantitative models quicker, and with less risk of errors being introduced in translation. Currently, Julia powers all the projections shown inside our app, as well as a lot of the advice we provide to our customers. The Julia library we built for this purpose serves around 18 million requests per day, and very efficiently at that.

Julia … looked like a perfect fit for the investing team for a number of reasons:

  • Speed. If you’ve heard one thing about Julia, it’s probably about its blazingly fast performance. For us, speed is important as we need to be able to provide real-time advice to our customers by incorporating their most up-to-date financial scenario in our projections and recommendations. It is also important in our research code where the iterative nature of research means we often have to re-run financial simulations or models multiple times with slight tweaks.

  • Dynamicism. While speed of execution is important, we also require a dynamic language that allows us to test out new ideas and prototype rapidly. Julia ticks the box for this requirement as well by using a just-in-time compiler that accommodates both interactive and non-interactive workflows well. Julia also has a very rich type system where researchers can build prototypes without type declarations, and then later refactoring the code where needed with type declarations for dispatch or clarity. In either case, Julia is usually able to generate performant compiled code that we can run in production.

  • Relevant ecosystem. While the nascency of Julia as a language means that the community and ecosystem is much smaller than those of other languages, we found that the code and community oversamples on the type of libraries that we care about. Julia has excellent support for technical computing and mathematical modelling.

Given these reasons, Julia is the perfect language to serve as a solution to the “two-language problem”. This concept is oft-quoted in Julian circles and is perfectly exemplified by the previous workflow of our team: Investing Subject Matter Experts (SMEs) write domain-specific code that’s solely meant to serve as research code, and that code then has to be translated into some more performant language for use in production. Julia solves this issue by making it very simple to take a piece of research code and refactor it for production use."