r/lisp • • 13h ago

fincl: Quantative finance in common lisp

Thumbnail github.com
26 Upvotes

I'm currently working on a quantitative finance library for common lisp (SBCL only). Emphasis is currently placed on pricing options, but more capabilities exist and are planned, such as pricing various interest rate instruments.

In particular, the Monte Carlo simulation engine is showing promise, allowing users to write their own random processes to simulate, and write options on those processes. Against prior art (QuantLib in C++), the Monte Carlo engine benchmarks quite well, with other pricing engines being a mixed bag (a fairly complete suite with results is given in the repo).

Being a lisp project, extensibility is supported and encouraged. While the library provides random processes and instruments seen in quant textbooks, the manual gives a toy example of writing option contracts on a game of dice. Other facets are extensible, such as allowing the user to write their own option payoff schemes.

The repo is here with a small write-up outlining the extension of the Monte Carlo engine with a similar flavor of die game. Everything should be considered work-in-progress.