About Sonar
What Inspired Me The core inspiration came from the problem of information latency in the markets. By the time you connect the dots across news, social media, and prediction markets, the movement is usually already priced in. Existing tools are either expensive, human-only terminals or single-source sentiment bots that lack auditable grounding. General LLMs fall short because they cannot watch continuous streams or autonomously cite live sources. Thriving in the zero-to-one phase of product building, I wanted to engineer a true Agentic AI system—a standing watch that constantly monitors market cross-currents and earns autonomously without human intervention.
How I Built It Sonar is built as a closed-loop architecture centered around high-performance data processing. I designed the frontend as a "Tactical Command Panel"—a cold, professional dark-mode UI optimized for rapid decision support. The pipeline relies on three main pillars:
Sense (Nimble & Custom Ingestion): Pulls real-time streams of news, X/social posts, and Polymarket odds. To solve the "cold start" problem, the system directly queries Polymarket's CLOB
/prices-historyendpoint to fetch the actual 5-day daily odds immediately. It intelligently selects the best live market per ticker and plots its "Yes" token's daily price. Furthermore, I built a completely free, offline, finance-tuned lexicon to score news sentiment locally without any API latency. It scores headlines from -1 to +1, sets the overarching tone for the generated brief, and injects clean ▲ green / ▼ red visual markers directly next to the news count in the radar UI.Fuse & Detect (ClickHouse): The core engine stores timestamped events and computes cross-source time-alignment in real time. It executes sub-200ms queries over live feeds to detect anomalies and momentum.
Transact (x402 / CDP): Other trading and research agents can consume this divergence feed, paying per read in USDC directly to the agent's wallet.
To flag unusual activity, the system calculates a divergence score. This detects when crowd odds and chatter are moving but the asset price has not yet reacted. The core mathematical calibration for the radar is defined as:
$$\text{DivergenceScore} \approx (0.5 \cdot \text{socialVolume} + 0.3 \cdot \text{newsNorm} + 0.2 \cdot \text{polyConviction}) \cdot \text{priceFlatness}$$
Nimble's news and social result counts directly drive this score. I mapped these raw counts into specific bands so the radar intelligently discriminates between tickers instead of indiscriminately flagging the entire market.
Challenges I Faced The biggest technical hurdle was making a live market intelligence demo "weekend-proof" for the hackathon. Because equity prices are closed over the weekend, only three of our four feeds (news, X, and Polymarket) were genuinely live. Consequently, the $\text{priceFlatness}$ multiplier in our divergence calibration sits at roughly 1, as prices are statically anchored to their last close. Fine-tuning the Nimble result bands to prevent false-positive signal flooding under these weekend constraints required strict threshold mapping. Additionally, building resilient routing for the Polymarket data was critical; if a market lacks history via the CLOB endpoint, the system had to be engineered to automatically fall back to the accumulated aggregate so the price line always renders perfectly. Finally, ensuring the loop ran entirely on a data-triggered schedule without any manual intervention in the middle was a complex orchestration challenge.
What I Learned Building Sonar reinforced my understanding of high-throughput data orchestration in Agentic AI. Moving beyond simple LLM wrappers, I learned the power of utilizing ClickHouse not just as a logging sink, but as the centerpiece computational engine for financial time-series data. Engineering the offline sentiment lexicon taught me how to optimize for maximum speed and system resilience by intentionally avoiding external API dependencies. Furthermore, integrating the x402 protocol and CDP taught me how to construct a viable machine-to-machine economy, proving that autonomous agents can seamlessly buy and sell intelligence from one another.
Built With
- clickhouse
- fastapi
- langgraph
- nimble
- typescript
- x402
Log in or sign up for Devpost to join the conversation.