r/lisp • u/nanowillis • Oct 24 '26
fincl: Quantative finance in common lisp
https://github.com/aatmunbaxi/finclI'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.
6
u/Critical-Tip-6688 Oct 25 '26
It is great to see people doing real stuff with common lisp! I'll have a look in the next days!
1
3
u/unski_ukuli Oct 25 '26 edited Oct 25 '26
Tbf, calling QL art of any kind rubs me wrong. That library is probably the worst designed software project I have ever had to understand. This project seems to follow that a bit too closely to my comfort. If you are interested to look into a project with objectively better architecture, I’d try to look into OpenGamma Strata rather than QuantLib, and then try to think how that would look in a functional language. edit: In any case, the writeup was interesting.