Skip to main content

The Heart of the Engine

The Simulation Core is a discrete, step-by-step annual processing pipeline. For each year of a projection, the engine executes a sequence of modules, each responsible for a specific aspect of ESOP administration.
This strict order of operations ensures that legal obligations are met before discretionary actions are taken.

Annual Processing Cycle

Processing Steps Overview

Optional predictive moduleUses statistical models to forecast which employees will terminate in the current year.Inputs:
  • Participant age, tenure, compensation
  • Historical turnover rates
  • Industry benchmarks
Output:
  • List of projected termination events with probabilities
Calculate share price and prepare for annual processingInitialize the annual processing cycle by calculating current share price and preparing state variables.Actions:
  • Calculate per-share value from company equity and outstanding shares
  • Apply annual growth rate to company equity value
  • Initialize security-specific prices in multi-class mode
  • Set up year-specific state variables
Calculate shares available for allocationCritical step that implements loan-by-loan share release mechanics.Sources:
  • New company contributions (stock)
  • Released suspense shares from ESOP loans
  • Reallocated forfeitures
See: Loan-by-Loan Mechanics
Distribute shares to participant accountsApply allocation formula to credit shares to individual accounts.Formula Options:
  • Pro-rata by compensation
  • Pro-rata by hours
  • Integrated (Social Security-adjusted)
Determine annual company contributionBased on contribution_policy in OperatingAssumptions.Policy Types:
  • Fixed amount
  • Percentage of payroll
  • Discretionary formula
  • Loan payment-based
Calculate vested balances and potential forfeituresApply the plan’s vesting schedule to determine vested vs unvested portions of participant accounts.Actions:
  • Apply vesting schedule based on years of service
  • Calculate vested percentages for each participant
  • Identify non-vested amounts subject to forfeiture
  • Track vesting per security in multi-class mode
  • Apply vesting to both shares and cash balances
Handle statutory diversificationProcess elections from eligible participants (age 55+ with 10+ years).Actions:
  • Identify eligible participants
  • Process diversification elections
  • Calculate amounts (25% or 50% of account)
  • Move funds to diversified investments
Execute share repurchasesRepurchase shares from terminated participants using the Funding Waterfall.See: Funding Waterfall
Finalize annual results and prepare for next yearRoll account balances forward, evolve employee data, and capture year-end snapshots.Actions:
  • Move allocated/diversified amounts to opening balances
  • Age employees by 1 year and increment service years
  • Apply compensation growth rates
  • Remove fully distributed participants
  • Capture year-end state snapshots and KPIs

Key Logic Modules

Loan-by-Loan Share Release

For leveraged ESOPs with multiple debt tranches, the engine implements precise loan-by-loan accounting.
Critical: Each ESOPLoan object directly owns the shares that collateralize it. This prevents cross-contamination of suspense accounts.

How It Works

1

Iterate Through Loans

2

Calculate Payment

Determine principal and interest for current year based on loan terms
3

Release Shares

4

Update Loan Balance

Example: Multi-Loan Scenario

Why This Matters: Without loan-by-loan tracking, shares from one loan could incorrectly be released when paying down another loan, violating ERISA requirements and creating audit risk.

Funding Waterfall

The repurchase processing module implements a strict, rules-based sequence for drawing funds from the trust’s cash accounts.

The Waterfall Sequence

The engine follows PlanRules.cash_usage_policy to draw funds in the specified order:

Processing Algorithm

1

Calculate Total Repurchase Need

2

Apply Waterfall

3

Handle Shortfall

Example: Waterfall in Action

Legal Compliance: The order matters! For example, forfeiture cash often has restrictions on use. The waterfall ensures compliance with plan document rules and ERISA regulations.

State Capture

At the end of each annual cycle, the engine captures complete snapshots:

Error Handling & Validation

The engine performs extensive validation at each step:

Input Validation

  • Schema compliance
  • Business rule checks
  • Data completeness
  • Referential integrity

Processing Checks

  • Share count reconciliation
  • Cash balance validation
  • Loan payment calculations
  • Legal compliance flags

Output Verification

  • Total shares consistency
  • Cash flow balance
  • Participant account totals
  • Year-over-year deltas

Audit Logging

  • Every transaction logged
  • Decision points captured
  • Assumption tracking
  • Error breadcrumbs

Performance Optimizations

Participant-level calculations use NumPy for efficient batch processing.
Historical snapshots loaded on-demand, not preloaded into memory.
Frequently accessed reference data (e.g., plan rules) cached per simulation run.
Independent scenario runs can execute in parallel for sensitivity analysis.

Next Steps

Processing Steps

Detailed breakdown of each simulation step

Data Layer

How state is persisted and retrieved

Data Models

Core objects used in processing

Examples

See the engine in action