VeztaVezta
Architecture

Signal Pipelines

News ingestion + insider-signals (smart-money) + AI predictions

Vezta runs three intelligence pipelines that feed the monitor:signals WebSocket channel and Telegram channels:

  1. News signal pipeline -- aggregates news + social media, classifies, links to markets
  2. Insider-signals pipeline -- detects smart-money Polymarket whales via 11-layer filter + 10-metric scorer
  3. AI predictions -- LLM-backed market predictions via OpenRouter (heuristic fallback)

News Signal Pipeline

Lives in src/modules/monitor/ingestion/, runs on the signal-ingestion BullMQ queue managed by SignalIngestionScheduler.

News Connectors

SourceFrequencyNotes
RSSEvery 5 minutesBBC, CNBC, WSJ, Al Jazeera, TechCrunch, MarketWatch, etc.
GDELTEvery 30 minutesGlobal event database covering 100+ countries
NewsDataEvery 15 minutesStaggered by 2.5 min/category to avoid API rate limits
CryptoNewsEvery 10 minutesCryptocurrency-focused news
X / Twitter5 / 15 / 30 min3 tiers: tier-1 critical (3s throttle), tier-2 important (5s), tier-3 long-tail (8s); syndication scraping + FxTwitter enrichment
TelegramEvery 15 minutesGramJS MTProto when TELEGRAM_SESSION configured (real-time events + polling); HTML scraping of t.me/s/ as fallback
CleanupDailyRemoves stale signals and expired articles

Pipeline Stages

  1. Language filter -- non-English articles dropped at intake
  2. Dedup -- cache + DB lookup ensures the same story does not reach the feed twice
  3. Classification -- assigns category (politics, military, financials, crypto, tech, energy, macro) and severity score (critical / high / low)
  4. Market linking -- matches article content to markets in the DB; stamps marketId and relatedMarketIds
  5. Geo-tagging -- extracts coordinates, country name, ISO code, flag emoji
  6. Broadcast -- saves MonitorSignal row + emits on monitor:signals channel

Insider-Signals Pipeline

Lives in src/modules/insider-signals/. Detects insider/smart-money wallets on Polymarket and fans alerts to Telegram (@vezta_signals), Expo push, and the in-app monitor feed. Runs on the insider-signals BullMQ queue with two job types:

  • classify-trade -- run filter + scorer + dispatcher on a single fresh trade
  • cluster-refresh -- on the insider-cluster-refresh queue, rebuilds market clusters hourly

Stage 1 -- MmBotFilterService (11 layers, 3 tiers)

Rejects market makers, bots, copy-traders, grid strategies before any scoring. Each layer is a FilterLayer class in filters/:

LayerWhat it catchesTier
L1Blacklisttier-1 (immediate reject)
L2Two-sided tradingtier-1
L3Cancel-ratetier-1
L4 / L4bFlatnesstier-1
L5a / L5bTiming patternstier-1
L7Copy-trade detectiontier-1
L6 / L8Soft signalstier-2 (reject at 2+)
L9Reaction patternstier-2
L10Grid strategiestier-2
L11Cluster detectiontier-3 (feeds scorer)

Stage 2 -- InsiderScorerService (10 metrics)

Composes metric classes in metrics/:

MetricDescription
NETNet position size
CRConviction ratio
MDRMarket dominance
AABAge-adjusted boldness
TSJRTrade-size jump
DCSDirectional conviction (cross-market via MarketCluster)
RARapid accumulation
SASSlow accumulation
PHRPosition holding ratio
HEHistorical edge

Composite score โ†’ tier:

ScoreTierEmoji
โ‰ฅ15HIGH_CONVICTION_INSIDER๐Ÿ”ด
11-14STRONG_SIGNAL๐ŸŸ 
7-10WATCH๐ŸŸก
4-6LOW_PRIORITY๐ŸŸข
<4dropped--

Stage 3 -- Dispatch Pipeline

  • AlertDebouncerService -- per-wallet ร— market ร— 24h dedup via Redis (alert:dedup:{wallet}:{marketId} TTL 24h). Higher-score duplicates bump the existing row via update_existing; same/lower drops. Daily UTC caps: 50 global, 10 ๐Ÿ”ด (vibrant mode, 2026-04-19). Counters only increment on successful publish.
  • CoordinatedDetectorService -- 3+ distinct EOAs same market+side within 1h โ†’ mints a deterministic coordinatedId (prefix solo: when no MarketCluster row exists). Backfills the id onto earlier alerts in the window.
  • NotificationDispatcherService -- tier-gated fanout: all 4 tiers post to Telegram (vibrant mode), only ๐Ÿ”ด triggers Expo push, WS emits on every alert via gateway.broadcastToChannel('monitor:signals', 'insider-alert', ...).

Trade Producers

Two producers feed the classify-trade queue:

  1. TradeSyncService.enqueueInsiderSignalsClassify() -- called from the hot-set trade-sync (every ~5 min, ~850 tracked markets)
  2. InsiderTradePollerService -- global recent-trades poller (every 30s). Off by default; gated by INSIDER_SIGNALS_POLLER_ENABLED=true.

Market Clustering

Feeds the DCS metric. Rule-based (no embeddings): same Polymarket event_id OR resolution date ยฑ7d + โ‰ฅ0.5 Jaccard title-token overlap. Rebuilt hourly by ClusterRefreshProcessor. Semantic-similarity upgrade deferred until embeddings land in ai-predictions.

Funding Trace

ProxyOwnerResolver maps Polymarket proxy โ†’ owner EOA. UsdcInflowWalker + BridgeUnwinder + SourceClassifier produce a FundingClass (PRIVACY_MIXER / NO_KYC_SWAP / CEX / FIAT_ONRAMP / MM_SUBWALLET / SYBIL_CLUSTER). Cached 30d in WalletLabel.

Telegram Channels and Bots

Three Telegram channels:

Channel (prod)Audience
@vezta_signalsPublic
@vezta_signals_betaBeta
InternalVezta team

Channel IDs differ per VM by design (prod has 3 distinct IDs; staging mirrors all 3 tier env vars to a single dev channel @vezta_signals_dev).

The dispatch (signals) bot is @vezta_signal_bot (prod) / @dev_vezta_signal_bot (staging). The interactive trading bot is live โ€” handled by the telegram-bot module (TelegramBotController, @veztabot prod / @staging_vezta_predict_bot staging; handles are env-driven) with /trade, /limit, /tpsl, /combo, /arb, and /wallet command handlers and a webhook at POST /api/v1/telegram-bot/webhook.

Prisma Models

ModelPurpose
InsiderAlertThe fanout target -- one row per published alert
WalletLabelFilter classifications + funding class, 30d TTL
MarketClusterDCS input
InsiderAlertFeedbackFP/real votes for tuning
TelegramBindingUser โ†’ Telegram chat link (bot linking)

Dedup cache is Redis-only -- a flushall drops dedup state, causing re-publish storms on the next trade burst. Clear the debouncer counters (alert:count:*) and dedup keys (alert:dedup:*) separately, not via wildcard.

AI Predictions

Lives in src/modules/ai-predictions/. Uses the OpenAI SDK (openai package) pointed at OpenRouter's API-compatible endpoint, with a heuristic fallback when OPENROUTER_API_KEY is unset.

Generates per-market predictions with confidence scoring. Stored in AiPrediction; aggregate model performance in AiModelStats.

Other Signal Detection

The signal-detector queue handles market-data-based signal detection (whale moves, smart-money patterns derived from price/volume). This is distinct from the news pipeline above, which focuses exclusively on external content sources.

On this page