Skip to main content

X stream and social alerts

QuantDesk runs a dedicated x-stream service on port 3008 for X/Twitter ingestion. It is separate from both data-ingestion and news-ingestion.

Status

  • Shipped: dedicated x-stream/ service, backend /api/v2/x/* routes, alert fanout, terminal windows, MIKEY get_x_context
  • Dev sample mode: when TWITTER_BEARER_TOKEN is unset in non-production, env-gated sample posts (not live KOL firehose)
  • Not supported: direct client-side X API access or frontend-held bearer tokens

Service boundaries

LayerResponsibility
x-stream/Poll or stream watched accounts, normalize posts, derive alert events
backend/Persist recent posts/alerts, expose /api/v2/x/*, fan out websocket events
Lite / Pro / MIKEYRead the normalized feed and alert cache only

Normalized post shape

Each ingested post is normalized to:
{
  "post_id": "tweet-id",
  "author": "@account",
  "text": "Post body",
  "ts": "2026-06-25T12:00:00.000Z",
  "urls": [],
  "entity_tags": ["SOL", "JUP"],
  "linked_symbols": ["SOL-PERP", "JUP-PERP"],
  "lists": ["solana_ecosystem"],
  "url": "https://x.com/..."
}
The service publishes raw normalized events to x.posts.raw and stores recent history in the x_posts table.

Alert types

QuantDesk currently emits separate alert events to x.alerts.raw and stores them in the x_alerts table.
Alert typeTriggerTypical use
account_postA tracked account postsBreaking headline awareness
keywordWatch keywords matchMacro, policy, or protocol watchlists
symbol_mentionA mapped market symbol is mentionedJump from social context to chart / market
Each alert includes severity, linked_symbols, lists, and the original post_url.

Public read paths

SurfaceRoute / event
Feed snapshotGET /api/v2/x/feed
Alerts snapshotGET /api/v2/x/alerts
MIKEY / agent contextGET /api/v2/x/context and backend get_x_context tool
Correlated UI timelineClient-side merge of GET /api/v2/news and GET /api/v2/x/feed
Compatibility timelineGET /api/v2/x/timeline (legacy compatibility only)
Push updatesSocket.IO x_post and x_alert via dedicated X feed / alert subscriptions
Service healthGET http://localhost:3008/health

API usage and ToS posture

  • QuantDesk treats X as a licensed upstream with rate and ToS limits.
  • Frontend clients and MIKEY do not call X directly.
  • TWITTER_BEARER_TOKEN is owned by x-stream only.
  • Development mode may serve env-gated sample posts when no bearer token is configured.