# DEX fast NPZ tuner v2 — focused continuation from `wide_80_5`

## Dataset

NPZ: `base_CHECK_USDC_2PCT_2026_02_05_fee_replay_v2.npz`
Period: 2026-02-01 → 2026-05-01 UTC
Fee rate: 0.002515
Swap rows: 133,474

## Baseline check: `wide_80_5`, capital 1000

| metric | value |
|---|---:|
| return_pct | 14.116615 |
| mdd_pct | -42.420592 |
| avg_liquidity_share_pct_when_in_range | 4.939959 |
| max_liquidity_share_pct_when_in_range | 72.750944 |
| score with hard 5% cap | -1000000000707.933838 |

Conclusion: with `initial_capital_usd=1000` and event-level `hard_max_liquidity_share=5%`, the current baseline is rejected. A focused cap=1000 grid also had zero accepted rows.

## Focused tune rule used here

Because the current script's periodic loop is slow (~18s per one quarterly periodic run), I used a segment-vectorized focused tuner for exploration and validated it against the original script on `periodic_80_5_168h`.

Search space:

- Static: lower `[75,80,85,90,95,96,97,98,99,99.5]`, upper `[0.1,0.25,0.5,1,2,3,5,8]`
- Rebalance: lower `[80,85,90,95,98]`, upper `[0.5,1,2,5]`, hours `[24,48,72,168,336]`, modes `oor|periodic`
- capital: `10`, because this is the only practical scale where hard max share 5% accepts the candidates. At capital 100, 1000: zero accepted rows under event-level hard cap.

## Best quarterly candidates, capital 10

| strategy             |   return_pct |   mdd_pct |   score |   time_in_range_pct |   avg_liquidity_share_pct_when_in_range |   max_liquidity_share_pct_when_in_range |   fees_earned_total |   rebalance_costs |   rebalances |
|:---------------------|-------------:|----------:|--------:|--------------------:|----------------------------------------:|----------------------------------------:|--------------------:|------------------:|-------------:|
| periodic_80_0.5_336h |      37.2366 |  -21.1232 | 37.1166 |             53.0688 |                               0.146396  |                                 3.48026 |             5.21616 |          0.332482 |            6 |
| periodic_80_1_336h   |      36.9196 |  -21.2674 | 36.7996 |             53.7745 |                               0.143935  |                                 3.45898 |             5.22274 |          0.33242  |            6 |
| periodic_80_2_336h   |      36.3647 |  -21.6602 | 36.2447 |             55.6745 |                               0.138167  |                                 3.41829 |             5.24209 |          0.332315 |            6 |
| periodic_80_5_336h   |      35.5181 |  -23.2681 | 35.3981 |             62.2968 |                               0.122182  |                                 3.30326 |             5.36518 |          0.332018 |            6 |
| periodic_85_0.5_336h |      33.0457 |  -19.1408 | 32.9257 |             53.0688 |                               0.132075  |                                 3.15507 |             4.67941 |          0.332198 |            6 |
| periodic_85_1_336h   |      32.7822 |  -19.2939 | 32.6622 |             53.7745 |                               0.129932  |                                 3.13758 |             4.6881  |          0.332143 |            6 |
| periodic_85_2_336h   |      32.3239 |  -19.8129 | 32.2039 |             55.6745 |                               0.124863  |                                 3.10409 |             4.71084 |          0.332052 |            6 |
| periodic_85_5_336h   |      31.6605 |  -21.331  | 31.5405 |             62.2968 |                               0.11074   |                                 3.00905 |             4.83579 |          0.331791 |            6 |
| periodic_90_0.5_336h |      29.0723 |  -17.3093 | 28.9523 |             53.0688 |                               0.118343  |                                 2.84024 |             4.17002 |          0.331926 |            6 |
| periodic_90_1_336h   |      28.8552 |  -17.5466 | 28.7352 |             53.7745 |                               0.116488  |                                 2.82607 |             4.18013 |          0.331878 |            6 |
| periodic_90_2_336h   |      28.4803 |  -18.0302 | 28.3603 |             55.6745 |                               0.112063  |                                 2.79889 |             4.20498 |          0.331799 |            6 |
| periodic_90_5_336h   |      27.9713 |  -19.4494 | 27.8513 |             62.2968 |                               0.0996684 |                                 2.72147 |             4.32878 |          0.331572 |            6 |
| periodic_95_0.5_336h |      25.0327 |  -15.525  | 24.9127 |             53.0688 |                               0.104221  |                                 2.51337 |             3.65161 |          0.331646 |            6 |
| periodic_95_1_336h   |      24.8583 |  -15.7424 | 24.7383 |             53.7745 |                               0.102647  |                                 2.50227 |             3.66257 |          0.331606 |            6 |
| periodic_95_2_336h   |      24.5601 |  -16.1853 | 24.4401 |             55.6745 |                               0.0988556 |                                 2.48096 |             3.68845 |          0.331538 |            6 |
| periodic_95_5_336h   |      24.1881 |  -17.4894 | 24.0681 |             62.2968 |                               0.0881789 |                                 2.42    |             3.80809 |          0.331344 |            6 |
| periodic_98_0.5_336h |      22.2067 |  -14.261  | 22.0867 |             53.0688 |                               0.0942416 |                                 2.28048 |             3.28864 |          0.331448 |            6 |
| periodic_98_1_336h   |      22.0597 |  -14.463  | 21.9397 |             53.7745 |                               0.0928569 |                                 2.27134 |             3.29985 |          0.331413 |            6 |
| periodic_98_2_336h   |      21.8101 |  -14.8744 | 21.6901 |             55.6745 |                               0.0894964 |                                 2.25378 |             3.32576 |          0.331353 |            6 |
| periodic_98_5_336h   |      21.522  |  -16.0888 | 21.402  |             62.2968 |                               0.0799961 |                                 2.2034  |             3.44067 |          0.331181 |            6 |

## Cross-period check of selected candidates

| strategy             | period   |   return_pct |   mdd_pct |      score |   max_liquidity_share_pct_when_in_range |   rebalances |
|:---------------------|:---------|-------------:|----------:|-----------:|----------------------------------------:|-------------:|
| periodic_80_0.5_336h | quarter  |    37.2366   | -21.1232  |  37.1166   |                                3.48026  |            6 |
| periodic_80_0.5_336h | feb      |    -1.29105  |  -2.51631 |  -1.31105  |                                0.222302 |            1 |
| periodic_80_0.5_336h | mar      |     0.611836 | -18.6758  |   0.571836 |                                3.54379  |            2 |
| periodic_80_0.5_336h | apr      |    26.4792   | -15.35    |  26.4392   |                                3.88883  |            2 |
| periodic_80_0.5_336h | febmar   |    -1.25589  | -19.2821  |  -1.33589  |                                3.48026  |            4 |
| periodic_80_5_336h   | quarter  |    35.5181   | -23.2681  |  35.3981   |                                3.30326  |            6 |
| periodic_80_5_336h   | feb      |    -1.71501  |  -3.25006 |  -1.73501  |                                0.212683 |            1 |
| periodic_80_5_336h   | mar      |    -1.17363  | -20.8577  |  -1.21363  |                                3.37788  |            2 |
| periodic_80_5_336h   | apr      |    26.9366   | -16.701   |  26.8966   |                                3.74862  |            2 |
| periodic_80_5_336h   | febmar   |    -3.42994  | -21.9547  |  -3.50994  |                                3.30326  |            4 |
| periodic_85_0.5_336h | quarter  |    33.0457   | -19.1408  |  32.9257   |                                3.15507  |            6 |
| periodic_85_0.5_336h | feb      |    -1.21853  |  -2.3261  |  -1.23853  |                                0.200908 |            1 |
| periodic_85_0.5_336h | mar      |     0.454054 | -16.9867  |   0.414054 |                                3.21055  |            2 |
| periodic_85_0.5_336h | apr      |    23.8451   | -13.8586  |  23.8051   |                                3.52343  |            2 |
| periodic_85_0.5_336h | febmar   |    -1.3376   | -17.6338  |  -1.4176   |                                3.15507  |            4 |
| static_99.5_0.1      | quarter  |    17.37     | -25.2929  |  16.7843   |                                1.62951  |            0 |
| static_99.5_0.1      | feb      |    -0.420464 |  -1.89737 |  -0.420464 |                                0.121932 |            0 |
| static_99.5_0.1      | mar      |    -1.89948  | -17.4355  |  -1.89948  |                                1.83407  |            0 |
| static_99.5_0.1      | apr      |    21.8628   |  -9.07037 |  21.8628   |                                2.3594   |            0 |
| static_99.5_0.1      | febmar   |    -6.4602   | -22.5283  |  -6.4602   |                                1.62951  |            0 |
| static_95_0.1        | quarter  |    20.766    | -29.8034  |  11.1592   |                                1.94397  |            0 |
| static_95_0.1        | feb      |    -0.503235 |  -2.26863 |  -0.503235 |                                0.145893 |            0 |
| static_95_0.1        | mar      |    -2.27747  | -20.8176  |  -2.27747  |                                2.18713  |            0 |
| static_95_0.1        | apr      |    26.1363   | -10.8521  |  26.1363   |                                2.81069  |            0 |
| static_95_0.1        | febmar   |    -7.7349   | -26.939   | -11.6128   |                                1.94397  |            0 |
| static_75_8          | quarter  |    25.0559   | -45.7961  | -16.5364   |                                2.78441  |            0 |
| static_75_8          | feb      |    -2.05029  |  -5.37228 |  -2.05029  |                                0.210637 |            0 |
| static_75_8          | mar      |    -6.10216  | -34.2391  | -24.5803   |                                3.12934  |            0 |
| static_75_8          | apr      |    43.5786   | -19.2727  |  43.5786   |                                4.0105   |            0 |
| static_75_8          | febmar   |   -14.7064   | -43.9764  | -52.6593   |                                2.78441  |            0 |
| static_80_5          | quarter  |    25.2755   | -41.5409  |  -7.80626  |                                2.60042  |            0 |
| static_80_5          | feb      |    -1.46328  |  -4.24308 |  -1.46328  |                                0.196375 |            0 |
| static_80_5          | mar      |    -4.72993  | -30.4656  | -15.6612   |                                2.92325  |            0 |
| static_80_5          | apr      |    38.3032   | -16.701   |  38.3032   |                                3.74862  |            0 |
| static_80_5          | febmar   |   -12.5082   | -39.2351  | -40.9783   |                                2.60042  |            0 |

## Hard conclusion

1. `wide_80_5` is not valid with `initial_capital_usd=1000` under current hard max share 5% rule.
2. If hard cap remains event-level max share, realistic accepted capital is roughly <=30 USD for static narrow ranges and about 10 USD for the current broad focused search.
3. Quarterly winner at cap=10 is `periodic_80_0.5_336h`: +37.2366%, MDD -21.1232%, max share 3.4803%, 6 rebalances.
4. This result is not stable enough yet: Feb and Feb+Mar are negative; most quarterly return comes from April. Treat this as candidate generation, not final strategy.
5. Next required code change: add fast segment-vectorized periodic/oor tuner or multiprocessing initializer. The current periodic implementation is too slow for real tuning.
6. Next required modeling change: replace hard event-level max share with at least one additional metric: p95/p99 liquidity share. Event-level max share is probably too brittle because tiny-liquidity events reject almost every $1000 run.
