Skip to content

Instantly share code, notes, and snippets.

@yongkangc
Last active January 30, 2026 10:55
Show Gist options
  • Select an option

  • Save yongkangc/b12eb700e7e060b37b4c0d458d8fa874 to your computer and use it in GitHub Desktop.

Select an option

Save yongkangc/b12eb700e7e060b37b4c0d458d8fa874 to your computer and use it in GitHub Desktop.
pm-replay parameter sweep results - 100 runs across min_edge_bps, volatility, blend_weight

Parameter Sweep Report - 2 Hour Backtest

Date: 2026-01-30
Time Window: Last 2 hours
Total Runs: 100

Key Findings

All Runs Unprofitable

  • P&L Range: -$112.63 to -$82.21
  • Profitable Runs: 0/100

This is expected because:

  1. One-sided trading: All 100 runs show buy_count > 0 but sell_count = 0
  2. No inventory liquidation: Without sells, unrealized losses accumulate
  3. Binary market decay: Up/down markets resolve at 0 or 1 — holding decaying positions loses money

Parameter Sensitivity

Best: Lower Edge, Higher Blend Weight

Rank Edge (bps) Vol Blend P&L
1 200 0.5 1.0 -$82.21
2 200 0.5 0.7 -$84.04
3 200 0.3 1.0 -$84.86

Worst: Higher Edge, 0.7 Blend Weight

Rank Edge (bps) Vol Blend P&L
98 500 0.5 0.7 -$110.32
99 500 1.0 0.7 -$110.70
100 400 0.7 0.7 -$112.63

Average P&L by Parameter

By min_edge_bps:

Edge Avg P&L Avg Fills Avg Volume
100 -$95.14 34.6 $344.79
200 -$93.76 34.4 $342.87
300 -$99.66 40.5 $403.65
400 -$100.82 40.8 $407.14
500 -$101.59 40.8 $407.12

By volatility:

Vol Avg P&L Avg Fills
0.3 -$96.72 38.1
0.5 -$97.21 38.2
0.7 -$99.25 38.3
1.0 -$99.59 38.3

By blend_weight:

Blend Avg P&L Avg Fills
0.0 -$99.32 38.0
0.3 -$99.18 38.2
0.5 -$97.77 38.4
0.7 -$100.78 37.9
1.0 -$93.91 38.5

Observations

  1. Lower edge (100-200 bps) outperforms higher edge settings
  2. Lower volatility (0.3-0.5) slightly outperforms higher volatility
  3. Blend weight 1.0 (pure Black-Scholes) produces best results
  4. Blend weight 0.7 consistently worst — mixing 70% BS with 30% market mid causes issues

Recommendations

For live trading with inventory management:

[strategy]
min_edge_bps = 200       # Lower edge = better P&L in backtest
default_bs_volatility = 0.5   # Mid-range volatility
blend_weight = 1.0       # Pure Black-Scholes pricing (don't trust market mid)

Caveats

  • No sells simulated: The fill simulator only generates fills when orders would be hit, but the strategy never produces sell quotes (missing symmetric inventory management)
  • Infinite capital assumed: No cash constraint enforcement
  • Conservative fill logic: Only fills when market crosses limit price

Next Steps

  1. Investigate why strategy produces 0 sells
  2. Add inventory-based skew to encourage selling
  3. Re-run sweep with functioning two-sided market making
min_edge_bps volatility blend_weight duration_secs event_count fill_count buy_count sell_count volume_usd realized_pnl unrealized_pnl total_fees total_pnl run_time_secs
100 0.3 0.0 7199 235841 34 34 0 339.493 0 -102.923 -1.83627189625 -101.08672810375 51.584058385
100 0.3 0.5 7199 235841 35 35 0 349.262 0 -91.8908 -0.2822674707 -91.6085325293 54.411214244
100 0.3 0.7 7199 235841 35 35 0 348.725 0 -91.5841 0.10055255545 -91.68465255545 55.188165604
100 0.5 0.3 7199 235841 34 34 0 339.504 0 -103.20845 -1.831702016 -101.376747984 55.884420051
100 0.5 0.0 7199 235841 34 34 0 339.493 0 -102.923 -1.83627189625 -101.08672810375 56.375945956
100 0.3 1.0 7199 235841 35 35 0 346.944 0 -90.8752 0.0435987344 -90.9187987344 56.627536846
100 0.3 0.3 7199 235841 34 34 0 339.504 0 -103.20845 -1.831702016 -101.376747984 57.634295625
100 0.5 0.5 7199 235841 35 35 0 349.262 0 -91.8908 -0.2822674707 -91.6085325293 60.828861186
100 0.7 0.0 7199 236192 34 34 0 339.493 0 -103.703 -1.83627189625 -101.86672810375 48.915136327
100 0.5 0.7 7199 236299 35 35 0 348.725 0 -92.1201 0.10055255545 -92.22065255545 54.30130473
100 0.7 0.3 7199 236324 34 34 0 339.504 0 -103.96545 -1.831702016 -102.133747984 54.219561125
100 1.0 0.0 7199 236380 34 34 0 339.493 0 -103.106 -1.83627189625 -101.26972810375 49.617830044
100 0.5 1.0 7199 236221 35 35 0 346.944 0 -91.2912 0.0435987344 -91.3347987344 56.373757678
100 0.7 1.0 7199 236304 35 35 0 346.944 0 -91.4992 0.0435987344 -91.5427987344 57.492308163
100 0.7 0.7 7199 236320 35 35 0 348.725 0 -92.2841 0.10055255545 -92.38465255545 59.085474094
100 0.7 0.5 7199 236321 35 35 0 349.262 0 -92.6318 -0.2822674707 -92.3495325293 60.520011009
100 1.0 0.3 7198 237036 34 34 0 339.504 0 -101.09845 -1.831702016 -99.266747984 52.011284303
100 1.0 0.5 7199 237037 35 35 0 349.262 0 -89.7808 -0.2822674707 -89.4985325293 51.624517804999996
100 1.0 0.7 7199 237038 35 35 0 348.725 0 -89.3721 0.10055255545 -89.47265255545 53.51773918
100 1.0 1.0 7199 237038 35 35 0 346.944 0 -88.5872 0.0435987344 -88.6307987344 54.857233552
200 0.3 0.5 7199 237054 34 34 0 339.384 0 -98.63395 -1.8275042917 -96.8064457083 50.921960807
200 0.3 0.0 7199 237041 34 34 0 339.337 0 -98.8308 -2.23825313675 -96.59254686325 58.99356827
200 0.3 0.7 7199 237140 35 35 0 349.028 0 -87.56865 -0.688807099 -86.879842901 53.329987818
200 0.3 0.3 7199 237056 34 34 0 339.358 0 -99.3511 -2.2429194727 -97.1081805273 58.209873428
200 0.3 1.0 7199 237445 35 35 0 347.256 0 -85.2028 -0.343862516 -84.858937484 49.290321613
200 0.5 0.0 7199 237557 34 34 0 339.337 0 -98.9848 -2.23825313675 -96.74654686325 53.926781505
200 0.5 0.3 7199 237722 34 34 0 339.358 0 -96.6166 -2.2429194727 -94.3736805273 52.405803793
200 0.5 0.7 7199 237791 35 35 0 349.028 0 -84.72565 -0.688807099 -84.036842901 51.314374816
200 0.5 0.5 7199 237660 34 34 0 339.384 0 -95.79545 -1.8275042917 -93.9679457083 54.908832256
200 0.7 0.0 7199 237757 34 34 0 339.337 0 -97.5103 -2.23825313675 -95.27204686325 56.696201016
200 0.5 1.0 7199 237771 35 35 0 347.256 0 -82.5528 -0.343862516 -82.208937484 63.656891872
200 0.7 0.3 7198 237955 34 34 0 339.358 0 -96.8011 -2.2429194727 -94.5581805273 61.930956073
200 0.7 0.5 7198 239035 34 34 0 339.384 0 -103.08295 -1.8275042917 -101.2554457083 51.187928616
200 0.7 0.7 7199 239228 35 35 0 349.028 0 -93.09315 -0.688807099 -92.404342901 53.865166933
200 0.7 1.0 7199 239376 35 35 0 347.256 0 -88.0648 -0.343862516 -87.720937484 56.129706902
200 1.0 0.0 7199 239481 34 34 0 339.337 0 -103.4953 -2.23825313675 -101.25704686325 54.826771124
200 1.0 0.3 7199 239438 34 34 0 339.358 0 -103.2876 -2.2429194727 -101.0446805273 53.773455121
200 1.0 0.5 7199 239879 34 34 0 339.384 0 -105.46195 -1.8275042917 -103.6344457083 55.257981615
200 1.0 0.7 7199 240214 35 35 0 349.028 0 -93.93415 -0.688807099 -93.245342901 56.555584295
200 1.0 1.0 7199 240211 35 35 0 347.256 0 -91.5628 -0.343862516 -91.218937484 60.01548997
300 0.3 0.0 7199 240829 38 38 0 379.312 0 -101.9929 -2.520959993 -99.471940007 49.018850442
300 0.3 0.3 7198 241348 41 41 0 409.288 0 -101.1343 -2.7173622625 -98.4169377375 50.877875356
300 0.3 0.5 7199 241506 41 41 0 409.204 0 -99.94545 -2.3051412764 -97.6403087236 57.86479165
300 0.3 0.7 7199 241519 39 39 0 388.908 0 -102.84025 -1.3635631143 -101.4766868857 57.659792949
300 0.3 1.0 7198 241502 40 40 0 396.652 0 -91.1388 -0.2822998254 -90.8565001746 57.257813687
300 0.5 0.0 7199 241733 41 41 0 409.235 0 -99.1914 -2.72152932795 -96.46987067205 56.794548754
300 0.5 0.3 7199 241635 41 41 0 409.288 0 -100.0983 -2.7173622625 -97.3809377375 56.362002949
300 0.5 0.5 7199 241702 41 41 0 409.204 0 -99.95145 -2.3051412764 -97.6463087236 56.432317067
300 0.5 0.7 7199 241868 39 39 0 388.908 0 -105.01525 -1.3635631143 -103.6516868857 54.871918179
300 0.5 1.0 7199 242173 41 41 0 406.616 0 -97.2868 -0.348073684 -96.938726316 53.818733958
300 0.7 0.5 7199 242681 41 41 0 409.204 0 -103.33545 -2.3051412764 -101.0303087236 62.927711847
300 0.7 0.3 7198 242672 41 41 0 409.288 0 -103.2413 -2.7173622625 -100.5239377375 63.746957711
300 0.7 0.0 7198 242672 41 41 0 409.235 0 -102.3884 -2.72152932795 -99.66687067205 64.85875045
300 0.7 0.7 7199 242769 40 40 0 398.872 0 -109.32125 -1.4293369729 -107.8919130271 56.226341937
300 1.0 0.0 7199 242947 41 41 0 409.235 0 -103.5659 -2.72152932795 -100.84437067205 49.631923644
300 0.7 1.0 7199 242773 41 41 0 406.616 0 -98.1348 -0.348073684 -97.786726316 60.972433439
300 1.0 0.3 7199 243310 41 41 0 409.288 0 -103.7743 -2.7173622625 -101.0569377375 53.8895532
300 1.0 0.5 7198 243474 41 41 0 409.204 0 -103.47845 -2.3051412764 -101.1733087236 50.428580633
400 0.3 0.0 7199 243729 41 41 0 409.355 0 -100.4689 -2.73685032145 -97.73204967855 55.107524727
300 1.0 0.7 7199 243722 40 40 0 398.872 0 -108.36225 -1.4293369729 -106.9329130271 56.626523749
300 1.0 1.0 7199 243724 41 41 0 406.616 0 -96.6508 -0.348073684 -96.302726316 59.234841003
400 0.3 0.3 7199 243727 41 41 0 409.385 0 -99.6511 -2.74623536525 -96.90486463475 57.8006706
400 0.3 0.5 7199 243766 41 41 0 409.324 0 -99.2153 -2.7439226029 -96.4713773971 58.716697418
400 0.3 0.7 7199 243913 40 40 0 399.262 0 -103.5735 -1.8547728233 -101.7187271767 61.545593565
400 0.3 1.0 7199 244208 41 41 0 408.394 0 -92.9628 -0.7466310971 -92.2161689029 54.169674667
400 0.5 0.0 7198 244339 41 41 0 409.355 0 -101.6594 -2.73685032145 -98.92254967855 65.481265465
400 0.5 0.7 7199 244664 40 40 0 399.262 0 -109.517 -1.8547728233 -107.6622271767 49.861157161
400 0.5 0.3 7199 244619 41 41 0 409.385 0 -102.0496 -2.74623536525 -99.30336463475 54.422070582
400 0.5 0.5 7199 244619 41 41 0 409.324 0 -101.5388 -2.7439226029 -98.7948773971 57.05762152
400 0.5 1.0 7199 244664 41 41 0 408.394 0 -95.7838 -0.7466310971 -95.0371689029 62.760335853
400 0.7 0.0 7198 244849 41 41 0 409.355 0 -104.1534 -2.73685032145 -101.41654967855 63.215781747
400 0.7 0.3 7199 244956 41 41 0 409.385 0 -103.4541 -2.74623536525 -100.70786463475 55.651684696
400 0.7 0.5 7199 245045 41 41 0 409.324 0 -104.4683 -2.7439226029 -101.7243773971 59.205752512
400 0.7 0.7 7198 244725 40 40 0 399.262 0 -114.4855 -1.8547728233 -112.6307271767 49.563758796
400 1.0 0.0 7199 244671 41 41 0 409.355 0 -106.1014 -2.73685032145 -103.36454967855 50.851253962
400 0.7 1.0 7199 244625 41 41 0 408.394 0 -100.8833 -0.7466310971 -100.1366689029 58.618319437
400 1.0 0.3 7199 244583 41 41 0 409.385 0 -105.1431 -2.74623536525 -102.39686463475 65.911625132
400 1.0 0.7 7199 244760 40 40 0 399.262 0 -111.839 -1.8547728233 -109.9842271767 54.451305491
400 1.0 0.5 7199 244622 41 41 0 409.324 0 -104.6468 -2.7439226029 -101.9028773971 62.782379635
400 1.0 1.0 7199 244753 41 41 0 408.394 0 -98.1708 -0.7466310971 -97.4241689029 57.526891014
500 0.3 0.0 7199 244828 41 41 0 409.35 0 -99.91325 -2.7625815178 -97.1506684822 54.899776076
500 0.3 0.3 7198 244826 41 41 0 409.271 0 -102.09095 -2.75872699095 -99.33222300905 60.179723687
500 0.3 0.5 7199 244867 41 41 0 409.286 0 -102.1025 -2.7609626822 -99.3415373178 50.13726041
500 0.3 0.7 7199 244852 40 40 0 399.314 0 -112.48345 -2.2793784241 -110.2040715759 54.459922284
500 0.3 1.0 7199 244727 41 41 0 408.394 0 -100.9918 -0.7466310971 -100.2451689029 60.397595336
500 0.5 0.5 7198 244811 41 41 0 409.286 0 -102.448 -2.7609626822 -99.6870373178 60.094412369
500 0.5 0.0 7199 244721 41 41 0 409.35 0 -101.45675 -2.7625815178 -98.6941684822 63.463316152
500 0.5 0.7 7198 244805 40 40 0 399.314 0 -112.60195 -2.2793784241 -110.3225715759 54.589429525
500 0.5 0.3 7199 244716 41 41 0 409.271 0 -102.30395 -2.75872699095 -99.54522300905 64.092172967
500 0.5 1.0 7199 244816 41 41 0 408.394 0 -101.8598 -0.7466310971 -101.1131689029 54.876474067
500 0.7 0.0 7199 244789 41 41 0 409.35 0 -101.58675 -2.7625815178 -98.8241684822 55.428397101
500 0.7 0.3 7198 245374 41 41 0 409.271 0 -100.10145 -2.75872699095 -97.34272300905 54.608553029
500 0.7 0.5 7199 246162 41 41 0 409.286 0 -102.2925 -2.7609626822 -99.5315373178 60.133373929
500 0.7 0.7 7198 246223 40 40 0 399.314 0 -112.44095 -2.2793784241 -110.1615715759 56.090202645
500 0.7 1.0 7198 246223 41 41 0 408.394 0 -101.2088 -0.7466310971 -100.4621689029 56.162406744
500 1.0 0.3 7199 246235 41 41 0 409.271 0 -102.30345 -2.75872699095 -99.54472300905 59.242130739
500 1.0 0.0 7199 246236 41 41 0 409.35 0 -101.40325 -2.7625815178 -98.6406684822 63.279595947
500 1.0 0.5 7199 246607 41 41 0 409.286 0 -102.479 -2.7609626822 -99.7180373178 53.969977709
500 1.0 0.7 7199 247440 40 40 0 399.314 0 -112.97845 -2.2793784241 -110.6990715759 46.412038884
500 1.0 1.0 7199 247590 41 41 0 408.394 0 -101.9683 -0.7466310971 -101.2216689029 48.158013762
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment