Skip to content

Unblock the copy-engine loop and trim the remaining long EVM queries - #56

Merged
yonixnetwork merged 1 commit into
mainfrom
claude/yonixalpha-platform-architecture-804nb5
Oct 7, 2026
Merged

yonixnetwork merged 1 commit into
mainfrom
claude/yonixalpha-platform-architecture-804nb5

Conversation

@yonixnetwork

Copy link
Copy Markdown
Owner

Follow-up to the server outputs after deploying b0a5ce6.

Server findings

  • Load is down to 9.8 / 7.9 / 7.3 (was 12.4 / 10.7 / 10.6).
  • No API request slower than 2 s was recorded after 16:42. Paper exit failure rate is 4.26%.
  • Copy detection median is still 111 s on BSC and 64 s on Robinhood.
  • Three statements still run long:
    • missed winners: 108 s, 3 parallel workers
    • data-evm entry pass on evm_tokens: 49 s
    • copy-engine launchpad restore: 15 s

Changes

  • Copy engine: refresh_adapters used to read every token of every launchpad every 60 s, inside the watch loop, so target trades waited behind it. It now does a full read on start and once an hour. In between it reads only tokens created or traded since the last refresh (restore_adapter(since=...), both columns indexed).
  • Migration 0043: index on evm_tokens (chain, safety_at), built CONCURRENTLY.
  • ml: build_missed runs every 6 hours instead of every 30-minute cycle. MISSED rows are written once each, so no row is lost.
  • db_health: prints the age of the newest stored EVM trade and of each scan cursor. This separates feed lag from copy-engine lag.
  • Audit report: new section X.

Tests

  • New: adapter refresh (incremental vs hourly full), the missed-winner interval, and the db_health feed lines.
  • Full suite passes: core 882, api 171, data-solana 10, data-evm 14, copy-engine 14, discovery 18, migration 11, momentum 11, decision-engine 58, ml 44, paper-trading 81.
  • ruff clean; alembic upgrade head and alembic check clean.

Not changed

  • No live execution change and no live transaction. Paper stays the default. #138 is still blocked and #178 is still locked.

🤖 Generated with Claude Code

https://claude.ai/code/session_015vpuZ1UX4MXz7NCF7wrtDv


Generated by Claude Code

Server after b0a5ce6: load 9.8 (was 12.4), no slow API requests after
16:42, but copy detection still 111 s (BSC) / 64 s (Robinhood) median and
three long statements in pg_stat_activity.

- Copy engine: the launchpad adapter refresh read every token of every
  launchpad (15 s) every 60 s inside the watch loop. Now a full read on
  start and hourly, otherwise only tokens created or traded since the last
  refresh (both columns indexed).
- Migration 0043: index evm_tokens (chain, safety_at) for data-evm's entry
  pass (49 s), CONCURRENTLY.
- ml: the missed-winner query (108 s) runs every 6 hours instead of every
  30-minute cycle; its rows are written once each.
- db_health: age of the newest stored EVM trade and each scan cursor, to
  tell feed lag from copy-engine lag.
- Audit report section X.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015vpuZ1UX4MXz7NCF7wrtDv
@yonixnetwork
yonixnetwork merged commit 7e84d97 into main Oct 7, 2026
26 checks passed
yonixnetwork pushed a commit that referenced this pull request Oct 8, 2026
…ce view

The 2 GB / 2 vCPU droplet (16 GB database) ran at load 8-12 with 345 MB
free and 1.3 GB swap. Keep the trading core reliable on it; nothing is
deleted and Solana execution is unchanged.

- SYSTEM_RESOURCE_MODE (NORMAL / LOW_RESOURCE / EMERGENCY, default
  LOW_RESOURCE) and COPY_TRADING_STATUS (ACTIVE / THROTTLED / SUSPENDED,
  default SUSPENDED), changeable from the dashboard
  (yonixalpha_core.operating_mode).
- Resource level NORMAL / WARNING / CRITICAL from /proc with configurable
  thresholds (yonixalpha_core.resources); CRITICAL pauses priority-3 work
  only.
- Copy engine: SUSPENDED stops target watching, copy entries, outcomes,
  wallet profiles and enrichment, and keeps managing open copy positions;
  THROTTLED watches less often. Step timers start due on the first pass.
- ml: training once a day in LOW_RESOURCE and never while CRITICAL
  (recorded as SKIPPED with the reason); wallet ML pauses with copy trading.
  Inference is unaffected.
- ML Review: review_status CURRENT / STALE / RUNNING / PENDING / FAILED,
  202 with no result, automatic refreshes deferred while CRITICAL, explicit
  Refresh button.
- API: GET /system/resources, PUT /system/resource-mode,
  GET/POST /copy/trading-status (resume refused unless the COPY_* thresholds
  hold; audited).
- UI: Server resources panel on System Health, copy-trading status banner
  with the resume check, review status lines.
- Heartbeats carry CPU seconds; worker DB pools 5 + 10 (API 10 + 10).
- Postgres (prod): explicit defaults, effective_cache_size 512MB, no
  parallel workers, jit off.
- db_health: mode, per-service memory / CPU, Redis, Solana pipeline latency.
- docs/LOW_RESOURCE_MODE.md: pre-deploy report, changes, PR #56, staged
  rollout, after-deploy table, 8 GB values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015vpuZ1UX4MXz7NCF7wrtDv
yonixnetwork pushed a commit that referenced this pull request Oct 8, 2026
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