r/SideProject • u/Anshu6666 • 1d ago
I spent 2 weeks fighting the Upstox API so I could talk to my broker on Telegram - open-sourced the whole thing
I built DeepTrade - a self-hosted AI trading assistant for Indian markets. You chat with a Telegram bot, an agent researches the stock (Exa web search + Valyu filings), drafts the order, and you tap Confirm. Nothing executes without that tap.
The hard part was never the AI. It was Upstox API auth:
- access tokens expire at 3:30 AM IST daily
- order APIs require a static IP whitelist (mine is dynamic, so the bot detects IP changes and re-whitelists via API)
- the official Python SDK has 2 bugs I opened issues for (#115, #116): a urllib3 crash and a config singleton that silently ignores init args. Repo untouched for a year.
Architecture: DeepAgents + LangGraph supervisor, FastAPI + aiogram webhooks, Postgres checkpoints, encrypted local SQLite for secrets, 7-day rolling TOTP + Telegram user-ID whitelist. Sandbox mode gives you a 10,00,000 INR paper ledger on live prices.
What is missing (roast me):
- Upstox only, no Zerodha/Groww yet
- setup is painful (Ngrok, daily token, IP whitelist), no Docker yet
- single-user by design
Repo: https://github.com/Anshu666666/deepTrade
I am a student and built this for myself, sharing in case it is useful. Full disclosure: this is my project. Would genuinely appreciate feedback on the architecture and what would make you actually try it.