Skip to content

[operator] Decide daily-suggestion handling of missing spot prices #643

Description

@i-xtsu-sixyou-ken-mei

Decision needed

Decide how /api/v3/strategy/daily-suggestion/{user_id} should behave when the strategy's per-day price map lacks a held spot asset during warmup, and whether the underlying price gap needs a freshness guard upstream. Today the request fails with HTTP 500. Any fix changes strategy/portfolio valuation semantics, so this is not weak-agent work.

Evidence

  • Sentry ANALYTICS-ENGINE-1: ValueError: Missing price for spot asset 'ETH', 42 events, first seen 2026-09-19T07:49:45Z, last seen 2026-09-21T09:59:51Z, release 36d73da6. ANALYTICS-ENGINE-2: HTTPException: Failed to generate daily suggestion, 22 events, same window. Client side, ZAP-PILOT-WEB-3: APIError: HTTP 500 in getDailySuggestion, 4 events 2026-09-19T07:49:53Z–2026-09-20T10:10:04Z, release 3.0.1.
  • Stack: v3_strategy.get_daily_suggestion → strategy_daily_suggestion_service._compute_daily_suggestion → composed.get_daily_recommendation → warmup_day → flat_minimum.warmup → dma_gated_fgi/component.warmup → signals/contracts.from_strategy_context → execution/portfolio.total_value → _resolve_price_for_asset, which raises when the day's price map has no eth key (apps/analytics-engine/src/services/backtesting/execution/portfolio.py).
  • No commit has touched portfolio.py, strategy_daily_suggestion_service.py or signals/contracts.py since 2026-09-19. The events stopped after 2026-09-21T09:59Z without a fix; why they stopped (price backfill or the caller going away) is unverified, so quiet time is not recovery evidence.
  • ops_investigate sentry:stale-unresolved/analytics-engine: blockers [], inspectionCoverage inspected, affectedUsers 0 (backend events carry no user), no AUM or customer exposure recorded.
  • Related, different root cause: the borrowing-positions dust-debt contract issue seen in the same web session (filed separately).

Options

  1. Keep failing closed but return a typed "price data unavailable" response instead of an unhandled 500, and add a freshness check that surfaces the missing price day as an ops signal.
  2. Carry the last known price forward for a missing warmup day (bounded, e.g. at most one day). This changes valuation semantics and needs an explicit decision.
  3. Exclude days with incomplete price maps from warmup.

Fingerprint

triage:sentry:ANALYTICS-ENGINE-1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:analytics-engineScoped to apps/analytics-engineoperatorNeeds production credentials or a human decision; excluded from the agent backlog pool

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions