Skip to content

Fix copy-engine full scans, retry-inflated paper exit rate, review page timeouts - #54

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 8ad1d33 (db_health, parity_report --days 7, pumpswap_window_check).

What the server showed

  • Load 9.48 on 2 vCPU, 392 MB free, 1.17 GB swap. evm_trades 3.5 GB / 4.4M rows. The review aggregates still ran past 120 s.
  • Copy trading: TOO_LATE BSC 270,217 and Robinhood 6,648. Median detection was 300 s on BSC and 217 s on Robinhood.
  • Paper exit failure rate was 50% (the cap), "measured from 6553 live SELL orders". 6,450 of those were retries of the one stuck 7wmm sell.

Changes

  • Index ix_evm_trades_chain_at (chain, at): migration 0042, built CONCURRENTLY.
    • The copy engine's once-a-second poll compared lower(trader), which no index serves, so every tick read the whole table on each chain.
    • The 14-day prune and the market-regime windows also scanned the whole table.
    • The poll is now target_trades(). A test checks that the query plan uses the new index; it fails without it.
  • measured_live_rates: counts one result per position and side (the first final attempt). Retries of a stuck exit no longer count as separate trials. There is a new test with 300 retries.
  • Review endpoints (ledger review, comparison, EVM ML):
    • They are computed in a background task, one at a time, on their own pool of 2 connections with a 240 s statement limit.
    • Requests get an answer straight away from the last result, marked stale while a refresh runs.
    • Before the first result exists, the answer is 503 REVIEW_COMPUTING.
    • The pages show when the numbers were computed. Covered by new tests.
  • db_health: also times the copy poll and lists the background review results (compute time, last error).
  • Audit report: new section V with the server findings, what was fixed, and what still needs the operator (server resize; 7wmm second-RPC re-simulation and backoff, not implemented).

Not changed

  • Live execution is unchanged. No live transaction was sent. Paper stays the default. Tasks #138 and #178 stay blocked or locked.

Tests

  • ruff clean.
  • core 881, api 171, data-solana 10, data-evm 14, copy-engine 13, discovery 18, migration 11, momentum 11, decision-engine 58, ml 43, paper-trading 81.
  • alembic upgrade + check clean. Web tsc, lint and build OK.

Not verified

  • Production copy latency and review compute times. Re-run parity_report and db_health after deploy.

🤖 Generated with Claude Code

https://claude.ai/code/session_015vpuZ1UX4MXz7NCF7wrtDv


Generated by Claude Code

…ge timeouts

Server findings after deploying 8ad1d33 (load 9.5 on 2 vCPU, copies TOO_LATE
with a 5-minute median detection, paper exits failed at the 50 % cap, review
aggregates past 120 s):

- Index ix_evm_trades_chain_at (chain, at), migration 0042, built
  CONCURRENTLY. The copy engine's per-second poll compared lower(trader),
  which no index serves, so every tick read all of evm_trades; the 14-day
  prune and the market-regime windows scanned it too. The poll is now
  target_trades(); a test checks the plan uses the index.
- measured_live_rates counts one result per position and side (its first
  final attempt): 6 450 retries of one stuck sell had counted as trials.
- Review endpoints (ledger review, comparison, EVM ML) are computed in a
  background task on their own two connections with a 240 s limit, one at a
  time; requests are answered from the last result (marked stale) while a
  refresh runs, or 503 REVIEW_COMPUTING before the first one. The pages
  show when the numbers were computed.
- db_health: times the copy poll and lists the review results.
- Audit report: server findings and what still needs the operator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015vpuZ1UX4MXz7NCF7wrtDv
@yonixnetwork
yonixnetwork merged commit aa8c0b3 into main Oct 7, 2026
26 checks passed
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