Virtufin Lib
A C#/.NET 11 financial services library implementing the Entity-Attribute-Value (EAV) pattern, a Variant discriminated union, FlatBuffers binary serialization, and reactive observables for NATS / WebSocket / Valkey data sources.
Key Features
| Feature | Description |
|---|---|
| EAV Framework | Registry-based entity-attribute-value model with pluggable value providers |
Variant Type |
Sealed discriminated union (None / Bool / Int32 / String / Dictionary / Array) with implicit C# conversions |
DecimalAmount |
Arbitrary-precision decimal arithmetic with explicit precision (Whole/Fraction/N) |
| FlatBuffers schema | A FlatBuffers schema of the Variant kinds, read by FlatBuffersVariant (C#) |
| Reactive Observables | IObservable<T> adapters for NATS subjects, WebSocket frames, and Valkey keyspaces — with auto-reconnect |
DecimalAmount-Backed Cash |
Currency-aware money with mismatched-currency rejection |
| Position / Scenario / Contract Primitives | Financial-domain types for trading and risk workflows |
| .NET 11 / AOT-compatible | Source-generated JSON contexts; NativeAOT-ready; nullable reference types throughout |
Project Layout
The library is split into 3 projects. The only inter-project build reference is Virtufin.Base → Virtufin.Core. Virtufin.Data is standalone — it has no project references to Core or Base.
Virtufin.Core— EAV abstractions, financial contract traits,DecimalAmount. No dependency onVirtufin.Base.Virtufin.Base— Concrete implementations of the traits inCore:Currency,Cash,Position<A>,Transaction,Scenario,Metronome<T>, etc.Virtufin.Data—Varianttype, FlatBuffers schema + serialization, NATS / WebSocket / ValkeyIObservable<T>adapters. No project references to Core or Base; uses external NuGet only (Google.FlatBuffers, NATS.Net, Valkey.Glide).
How this site is organized
The site follows Diátaxis: four kinds of page for four needs.
| You want to | Read |
|---|---|
| learn the library by using it | Tutorials: install the packages, make a Variant, define an executor. |
| get a task done | How-to guides: build and test the library, build names with the naming library, add a venue's names. |
| look something up | Reference: Core EAV, Variant, FlatBuffers, observables, DecimalAmount, the conventions, the tests and CI, the glossary, the naming rules, combinators, fragments, validity, migration and core families, and the C# API reference. |
| understand how it works | Explanation: what the library is and is not, the architecture, the design decisions, the behavior layer, the naming model. |
Project README
The full project README (build commands, test commands, project overview) lives in the GitHub repo.