unrip/BACKLOG.md
philipp 7ea1576ba7 Plan quote lifecycle truth turn
Proof: Archive the completed runtime-health turn and open a new implementation turn that replaces ambiguous quote verdicts with explicit lifecycle truth and durable execution explanation.

Assumptions: Recent decision and execution records already contain enough repo-owned evidence to derive a truthful first-pass quote lifecycle for the active pair.

Still fake: The new turn is planning state only; the dashboard still contains the existing lifecycle ambiguity until this proof is implemented.
2026-04-09 00:39:02 +02:00

3.8 KiB

Backlog

This file is the candidate pool for future work. It is not the active plan.

Rules:

  • Add ideas here when they do not belong in the current turn.
  • Promotion from backlog to an active turn is a separate planning step.
  • scripts/workflow/add_backlog.py can append new items with stable IDs.

Implementation Candidates

  • [I001] Hybrid reference-price service using Kraken stream and CoinGecko poll or fallback for the active pair inputs.

  • [I002] PostgreSQL event store plus history writer for quotes, reference prices, decisions, commands, and execution results.

  • [I003] Strategy engine that consumes norm.swap_demand plus reference prices and emits auditable decisions.

  • [I004] Real Near Intents executor service using pre-funded internal inventory, with explicit arming and idempotent result reporting.

  • [I005] Import local EUR/BTC history on disk into research tables or files for replay and baseline checks.

  • [I006] Decision-to-command safety gate with explicit arm or disarm state, notional caps, and inventory freshness checks.

  • [I007] Inventory-aware execution rule: implement both directions, but only fire the side backed by credited internal source-asset inventory.

  • [I008] Inventory-sync service for NEAR Intents internal balances and pending funding state.

  • [I009] Liquidity-manager service for deposit addresses, funding actions, and treasury visibility.

  • [I012] Quotes and execution analytics workbench: live quote tape, quote count and volume windows, size-bucket distributions, oracle-deviation views, per-quote decision and execution trace, and matched-only filters.

  • [I013] Benchmark and PnL analytics: compare trade PnL versus mark-to-market, all-BTC hold, all-EURe hold, passive 50/50 hold, and hindsight trade quality against later benchmarks.

  • [I015] (soon) Benchmark-aware strategy thresholds and inventory-skewed fees: compare live inventory against deposit-time hold and target BTC/EURe mix before quoting away preferred inventory. tags=strategy,inventory,pnl

  • [I016] (soon) Treasury cashflow and fee ledger: durably record deposits, withdrawals, bridge or network costs, and other non-trade cashflows so dashboard profit can move from mark-to-market to true net PnL. tags=pnl,fees,treasury

  • [I017] (soon) Per-trade realized attribution: link each successful trade to actual settled inventory deltas and attributable costs so the system can report realized net contribution per trade instead of only expected edge. tags=trades,pnl,settlement

  • [I018] (later) Quote-to-outcome and markout analytics: link quote, response, decision, execution result, and settlement, then store later reference-price markouts to measure adverse selection and quote quality. tags=quotes,analytics,markout

Research Candidates

  • [R001] Compare Kraken and CoinGecko drift and freshness for the assets needed to price the active pair.
  • [R002] Test whether the active pair's implied rate diverges from external reference prices enough to justify execution after a simple 2% gross threshold.
  • [R003] Measure whether stale quotes correlate with worse execution quality or higher reject rates.
  • [R004] Import and inspect the local historical EUR/BTC data to see how it can seed replay and backtests.
  • [R005] Measure how long treasury funding takes from external transfer to credited internal inventory.

Ops Candidates

  • [O001] PostgreSQL backup and retention plan for analytics and audit history.
  • [O002] Signing-secret and NEAR Intents account management for real execution credentials.

Bugs

  • [B001] The previous storage-only turn did not reach a tradeable loop and pulled the workflow toward scaffolding.
  • [B002] No reference price source exists, so the system cannot estimate edge.
  • [B003] Dummy reactor and dummy executor prevent a non-mocked trade path.
  • [B004] The prior plan assumed external hot wallets were on the trade hot path instead of pre-funded NEAR Intents inventory.