# DEX LP Handoff To Live Plan - 2026-05-05

## Current Working Folder

```text
/home/happyuser/projects/DEX
```

Neighbor environment used as source of additional scripts:

```text
../DEX_full_cycle
```

## Current Direction

The project is not ready for signed live transactions yet. The correct current
path is:

```text
1. Keep research/tuning jobs running where useful.
2. Keep BIO/USDC virtual paper-live watcher running.
3. Improve data collection reliability for exact event replay.
4. Validate strategies on longer exact-event windows, not only OHLCV proxy.
5. Only then run a small signed pilot, likely $25-$50.
```

The active goal is still to prove stable DEX profitability that can beat the
existing CEX baseline of roughly 4-8% per month, but the standard of proof must
stay strict:

```text
monthly/quarterly return
MDD
avg/p95/p99/max liquidity share
time in range
fees earned / reinvested / uncollected
return on deployed capital
return on total capital
```

## Active Processes

As of 2026-05-05T21:13:06Z:

```text
tmux: bio_paper_live_watch
tmux: oleg_tranche_tune
```

`bio_paper_live_watch` is a virtual LP paper-live watcher in `../DEX_full_cycle`.
It does not send signed transactions.

`oleg_tranche_tune` is still running the Oleg-style tranche tuning/watch path.

## Strategy Status

### Best Live-Like Candidate So Far

The best live-like candidate remains the tuned BIO/USDC `portfolio_router_v4`
from the imported external-agent bundle:

```text
BIO Apr corrected: +42.546% total return, MDD -9.923%, strict pass
BIO Feb-Mar: idle / 0%, bear-regime block
BIO May partial: idle / 0%, no forced trade
```

Interpretation:

```text
This is promising, but still not signed-live proof.
It needs 14 days of paper-live virtual LP behavior before small real capital.
```

### Oleg / Revert-Style Baseline

The Oleg-style tranche LP-DCA strategy is conservative and drawdown-aware:

```text
best focused WETH/USDC 0.30% tranche config:
  oleg_tranche_3p_0.25f_20_10_double_once_1x_24h_rolling_low_12h_0off

quarter return on total capital: ~+6.45%
MDD: ~-8.47%
fees earned: ~$8.62 per $100 total
inventory PnL ex-fees: ~-$2.17 per $100 total
time in range: ~99.38%
```

Interpretation:

```text
Good risk-control baseline, but not enough to beat the CEX target by itself.
Its main value is regime discipline and reserve deployment logic.
```

## Data Truth Levels

Use these levels when interpreting results:

```text
Level 1 - OHLCV proxy
  Source: GeckoTerminal OHLCV
  Good for: trend/regime/volatility screening, rough router dry-runs
  Not good for: exact fee-share, exact active liquidity, capacity proof

Level 2 - TheGraph event data
  Source: Uniswap v3 subgraphs
  Good for: swaps/mints/burns/collects, tick, sqrtPrice, amountUSD, gas metadata
  Weakness: active liquidity can be snapshot/proxy, so capacity is approximate

Level 3 - Raw RPC event replay
  Source: eth_getLogs / Base RPC / direct pool logs
  Good for: best available backtest truth, exact swap sequence and active liquidity
  Weakness: rate limits / daily credit usage
```

Do not promote a live strategy using Level 1 evidence only.

## 429 / Data Collection Status

The Infura screenshot shows roughly:

```text
daily requests: ~37,843
daily credit usage: ~3,035,115
```

This explains the 429 failures. The main monthly WETH event collector hit rate
limits during timestamp lookup after collecting partial raw logs.

Current fallback behavior:

```text
RPC collector remains primary.
On RPC failure, WETH monthly scripts can fetch GeckoTerminal OHLCV.
Fallback output is separate *_ohlcv_proxy.npz, not a replacement exact replay.
```

Fallback files created:

```text
DEX_DATA/fast_npz/mainnet_WETH_USDC_UNIV3_030_feb2026_ohlcv_proxy.npz
DEX_DATA/fast_npz/mainnet_WETH_USDC_UNIV3_030_mar2026_ohlcv_proxy.npz
DEX_DATA/fast_npz/mainnet_WETH_USDC_UNIV3_030_apr2026_ohlcv_proxy.npz
```

Sanity checked orientation:

```text
quote OHLCV gives WETH prices around $1,816-$2,457.
base OHLCV gave ~$1 and must not be used for USDC/WETH replay orientation.
```

## Code Merged From DEX_full_cycle

Merged code/config/docs from `../DEX_full_cycle` into the current project,
excluding raw data and report artifacts.

Important imported scripts:

```text
dex_platform/data_collectors/fetch_uniswap_v3_pool_events_v1.py
dex_platform/data_collectors/fetch_uniswap_v3_l2_pool_events_v1.py
dex_platform/data_collectors/build_thegraph_cl_npz_v1.py
dex_platform/data_collectors/fetch_cl_pool_events_evm_v4.py
dex_platform/backtest/portfolio_router_v4.py
dex_platform/backtest/market_neutral_lp_v1.py
dex_platform/backtest/trend_adaptive_lp_v1.py
dex_platform/backtest/flair_arrival_lp_v1.py
dex_platform/scripts/paper_live_virtual_lp_v1.py
dex_platform/scripts/run_portfolio_router_v4_tuned_best.sh
dex_platform/scripts/watch_paper_live_bio_v4_tuned.sh
```

Local fixes applied after merge:

```text
np.unicode_ -> np.str_ for NumPy 2 compatibility in local builders
argparse help percent escaping in TheGraph scripts
RPC URL redaction in fetch_cl_pool_events_evm_v4.py
```

Validation completed:

```text
python3 -B -m py_compile for collectors/backtests/scripts
bash -n for shell scripts
--help checked for key collectors/builders
```

## Plan To Live

### Stage 1 - Data Reliability

Primary action:

```text
Run exact raw-RPC collectors more slowly:
  bigger sleep
  smaller chunks
  checkpoint each event
  resume/reuse raw logs
  avoid aggressive restarts on same free RPC
```

Fallback action:

```text
Use TheGraph collector when RPC 429 blocks progress and a TheGraph key exists.
Use GeckoTerminal OHLCV only for rough regime screening.
```

### Stage 2 - Paper-Live

Keep this running:

```text
BIO/USDC portfolio_router_v4 virtual LP
no signed tx
14-day observation window
```

Required paper-live outputs:

```text
decision log
virtual LP events
virtual LP state
summary CSV
idle/deploy/exit reasons
```

### Stage 3 - Cross-Pool Validation

Validate the same regime/router idea on:

```text
BIO/USDC exact events
CHECK/USDC exact events
SYND/USDC exact events
WETH/USDC 0.30% exact or TheGraph-event data
selected larger Base/Aerodrome pools
```

Do not accept a strategy that only wins in BIO April.

### Stage 4 - Live Gate

Only allow signed live if all are true:

```text
paper-live loop behaves as expected for 14 days
no unexplained deploys in bad regimes
strategy has positive exact-event backtests outside April
capacity p95 <= 5%
capacity p99 <= 10%
MDD is tolerable versus return
fees are real contributor, not only token mark-to-market luck
uncollected fees do not dominate result suspiciously
```

### Stage 5 - First Signed Pilot

Initial signed pilot should be tiny:

```text
$25-$50 deployed capital
single pool
manual approval or guarded executor
daily review
hard stop on unexpected drawdown or bad route decisions
```

Do not start at $1000. Pool capacity and proof level do not justify it.

## Immediate Next Tasks

```text
1. Keep paper-live watcher running.
2. Run exact event collection with slower settings or a better endpoint.
3. If TheGraph key exists, run WETH/USDC event fallback and build NPZ.
4. Compare BIO router against CHECK/SYND/WETH exact or Level-2 event datasets.
5. Produce a live-readiness table with exact evidence levels per pool.
```
