Analysis updated 2026-05-18
Model option, forward, and swap pricing as a reusable, cached computation graph.
Run macro stress tests across multiple market regimes on the same portfolio definition.
Trace and export a financial scenario's computation graph as a DOT diagram for review.
Generate reproducible Monte Carlo risk estimates using a fixed seed.
| tripp-smith/lean-lfse | cajal-technologies/talos | mathtensor/ai4math-putnam2025 | |
|---|---|---|---|
| Stars | 0 | 11 | 13 |
| Language | Lean | Lean | Lean |
| Setup difficulty | moderate | hard | moderate |
| Complexity | 4/5 | 5/5 | 4/5 |
| Audience | developer | researcher | researcher |
Figures from each repo's GitHub metadata at analysis time.
Requires the Lean 4 toolchain and lake build system, plus familiarity with functional programming.
Lean-lfse is the Lazy Financial Scenario Engine, a library and command line tool written in Lean 4, a functional programming language with built in support for formal verification, for describing and evaluating financial scenarios in a way that is auditable and reproducible. The core idea is that financial calculations, such as pricing options, running stress tests, modeling interest rate swaps, and allocating cash through structured tranches, are represented as a graph of lazy computations rather than a flat sequence of function calls. Lazy means a calculation is only actually performed when its result is needed, and once computed, the result is cached and reused everywhere it is referenced. This avoids doing the same expensive calculation twice when many reports share inputs, and it makes it possible to trace exactly which parts of a scenario were evaluated and why. The engine includes a domain specific language, or DSL, for writing financial scenarios directly in Lean code, covering instruments like call and put options, forwards, and swaps. Scenarios can be evaluated from the command line with output in JSON or YAML format, traced to show which nodes were forced, or exported as DOT graph files for visual inspection. A synthetic scenario suite is included to demonstrate realistic workflows: multi asset portfolios evaluated across macro stress regimes, Monte Carlo risk reports with a fixed seed for reproducibility, and asset backed security waterfall allocations. The project also notes several correctness fixes it has hardened against, such as making sure Monte Carlo returns explicit errors instead of silently returning zero for unsupported cases. The README does not state a license for this project.
A Lean 4 library and CLI for building auditable financial pricing scenarios as lazy, cached, traceable computation graphs.
Mainly Lean. The stack also includes Lean 4, CLI.
Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.