FYOS Documentation is synchronized to the current clean-core beta baseline.
Methodology
Simulation Engine

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 PnL

Input Parameters

ParameterSymbolDescription
Position SizePPUSD notional
Holding HorizonhhHours
Entry FeeFentryF_{entry}Basis points
Exit FeeFexitF_{exit}Basis points

Step 1: Gross Funding PnL

Raw expected funding over the holding period:

PnLgross=APRf×P×h8760PnL_{gross} = APR_f \times P \times \frac{h}{8760}

Where 8760 = hours per year.

Step 2: Decay Adjustment

Apply the decay factor for the holding horizon:

PnLdecay=PnLgross×D(h)PnL_{decay} = PnL_{gross} \times D(h)

Where:

D(h)=1eλhλhD(h) = \frac{1 - e^{-\lambda h}}{\lambda h}

Step 3: Survivability Adjustment

Apply the survivability score:

PnLsurv=PnLdecay×S100PnL_{surv} = PnL_{decay} \times \frac{S}{100}

Or equivalently using mirage ratio:

PnLsurv=PnLdecay×(1M)PnL_{surv} = PnL_{decay} \times (1 - M)

Step 4: Capacity Adjustment

Apply the capacity penalty:

PnLcap=PnLsurv×PcapPnL_{cap} = PnL_{surv} \times P_{cap}

Where:

Pcap=min(1,CsoftP)γP_{cap} = \min\left(1, \frac{C_{soft}}{P}\right)^{\gamma}

Step 5: Fee Deduction

Calculate total fees:

Ftotal=P×Fentry+Fexit10000F_{total} = P \times \frac{F_{entry} + F_{exit}}{10000}

Final net PnL:

PnLnet=PnLcapFtotalPnL_{net} = PnL_{cap} - F_{total}

Net Expected Return

As a percentage of position size:

Rnet=PnLnetP×100R_{net} = \frac{PnL_{net}}{P} \times 100

Complete Example

Inputs:

  • APRf=150%APR_f = 150\%
  • Position P=20,000P = 20{,}000 USD
  • Horizon h=48h = 48 hours
  • Entry fee = 5 bps
  • Exit fee = 5 bps
  • thalf=36t_{half} = 36 hours
  • Survivability S=70S = 70
  • Csoft=30,000C_{soft} = 30{,}000 USD

Step 1: Gross PnL

PnLgross=1.50×20000×488760=164.38PnL_{gross} = 1.50 \times 20000 \times \frac{48}{8760} = 164.38

Step 2: Decay Adjustment

  • λ=ln(2)/36=0.0193\lambda = \ln(2) / 36 = 0.0193
  • D(48)=(1e0.0193×48)/(0.0193×48)=0.62D(48) = (1 - e^{-0.0193 \times 48}) / (0.0193 \times 48) = 0.62
PnLdecay=164.38×0.62=101.92PnL_{decay} = 164.38 \times 0.62 = 101.92

Step 3: Survivability

PnLsurv=101.92×0.70=71.34PnL_{surv} = 101.92 \times 0.70 = 71.34

Step 4: Capacity

  • Position (20k) is less than CsoftC_{soft} (30k), so Pcap=1.0P_{cap} = 1.0
PnLcap=71.34×1.0=71.34PnL_{cap} = 71.34 \times 1.0 = 71.34

Step 5: Fees

Ftotal=20000×5+510000=20.00F_{total} = 20000 \times \frac{5 + 5}{10000} = 20.00

Final Result:

PnLnet=71.3420.00=51.34PnL_{net} = 71.34 - 20.00 = 51.34 Rnet=51.3420000×100=0.257%R_{net} = \frac{51.34}{20000} \times 100 = 0.257\%

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 %
Cookie preferences
We use cookies to improve analytics and user experience. You can accept or reject non-essential cookies. Learn more in our Privacy Policy.