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
Step 0: Turnover Projection
Step 0: Turnover Projection
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
- List of projected termination events with probabilities
Step 1: Initialization
Step 1: Initialization
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
Step 2: Determine Share Pool
Step 2: Determine Share Pool
Step 3: Allocate Shares
Step 3: Allocate Shares
Step 4: Calculate Contribution
Step 4: Calculate Contribution
Determine annual company contributionBased on
contribution_policy in OperatingAssumptions.Policy Types:- Fixed amount
- Percentage of payroll
- Discretionary formula
- Loan payment-based
Step 5: Update Vesting
Step 5: Update Vesting
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
Step 6: Process Diversification
Step 6: Process Diversification
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
Step 7: Process Repurchases
Step 7: Process Repurchases
Execute share repurchasesRepurchase shares from terminated participants using the Funding Waterfall.See: Funding Waterfall
Step 8: Year-End Closing
Step 8: Year-End Closing
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.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 followsPlanRules.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
State Capture
At the end of each annual cycle, the engine captures complete snapshots:- Company State
- Trust State
- Participant Snapshot
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
Vectorized Calculations
Vectorized Calculations
Participant-level calculations use NumPy for efficient batch processing.
Lazy Loading
Lazy Loading
Historical snapshots loaded on-demand, not preloaded into memory.
Caching
Caching
Frequently accessed reference data (e.g., plan rules) cached per simulation run.
Parallel Execution
Parallel Execution
Independent scenario runs can execute in parallel for sensitivity analysis.
.png?fit=max&auto=format&n=_b1oFDtC7brS6c3Z&q=85&s=d3ec56559a51e770e67aa19d77e1da67)
.png?fit=max&auto=format&n=AWN49C5ILGJ2VJNX&q=85&s=9e43d95342e1c0ca7d9eadaa6d3acb0d)