Skip to content

feat: publish signals to Redis Pub/Sub #252

@yuriy-arabskyy

Description

@yuriy-arabskyy

Context

Currently, signals are only written to QuestDB metrics. The admin portal polls QuestDB every 10s to display them. For real-time display, we need signals published to Redis Pub/Sub so they can be streamed to the frontend instantly.

Requirements

  • When a strategy generates a signal, publish it to Redis channel bot:{bot_id}:signals
  • Message format: JSON with timestamp, symbol, exchange, market_type, signal value, reference_price, price, take, stop, group_name, comment, strategy_name
  • Publishing should be fire-and-forget (non-blocking) — don't let Redis Pub/Sub failures affect trading
  • Use existing Redis connection from bot config (REDIS_URL in bot-config secret)

Notes

  • Keep existing QuestDB metric writes — Redis Pub/Sub is additive
  • Consider batching if signal rate is very high (unlikely for most strategies)

Acceptance Criteria

  • Signals published to Redis Pub/Sub channel in real-time
  • Message format matches what the frontend expects (same fields as /bots/{id}/signals response)
  • No impact on trading latency if Redis is slow/unavailable
  • Works with existing bot-config Redis URL

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions