Skip to main content

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: The TrustCashLedger 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: Each ESOPLoan directly owns its suspense shares:
Critical: This prevents cross-contamination and ensures ERISA compliance.
Problem: Mixing unchanging legal requirements with variable business decisions leads to configuration errors. Solution: Two distinct input models:

Data Model Principles

All models use strong typing with validation:
Historical snapshots are immutable; current state is mutable during processing:
Models include descriptions and constraints:
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

Next Steps

ESOPTrust

The central accounting hub

TrustCashLedger

Non-fungible cash tracking

ESOPLoan

Loan-specific suspense shares

PlanRules

Legal framework schema

OperatingAssumptions

Strategy configuration

API Schemas

Full API schema reference