Skip to content

EV metrics + EV-weighted evolution + stop-loss cooldown + pool-history hard gate#3

Open
adepanges wants to merge 3 commits into
mainfrom
pr/94-ev-metrics-ev-weighted-evolution-stop-lo
Open

EV metrics + EV-weighted evolution + stop-loss cooldown + pool-history hard gate#3
adepanges wants to merge 3 commits into
mainfrom
pr/94-ev-metrics-ev-weighted-evolution-stop-lo

Conversation

@adepanges

Copy link
Copy Markdown
Owner

Tracking upstream: yunus-0x#94

Original author: @hadhaz | branch: reconcile/ev-cooldown


This PR mirrors yunus-0x/meridian#94 for review.

hadhaz and others added 3 commits June 18, 2026 09:46
Win rate alone hides exit asymmetry (small wins, rare catastrophic losses
— 'picking pennies in front of a steamroller'). Add EV measurement and make
auto-tuning weight positions by magnitude instead of win-frequency.

- computeEdge(): EV per position (% + USD), avg win/loss, payoff ratio,
  worst loss, steamroller flag; wired into getPerformanceSummary +
  getPerformanceHistory
- evolveThresholds split into pure deriveThresholdChanges(); fee/organic
  floors now weighted by |pnl_pct| so penny-wins stop validating low-fee
  zones (the 'naikin win rate doang' trap)
- briefing: EV line + steamroller warning
- test/test-ev.js: 7 unit checks (no runner/server data needed)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…escaping

Consolidates direct-on-server/local hotfixes that never reached origin:
- stopLossCooldownHours (default 12): after a stop-loss close, set pool +
  base-mint cooldown so we don't immediately re-enter a token that just cost
  a realized loss (config + update_config mapping + pool-memory enforcement)
- SCREEN_ON_START gate: skip the redundant immediate screening run on restart
  (cron already schedules it) to save tokens; set SCREEN_ON_START=true to force
- briefing: escapeHtml() on lesson rules to prevent broken Telegram HTML

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The agent kept redeploying into pools its own memory flagged as bad (e.g.
glippy-SOL: 67% raw win rate / +2.26% avg PnL looked fine, but adjusted_win_rate
was 0% over 0 clean closes — all 3 deploys left the range via OOR/pump, pure
price variance, never a real in-range earner). The signal was visible to the
LLM but overridable, and it rationalized past it.

- getPoolMemory now returns oor_exclusion_rate (frac of past deploys that closed
  OOR/pumped vs clean in-range)
- evaluatePoolHistoryGate(): pure, two reject signatures — range-unstable
  (oor_exclusion_rate >= maxPoolExclusionRate) or in-range loser
  (adjusted_win_rate < minPoolAdjustedWinRate with >= 2 clean closes)
- enforced in runSafetyChecks deploy_position → non-LLM-overridable
- config.screening: minPoolDeploysForGate (3), maxPoolExclusionRate (0.6),
  minPoolAdjustedWinRate (20); all tunable via update_config
- test/test-pool-gate.js: 6 checks incl. the real glippy case

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants