Canary AI
Inspiration
Most stock portfolio tools assume you already know what you're doing — they're built for traders who understand P/E ratios, covariance matrices, and Sharpe ratios. We wanted to build something for everyone else: people who want their money to work harder but don't have the time or background to manage it themselves. Inspired by the idea of a "set it and forget it" financial advisor that fits in your pocket, Canary AI was designed to lower the barrier to smart investing through conversational AI, automated portfolio optimisation, and real-time news awareness — all wrapped in a friendly, approachable UI.
What it does
Canary AI is an AI-powered stock portfolio manager for beginner investors. You start by chatting with an onboarding advisor that learns your investment style, risk tolerance, and stock preferences through casual conversation — no forms, no jargon. From there, Canary AI takes over: it tracks live market data, runs a C++ quantitative optimiser based on Modern Portfolio Theory to find your ideal portfolio allocation using the Efficient Frontier and maximum Sharpe ratio, and then overlays that plan with real-time Finnhub news sentiment analysis powered by Claude to catch anything the numbers might miss. Trades are surfaced in a clean bird-themed desktop interface where you can monitor your portfolio, review proposed trades, and manage your cash balance — all in one place.
How we built it
Canary AI is a full-stack application with four distinct layers working in concert. The frontend is a React 19 + Vite app with a custom design system — a playful bird-and-nature theme with GSAP animations, a cloud-shaped dock, draggable and snappable windows, and full day/night theming. The backend is a FastAPI server that manages live stock tracking (via yfinance and Finnhub), user authentication with bcrypt and session tokens, and Supabase for persistent storage of users, portfolios, holdings, and transactions. The prediction engine is a standalone C++17 binary that ingests per-ticker CSV data, builds a covariance matrix, samples the Efficient Frontier, and outputs a concrete trade plan with whole-share allocations against a real cash reserve. Finally, two AI layers are powered by the Anthropic SDK: a conversational chatbot that collects investment preferences through a state machine, and a news-sentiment overlay that runs Claude against recent market news to adjust the quant trade plan before it executes.
Challenges we ran into
Getting the C++ prediction module to integrate cleanly with the Python backend was one of the trickiest parts — particularly keeping holdings state consistent across prediction cycles and syncing it bidirectionally with Supabase. Timestamp alignment across stocks with different trading volumes required careful forward-fill logic to avoid covariance matrix errors. On the AI side, making the chatbot feel natural while still reliably extracting structured data (tickers, dollar amounts, trading styles) from freeform conversation required a two-call architecture — one call for conversation, one for structured extraction — and careful handling of edge cases like referential stock mentions ("add all of those") and ambiguous confirmations. The multi-window snapping system on the frontend, including ghost previews, group dragging, and sync-resizing of bonded windows, was also far more involved than anticipated.
Accomplishments that we're proud of
We're proud that Canary AI works end-to-end: a brand-new user can sign up, chat with the advisor, have stocks tracked automatically, receive a mathematically-grounded trade plan adjusted for current news, and see it all reflected live in their portfolio dashboard — with no manual steps in between. The C++ efficient frontier engine is genuinely doing real portfolio optimisation, not a simulation. The news-sentiment overlay adds a layer of qualitative judgment that pure quant models miss. And the frontend, from the landing page tree scene to the lego-style window snapping, is something we're genuinely happy with visually.
What we learned
We learned a lot about orchestrating multiple AI calls within a single user interaction without it feeling disjointed — particularly managing state across the chatbot's conversation turns and keeping preference extraction reliable. On the systems side, integrating a compiled C++ binary into a Python async backend and keeping their shared file state consistent under concurrent requests was a valuable exercise. We also deepened our understanding of Modern Portfolio Theory and how theoretical concepts like the Sharpe ratio translate into practical, whole-share trade decisions under real capital constraints.
What's next for canary.ai
The next natural step is moving from paper trading to real brokerage integration — connecting to a platform like Alpaca Markets to execute live trades. We'd also like to expand the news intake beyond Finnhub to cover macroeconomic and geopolitical sources, build out SMS/WhatsApp notifications so users get trade alerts without needing to open the app, and add a proper onboarding explainer so first-time users understand what Canary AI is doing on their behalf and why. Longer term, personalised performance analytics — showing users how their portfolio has performed relative to their stated risk tolerance — would close the feedback loop and make Canary AI a genuine learning tool, not just an automation.
Built With
- anthropic
- claude
- cpp
- fastapi
- finnhub
- gsap
- npm
- postgresql
- postman
- python
- react
- supabase
- uvicorn
- vite
- yfinance
Log in or sign up for Devpost to join the conversation.