Simulation Engine
The simulation engine computes expected PnL for a specific position, incorporating all model adjustments.
Simulation Pipeline
Input Parameters
↓
1. Gross Funding PnL
↓
2. Decay Adjustment
↓
3. Survivability Adjustment
↓
4. Capacity Adjustment
↓
5. Fee Deduction
↓
Net Expected PnLInput Parameters
| Parameter | Symbol | Description |
|---|---|---|
| Position Size | USD notional | |
| Holding Horizon | Hours | |
| Entry Fee | Basis points | |
| Exit Fee | Basis points |
Step 1: Gross Funding PnL
Raw expected funding over the holding period:
Where 8760 = hours per year.
Step 2: Decay Adjustment
Apply the decay factor for the holding horizon:
Where:
Step 3: Survivability Adjustment
Apply the survivability score:
Or equivalently using mirage ratio:
Step 4: Capacity Adjustment
Apply the capacity penalty:
Where:
Step 5: Fee Deduction
Calculate total fees:
Final net PnL:
Net Expected Return
As a percentage of position size:
Complete Example
Inputs:
- Position USD
- Horizon hours
- Entry fee = 5 bps
- Exit fee = 5 bps
- hours
- Survivability
- USD
Step 1: Gross PnL
Step 2: Decay Adjustment
Step 3: Survivability
Step 4: Capacity
- Position (20k) is less than (30k), so
Step 5: Fees
Final Result:
Breakeven Analysis
The simulation can identify:
- Breakeven horizon — Minimum holding time for positive returns
- Breakeven size — Maximum position before fees consume all returns
- Optimal horizon — Holding period maximizing return %