# Research vs Code Gap - SOL Micro-Scalp

Created: 2026-05-26 12:12 CEST

Scope: read-only diagnosis of the live SOL long opened at 2026-05-26 11:20 CEST. No bot code changed in this report.

## Live Trade Facts

- Trade: SOL long
- Fill: 84.538
- Planned entry: 84.55
- Stop: 84.25
- Target: 85.00
- Stop distance: 0.288 SOL, about 0.34%
- Target distance: 0.462 SOL, about 0.55%
- Leverage: 20x
- Setup: breakout_acceptance
- Bot reason: "SOL breakout with strong orderflow, but counter-trend and R:R borderline"

## OHLC Reality Around Entry

Hyperliquid 1m candles around 09:20 UTC:

- 09:17: 84.354 / 84.576 / 84.341 / 84.576, range 0.235
- 09:18: 84.576 / 84.588 / 84.549 / 84.559, range 0.039
- 09:19: 84.548 / 84.553 / 84.524 / 84.542, range 0.029
- 09:20: 84.537 / 84.566 / 84.534 / 84.551, range 0.032
- 09:23: 84.485 / 84.485 / 84.396 / 84.396, range 0.089

Hyperliquid 5m candles:

- 09:15: 84.362 / 84.588 / 84.334 / 84.542, range 0.254
- 09:20: 84.537 / 84.566 / 84.366 / 84.402, range 0.200
- 09:30: 84.538 / 84.669 / 84.511 / 84.538, range 0.158
- 09:45: 84.461 / 84.508 / 84.297 / 84.370, range 0.211

Diagnosis: this was a very small local breakout attempt, not a wide structural move. The stop was only slightly above the dynamic noise requirement, and the target was near the first psychological level rather than a proven higher structural destination.

## What Research Says

Local orderflow SL/TP research says:

- Stop placement starts from thesis invalidation, then must survive normal 1m/5m noise.
- If a normal 1m/5m candle can tag the stop, the trade is not robust enough.
- If the nearest target gives weak R/R after a noise-valid stop, search for the next real structural target or wait.
- TP must be a structural destination, not just "1.5R because config says so".
- For breakouts, require acceptance or a retest after the break, not only a first push through the level.

Local comprehensive orderflow summary says:

- Skip if stop would be inside normal noise range.
- Skip if HTF structure conflicts with the short-term signal.
- Strong long needs price on the correct VWAP side, not just book/tape.

External sources checked:

- Hyperliquid WebSocket docs confirm the bot can use live `l2Book`, `trades`, `candle`, `activeAssetCtx`, `userFills`, and `orderUpdates` streams.
- Hyperliquid order docs define IOC as immediate-or-cancel and TP/SL as trigger orders.
- Hyperliquid TP/SL docs state TP/SL trigger from mark price and parent-order TP/SL can be complicated with partial fills.
- Cont, Kukanov, Stoikov (2010) find short-horizon price changes are more robustly explained by order-flow imbalance than raw trade volume, but this does not mean one tape burst is enough without depth and price response.
- CME futures education states stop orders become market orders when triggered, so placing stops inside common noise invites mechanical stop-outs.

## What The Current Code Does

Current code already has useful pieces:

- `collect_coin_data` sends 1m/5m/15m/1h/4h OHLC, VWAP/VPOC/VAH/VAL, trigger_state, websocket tape/book, and dynamic noise state to the LLM.
- `evaluate_exit_plan` rejects if stop distance is below `dynamic_stop_floor * min_stop_noise_multiple`.
- `evaluate_exit_plan` rejects if target does not reach `min_rr` after replacing stop distance with the dynamic noise floor.
- `evaluate_research_gate` rejects stale WS, side contradiction, bad alignment, hard absorption contradiction, and bad sweep quality.

Main gap:

- The code accepts a trade when it barely clears the minimum noise and R/R math, even if the LLM's own explanation says the target is borderline or insufficient.
- The code does not require a reward-distance buffer beyond the bare `min_rr * noise_floor`.
- The code does not strongly penalize breakout longs below VWAP / against 4h trend unless it is explicitly `trend_pullback_continuation`.
- The code accepts "round number and above swing high" as target quality even when the LLM admits the next real farther target is not provided.

## Concrete Root Cause In This SOL Trade

The LLM wrote:

- Stop 84.25 is only just noise-valid.
- Target 85.0 is only barely around 1.5R.
- It says "Need farther target: 85.5? Not provided. So R:R insufficient."

But the final JSON still had:

- `action = enter`
- `target_price = 85.0`
- `rr_after_noise_stop = 1.50`

The parser/gates trusted the final fields and ignored the self-rejecting text.

## Fix Direction To Implement Next

Do not just hardcode SOL percentages. Fix the decision logic:

1. Add LLM self-contradiction reject:
   - Reject ENTER if `level_reasoning`, `exit_plan`, `risk_assessment`, or `reason` contains phrases like "R:R insufficient", "target too small", "need farther target", "borderline" without an explicitly valid farther target.

2. Add target-room gate:
   - Keep `min_rr`, but also require reward distance to be materially larger than current noise, not just barely equal to math minimum.
   - This should be config-driven and logged, not coin-hardcoded.

3. Add countertrend breakout quality gate:
   - For breakout_acceptance against 4h trend or below VWAP, require retest/acceptance plus a farther structural target.
   - Otherwise wait.

4. Tighten target quality:
   - A round number alone is not enough unless it coincides with provided levels, liquidity, VWAP/VPOC/VAH/VAL, prior high/low, or recent swing structure.

5. Improve prompt:
   - Add: "If your own analysis says target/RR is borderline or insufficient, final action must be WAIT."
   - Add: "Do not use a nearby round number as target unless it is also a structural level."

