In chapter 1, we discussed a Timeline case study. Recall that the Timeline company provides a web application that helps financial advisers with retirement financial planning. This application needs to perform a lot of on-demand computations while having a fast response time. In this chapter, we will create a web service that serves a similar purpose in a simplified setting.
Imagine we are working at a company that offers its customers a service of evaluating financial assets. You are asked to create a web service that will perform pricing of an Asian option. Asian options are financial instruments whose price depends on an average price of an underlying asset (for example, a stock) over a certain period; in section 14.1, I give details of how this option is defined.
Since the Asian option is a complex financial instrument, there is no simple formula for its value. Therefore, you need to perform a Monte Carlo simulation to approximate this value. When doing a Monte Carlo simulation, we randomly sample the evolution of the underlying asset’s price multiple times. Next, for each price path, we compute the payoff of the Asian option and use the average payoff to approximate the option’s value.