X stream and social alerts
QuantDesk runs a dedicatedx-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, MIKEYget_x_context - Dev sample mode: when
TWITTER_BEARER_TOKENis 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
| Layer | Responsibility |
|---|---|
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 / MIKEY | Read the normalized feed and alert cache only |
Normalized post shape
Each ingested post is normalized to:x.posts.raw and stores recent history in the x_posts table.
Alert types
QuantDesk currently emits separate alert events tox.alerts.raw and stores them in the x_alerts table.
| Alert type | Trigger | Typical use |
|---|---|---|
account_post | A tracked account posts | Breaking headline awareness |
keyword | Watch keywords match | Macro, policy, or protocol watchlists |
symbol_mention | A mapped market symbol is mentioned | Jump from social context to chart / market |
severity, linked_symbols, lists, and the original post_url.
Public read paths
| Surface | Route / event |
|---|---|
| Feed snapshot | GET /api/v2/x/feed |
| Alerts snapshot | GET /api/v2/x/alerts |
| MIKEY / agent context | GET /api/v2/x/context and backend get_x_context tool |
| Correlated UI timeline | Client-side merge of GET /api/v2/news and GET /api/v2/x/feed |
| Compatibility timeline | GET /api/v2/x/timeline (legacy compatibility only) |
| Push updates | Socket.IO x_post and x_alert via dedicated X feed / alert subscriptions |
| Service health | GET 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_TOKENis owned byx-streamonly.- Development mode may serve env-gated sample posts when no bearer token is configured.