Skip to content

gehlotmanthan/ProjectOdin

Repository files navigation

TradeARO

Automate your TradingView alerts into real broker orders. TradeARO bridges TradingView strategies to Indian and global brokers with webhook-based execution, copy trading, paper trading, and a real-time dashboard.

Architecture

TradingView Alert
  -> POST /api/webhook/{webhookId}     (Next.js on Vercel)
  -> Validate, log, forward
  -> POST /internal/webhook            (FastAPI engine on Railway)
  -> Place order on broker via adapter
  -> Dashboard updates in real-time via Supabase Realtime

Monorepo structure (Turborepo):

Directory Stack Platform
apps/web/ Next.js 16 (App Router) Vercel
apps/engine/ Python FastAPI Railway
packages/shared/ TypeScript types Shared
packages/odin-python/ Python SDK PyPI
supabase/ SQL migrations Supabase

Supported Brokers

Broker Region Auth
Zerodha (Kite Connect) India OAuth + daily login
Angel One (SmartAPI) India API key + TOTP
Upstox India OAuth + daily login
Alpaca US API key + secret
Binance Global (crypto) API key + HMAC
Interactive Brokers Global Client Portal Gateway

Key Features

  • Webhook execution -- TradingView alerts trigger real orders in milliseconds
  • Paper trading -- simulated fills with virtual capital (no risk)
  • Copy trading -- fan out master orders to sub-accounts
  • Semi-auto mode -- queue signals for manual approval before execution
  • Split orders -- break large orders into smaller pieces with delay
  • Smart orders -- target-position based (auto-computes delta)
  • Public API + Python SDK -- programmatic access with API key auth
  • Telegram bot -- check positions, orders, funds via chat commands
  • Static IP compliance -- SEBI-compliant outbound proxy for Indian brokers

Quick Start

# Install dependencies
npm install

# Run everything (web + engine)
npm run dev

# Or individually
npm run dev:web      # Next.js on port 3000
npm run dev:engine   # FastAPI on port 8000

Environment Variables

Web (Vercel)

Variable Description
NEXT_PUBLIC_SUPABASE_URL Supabase project URL
NEXT_PUBLIC_SUPABASE_ANON_KEY Supabase anonymous key
ENGINE_URL Engine URL (Railway)
ENGINE_INTERNAL_KEY Shared secret for web-to-engine auth
NEXT_PUBLIC_APP_URL Full Vercel deployment URL

Engine (Railway)

Variable Description
SUPABASE_URL Supabase project URL
SUPABASE_SERVICE_ROLE_KEY Service role key (bypasses RLS)
ENGINE_INTERNAL_KEY Shared secret for web-to-engine auth
CREDENTIAL_ENCRYPTION_KEY 64-char hex for AES-256-GCM encryption
CORS_ORIGINS Comma-separated allowed origins
BROKER_PROXY_URL SOCKS5/HTTPS proxy for static IP (optional)
STATIC_IP Outbound IP for broker whitelisting (optional)
TELEGRAM_BOT_TOKEN Telegram bot token (optional)
RESEND_API_KEY Resend email API key (optional)

Plus per-broker OAuth keys -- see .env.example.

Static IP Compliance (SEBI)

SEBI mandates that API calls to Indian brokers (Zerodha, Angel One, Upstox) must originate from a whitelisted static IP. TradeARO supports this out of the box.

All outbound broker HTTP calls are routed through a centralized client (core/http_client.py). When BROKER_PROXY_URL is configured, traffic exits through a SOCKS5 or HTTPS proxy with a known static IP.

Setup:

  1. Provision a VPS with a static/elastic IP (e.g. AWS EC2 + Elastic IP)
  2. Run a SOCKS5 proxy (Dante, 3proxy, or similar) on the VPS
  3. Set on Railway:
    BROKER_PROXY_URL=socks5://user:pass@your-proxy-ip:1080
    STATIC_IP=your.static.ip.address
    
  4. Whitelist the IP in your broker's developer portal (Kite Connect, SmartAPI, Upstox Developer)
  5. Verify: GET /api/v1/health/outbound-ip returns the configured IP

Without BROKER_PROXY_URL, all calls go direct (no proxy). Non-broker traffic (Telegram notifications, email) is never proxied.

Testing

npm test              # All tests
npm run test:web      # Vitest (web)
npm run test:engine   # Pytest (engine)
npm run test:e2e      # Playwright (requires dev server)

Deployment

Component Platform Config
Web Vercel apps/web/vercel.json, root = apps/web/
Engine Railway apps/engine/Dockerfile, root = apps/engine/
Database Supabase Migrations in supabase/migrations/

Documentation

License

Proprietary. All rights reserved.

About

Multi-tenant SaaS algo trading platform — TradingView webhooks, 6 broker adapters, copy trading

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors