Model Philosophy
At Village Labs, we built our Repurchase Engine on a set of high-fidelity data models that we designed to accurately reflect ESOP accounting and legal structures. We believe that models should not be mere data containers; they must embody the complex relationships and rules that govern ESOP operations.Our Design Goal: To create models that map 1:1 to real-world ESOP concepts, making the system intuitive for practitioners while maintaining the technical precision we demand.
Core Models
ESOPTrust
Central accounting hub for all plan assets and liabilities
TrustCashLedger
Non-fungible cash accounting by source
ESOPLoan
Self-contained loan with dedicated suspense shares
Participant
Individual participant account and demographics
PlanRules
Legal framework and compliance rules
OperatingAssumptions
Annual strategy and financial assumptions
Model Hierarchy
Key Modeling Concepts
1. Non-Fungible Cash
Problem: In traditional accounting, all cash is fungible (interchangeable). But ESOP trust cash has source-based restrictions on use. Solution: TheTrustCashLedger segregates cash by source:
Real-World Analog: Think of it like a restaurant where tips (participant cash) can only go to employees, while owner contributions can be used flexibly.
2. Loan-Owned Suspense Shares
Problem: Multiple ESOP loans each collateralized by specific shares. Shares from Loan A shouldn’t be released when paying Loan B. Solution: EachESOPLoan directly owns its suspense shares:
3. Separation of Legal vs. Strategy
Problem: Mixing unchanging legal requirements with variable business decisions leads to configuration errors. Solution: Two distinct input models:- PlanRules (Legal)
- OperatingAssumptions (Strategy)
Data Model Principles
1. Type Safety
1. Type Safety
All models use strong typing with validation:
2. Immutability Where Appropriate
2. Immutability Where Appropriate
Historical snapshots are immutable; current state is mutable during processing:
3. Self-Documenting
3. Self-Documenting
Models include descriptions and constraints:
4. Relationship Integrity
4. Relationship Integrity
Models enforce referential integrity:
Model Lifecycle
Models flow through distinct lifecycle stages:1
Configuration
User provides input data (PlanRules, OperatingAssumptions, InitialState)
2
Validation
Models are validated for completeness, consistency, and legal compliance
3
Processing
Engine manipulates mutable models during annual simulation cycle
4
Snapshot
End-of-year state captured as immutable snapshot
5
Persistence
Snapshot saved to database with full audit trail
Common Patterns
Composition Over Inheritance
Models favor composition for flexibility:Builder Pattern for Complexity
Complex models use builders:Factory Methods for Common Scenarios
Serialization & Deserialization
All models support JSON serialization:Model Documentation
Each model includes comprehensive documentation:- Field descriptions: What each field represents
- Constraints: Valid ranges and rules
- Examples: Common use cases
- Related models: How models connect
- Legal context: ERISA/IRS requirements
.png?fit=max&auto=format&n=_b1oFDtC7brS6c3Z&q=85&s=d3ec56559a51e770e67aa19d77e1da67)
.png?fit=max&auto=format&n=AWN49C5ILGJ2VJNX&q=85&s=9e43d95342e1c0ca7d9eadaa6d3acb0d)