|
Download HANDOFF.md from abyXsmart/Confluence_Reversal_Engine: direct link, hf CLI and curl.
- Browser
- Download file 5.4 kB
-
https://huggingface.co/spaces/abyXsmart/Confluence_Reversal_Engine/resolve/main/HANDOFF.md
- Command line
-
hf download hf://spaces/abyXsmart/Confluence_Reversal_Engine/HANDOFF.md
-
curl -L -o HANDOFF.md https://huggingface.co/spaces/abyXsmart/Confluence_Reversal_Engine/resolve/main/HANDOFF.md
5.4 kB
| # CRE v1.0 β Build Handoff (for the continuing agent) | |
| **Status:** Steps 0β3 complete & verified. Step 4 (dashboard UI) is a skeleton only. | |
| **Read first:** `CRE Agent Build Log.md` (full decision history, Entries 001β011) and | |
| `confluence-reversal-engine-spec.md` is the original blueprint (in the parent `web/` dir; | |
| copy is the source of truth for strategy logic). | |
| --- | |
| ## What works today (verified) | |
| | Area | File(s) | State | | |
| |------|---------|-------| | |
| | Config + version-controlled thresholds | `config.py` (CONFIG_VERSION=3) | β | | |
| | OKX data client (funding/OI/klines/taker/liq WS) | `exchange/okx.py`, `exchange/base.py` | β live-probed | | |
| | Dynamic universe funnel | `universe.py` | β | | |
| | SQLite store + schema (spec Β§9) + self-baselines | `store/db.py` | β | | |
| | Data workers (universe/liq/poller) | `workers.py` | β | | |
| | Engine: 4 layers, confluence, conviction, levels | `engine/layers.py`, `engine/scoring.py` | β 42 tests pass | | |
| | Lifecycle state machine | `engine/lifecycle.py` | β | | |
| | Risk (cooldown gate, no caps β conviction ranks) | `engine/risk.py` | β | | |
| | Signal engine + active monitor | `signals_worker.py` | β synthetic e2e | | |
| | Telegram alerts | `alerts/telegram.py` | β format verified | | |
| | HF bucket persistence (restore/sync) | `sync.py` | β structure (live on HF) | | |
| | App entrypoint + boot wiring | `app.py` | β boots, placeholder UI | | |
| | Per-pair links (TV + symbol helpers) | `links.py` | β | | |
| | Tests | `tests/test_engine.py` | β 42/42 | | |
| Run tests: `cd <dir> && python tests/test_engine.py` | |
| Boot locally: `pip install -r requirements.txt && python app.py` (OKX needs non-US IP). | |
| --- | |
| ## What REMAINS (priority order) | |
| ### 1. Step 4 β Dashboard UI β main remaining work | |
| `ui/dashboard.py` currently is a **skeleton stub** (see file header). Build the real one | |
| to the design brief (Build Log Entry 003 + D10): | |
| - Dark theme, **Nunito** font, SVG logo + uniform SVG animations, `Ver. 1.0` tag, live | |
| status badges, Title Case labels, fully responsive. | |
| - **4 tabs:** Signals (ranked by conviction, colored tags π£π’π‘βͺ, Chart + TV links), | |
| Market (funding/OI/liq per universe coin), Performance (win rate / avg R / equity curve | |
| in R, from `signals` table β spec Β§7), Health (ws uptime, last poll, baseline coverage | |
| days/7, DB size, config version). | |
| - **Live updates via `gr.Timer`** (no page refresh β D10). Read latest state from `store/db.py` | |
| query helpers; `app.py` already lazy-imports `ui.dashboard.build(get_state)` and falls back | |
| to the placeholder if absent β so just implement `build(get_state)` returning a `gr.Blocks`. | |
| - Data already available: `db.recent_signals()`, `db.active_signals()`, `db.latest_snapshots()`, | |
| `db.liq_baseline_days()`, plus `signals` rows carry conviction fields needed for tags. | |
| ### 2. Step 4b β Annotated "Chart" screenshots (D7) | |
| `matplotlib`+`mplfinance` already in requirements. Build `chart.py`: render a candlestick PNG | |
| for a signal marking FVG boxes, swing H/L, BoS line, entry/stop/T1/T2. Surface as the "Chart" | |
| link/button per signal in the Signals tab. (TV link already done in `links.py`.) | |
| ### 3. Conviction persistence gap (small, do early) | |
| `signals` table stores `score_*` + levels but NOT `conviction`/`conviction_tag` as columns | |
| (they're computed in `engine/scoring.py`). For the dashboard tags to survive restart, either | |
| (a) add `conviction REAL, conviction_tag TEXT` columns to the schema in `store/db.py` + | |
| `insert_signal`, OR (b) recompute on read. Recommend (a) β one ALTER + 2 dict keys. | |
| ### 4. Step 5 β SKILL.md (installable blueprint) | |
| Use the skill-export procedure to produce an installable `SKILL.md` capturing the whole | |
| strategy + build. Not yet started. | |
| ### 5. Step 6 β Final packaging | |
| Re-zip as `Confluence Revesal Crypto Engine v1.0.zip` (user's exact filename, note the | |
| original spelling) after testing + final go. | |
| ### 6. Live validation on HF (only possible there) | |
| - OKX REST from a non-US node (this build box + HF default are geo-blocked from Binance/Bybit; | |
| OKX worked from here, but confirm on the actual Space). | |
| - Bucket restore/sync round-trip with real `HF_TOKEN` + `CRE_BUCKET`. | |
| - 7-day liquidation baseline accumulation (cold start β WATCH-only until mature). | |
| --- | |
| ## Key decisions already locked (don't re-litigate β see Build Log) | |
| - **D1** Gradio SDK (not Docker) Β· **D4** OKX sole data source (Binance/Bybit removed, geo-blocked) | |
| - **D5** dynamic whole-market universe via liquidity funnel, event-driven on flushes | |
| - **D6** CoinGecko = enrichment/price-redundancy only (cannot power signals) | |
| - **D7** per-signal TV link (`TV_EXCHANGE` var, default BYBIT) + annotated Chart screenshot | |
| - **D8** Telegram token+chat id = HF **Secrets** (encrypted) | |
| - **D9** persistence = HF Storage Bucket snapshot/restore (NOT direct mount β SQLite locking) | |
| - **D10** UI live updates via `gr.Timer`, no page refresh | |
| - **Engine:** removed spec's hard active-signal caps β **Conviction Score (0..100)** ranks ALL | |
| setups + colored tag (Eliteβ₯85/Strongβ₯70/Moderateβ₯55/Watch). Cooldown is the only hard gate. | |
| ## Env vars (HF Space) | |
| Secrets: `TELEGRAM_BOT_TOKEN`, `TELEGRAM_CHAT_ID`, `HF_TOKEN`, (opt) `COINGLASS_API_KEY`. | |
| Variables: `CRE_BUCKET`, `TV_EXCHANGE`, `DB_PATH=/data/cre.db` optional, `UNIVERSE_MAX`, | |
| `UNIVERSE_MIN_TURNOVER_USD`, `WATCHLIST` (pins fixed mode), `POLL_INTERVAL_SEC`. | |
| Full setup runbook: `HF_SETUP.md`. | |