Hi all, sharing orcaset, a library for building financial statement models in code.
Orcaset aims to give agents a robust tool for financial analysis. Based on tests against Claude and Codex Excel tools I’ve seen lower model error rates while using ~40% fewer tokens. I expect the gap to widen as a function of model scale (e.g. easier to reuse components in orcaset) but haven’t benchmarked in depth beyond models of a few hundred line items.
It’s mainly built from a private equity and credit perspective, but there’s nothing inherently specific to those industries.
A trivially simple example below for a taste of what it looks like.
open Orcaset
open Series
let offset = Offset.make ~quarters:1 ~month_end:true ()
let periods = Period.make_seq ~start:(Date.make 2026 1 1) ~offset |> Seq.take 4 |> List.of_seq
let revenue_proj =
List.mapi (fun i period -> (period, 100.0 *. (1.03 ** float_of_int (i - 1)))) periods
(* Define model *)
let revenue = Spans.of_list ~label:"Revenue" ~split:Split.daily ~agg:Agg.sum revenue_proj
let costs = Spans.scale ~label:"Costs" (-0.45) revenue
let income = Spans.sum ~label:"Income" ~agg:Agg.sum [ revenue; costs ]
(* Build and print statement *)
let () =
let stmt = Stmt.span_total income (Stmt.span_lines [ revenue; costs ]) in
let resolved = Stmt.eval_periods periods stmt in
Printf.printf "\n%s\n\n" (Stmt.fixed_width resolved)
(* Output:
2026-04-30 2026-07-31 2026-10-31 2027-01-31
Revenue 97.09 100.00 103.00 106.09
Costs -43.69 -45.00 -46.35 -47.74
---------- ---------- ---------- ----------
Income 53.40 55.00 56.65 58.35 *)
Calculations are fully auditable. Line item relationships can be statically inspected, and dependencies across materialized values can also be traced. Dependencies can be cyclic, meaning you can easily model revolver plugs (or solve revenue growth to a 20% return, as is tradition).
Experimental, but would appreciate feedback or suggestions!