Skip to content
This repository was archived by the owner on Dec 9, 2025. It is now read-only.

TradingGoose/Open-TradingGoose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

TradingGoose Logo TradingGoose

Discord

An intelligent trading platform powered by multiple AI agents that collaborate to analyze markets, manage portfolios, and execute trades with sophisticated risk management.

๐Ÿ“‘ Table of Contents

๐Ÿ“– Overview

TradingGoose focuses on event-driven trading strategy and analysis that harnesses the power of AI agents and Alpaca's market data to deliver sophisticated trading recommendations and automated portfolio management insights. The system employs a multi-agent workflow architecture where specialized AI agents collaborate to analyze market-moving events in real-time.

๐ŸŽฏ Core Concept

The system leverages Large Language Models' natural language processing capabilities to rapidly analyze news, social media, and other textual data sources that often trigger market volatility. By processing these events faster than traditional methods, TradingGoose identifies potential market movements and generates timely trading signals for user-selected stocks.

๐Ÿ”„ Intelligent Execution

Once analysis agents provide their recommendations, the Portfolio Manager AI agent takes over to:

  • Analyze the user's Alpaca account details and current portfolio state
  • Consider user-configured position sizing, allocation strategies, and risk tolerance
  • Generate final trading orders with precise values and actions for specific tickers
  • Make autonomous decisions that may differ from initial recommendations based on actual portfolio constraints and risk management

This two-layer approach ensures that while the analysis agents focus on identifying opportunities, the portfolio manager maintains discipline in execution, potentially overriding recommendations when they conflict with portfolio health, risk limits, or allocation rules.

๐Ÿ—๏ธ Architecture Foundation

This project's multi-agent analysis workflow architecture is based on the TauricResearch/TradingAgents framework, which pioneered the concept of collaborative AI agents for financial analysis.

๐Ÿ› ๏ธ Tech Stack

๐ŸŽจ Frontend

  • React 18 with TypeScript
  • Vite for fast development and building
  • TailwindCSS for styling
  • Shadcn/ui component library
  • React Router for navigation
  • Recharts for data visualization

โš™๏ธ Backend

  • Supabase for database, authentication, and real-time updates
  • Edge Functions for serverless API endpoints & running workflow in background
  • PostgreSQL for data persistence
  • Row Level Security (RLS) for data isolation

๐Ÿ“ˆ Trading Integration

  • Alpaca Markets API for market data and trade execution
  • Customizable AI Providers for agent intelligence (OpenAI, Anthropic, Google, and more)


๐Ÿ”„ How It Works

๐Ÿ”ฌ The Analysis Process

When you initiate a stock analysis, TradingGoose orchestrates a sophisticated multi-agent workflow:

Analysis Flow
Note: This workflow architecture is adapted from the TauricResearch/TradingAgents framework.
1. ๐Ÿ“Š Data Analysis Phase
  • ๐ŸŒ Macro Analyst: Government data and economic indicators
  • ๐Ÿ“ˆ Market Analyst: Historical data and technical indicators
  • ๐Ÿ“ฐ News Analyst: Latest news and sentiment analysis
  • ๐Ÿ’ฌ Social Media Analyst: Social platform trends and impact
  • ๐Ÿ’ฐ Fundamentals Analyst: Financial statements and profitability
2. ๐Ÿ” Research & Debate Phase
  • ๐Ÿ‚ Bull Researcher agent presents positive evidence and growth potential
  • ๐Ÿป Bear Researcher agent identifies risks and presents cautionary analysis
  • โš–๏ธ Both perspectives are rigorously evaluated for balance
3. โš ๏ธ Risk Assessment Phase
  • Three specialized risk agents analyze from different perspectives:
    • ๐Ÿ›ก๏ธ Safe Agent: Conservative approach focusing on capital preservation
    • โš–๏ธ Neutral Agent: Balanced view weighing opportunities against risks
    • ๐Ÿš€ Risky Agent: Aggressive stance for high-growth potential
4. ๐Ÿงฉ Decision Synthesis
  • ๐Ÿ“‹ Research Manager consolidates all agent insights
  • ๐ŸŽฏ Risk Manager combines analyses with defined risk parameters
  • ๐Ÿ’ผ Portfolio Manager evaluates position sizing and portfolio impact
5. โœ… Execution Ready
  • ๐Ÿ“Š Final recommendations are presented with confidence scores
  • ๐Ÿšฆ Trade signals are generated based on collective intelligence
  • ๐Ÿ“ All analysis is logged for historical tracking



๐Ÿš€ Usage

๐Ÿ” Running an Analysis

  1. Navigate to the Dashboard
  2. Enter a stock ticker in the search bar
  3. Click "Analyze" to trigger the multi-agent workflow
  4. Monitor progress in real-time through the workflow visualization
  5. Review comprehensive insights from all agents

๐Ÿ“„ License

This project is licensed under the AGPL-3.0 License - see the LICENSE file for details.

๐Ÿ’ฌ Support

For issues, questions, or suggestions:

  • Open an issue on GitHub
  • Join our Discord community for support and discussions! ๐ŸŽฎ

๐Ÿš€ Self Deployment

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • A Supabase account (free tier available)
  • Perplefina (AI-powered search API) - See setup instructions below

Perplefina Setup

Perplefina is a required component that provides AI-powered web search capabilities for the trading agents.

  1. Clone and Install Perplefina

    # Clone the Perplefina repository
    git clone https://github.com/Trading-Goose/Perplefina.git
    cd Perplefina
    
    # Install dependencies
    npm install
  2. Configure Perplefina

    • Follow the setup instructions in the Perplefina repository
    • Configure your AI provider API keys (OpenAI, Anthropic, etc.)
    • Set up your search provider credentials
  3. Deploy Perplefina

    Since Supabase edge functions need to access Perplefina from the internet, you must deploy it publicly:

    ** Deploy to a Cloud Service**

    • Deploy to Railway, Render, Heroku, or any cloud platform
    • Follow the deployment instructions in the Perplefina repository
    • Note your public URL (e.g., https://your-perplefina.railway.app)

Backend Setup

  1. Create a Supabase Project

    • Go to Supabase and create a new project
    • Note your project URL, anon key, and access token for later use
    • To get your access token:
      • Go to your Supabase project settings
      • Navigate to API settings
      • Find your service role key (this will be used as the access token)
  2. Set up Database Schema

    • Navigate to the supabase directory in this project
    • Copy the contents of schema.sql
    • In your Supabase project dashboard, go to the SQL Editor
    • Paste the schema.sql content into the editor
    • Run the SQL script to create all necessary functions, tables, and rows
  3. Configure Edge Function Secrets

    Option A: Via Supabase Web Interface (Recommended)

    • Go to your Supabase Dashboard
    • Select your project
    • Navigate to Settings โ†’ Edge Functions
    • Click on the Secrets tab
    • Click + Add new secret
    • Add the following secret:
      • Name: PERPLEFINA_API_URL
      • Value: Your Perplexica API endpoint (must be publicly accessible from the internet)
      • Name: FUNCTION_ACCESS_TOKEN
      • Value: JWT service role key copied from project API settings tab
    • Click Save

    Important: The Perplexica URL must be publicly accessible from the internet. Supabase edge functions cannot access localhost or private network addresses. You need to either:

    • Deploy Perplexica to a cloud service (e.g., Railway, Render, Heroku)
    • Use a tunneling service like ngrok for testing (e.g., https://your-id.ngrok.io)
    • Host it on a server with a public IP address

    Option B: Via Supabase CLI

    • If you prefer using the command line:
      # First, install Supabase CLI if you haven't already
      npm install -g supabase
      
      # Login to Supabase
      supabase login
      
      # Link to your project (you'll need your project ref from Supabase dashboard)
      supabase link --project-ref your-project-ref
      
      # Set the Perplexica API URL secret (must be publicly accessible)
      supabase secrets set PERPLEFINA_API_URL=https://your-public-perplexica-url.com
  4. Deploy Edge Functions

    • Set up your Supabase access token:
      export SUPABASE_ACCESS_TOKEN=your-access-token-here
    • Deploy the edge functions:
      cd ./Open-TradingGoose
      bash ./deploy-functions.sh
    • This will deploy all necessary edge functions for the multi-agent workflow
  5. Configure Environment Variables

    • Copy .env.example to .env.local:
      cp .env.example .env.local
    • Edit .env.local and update the Supabase-related variables:
      • VITE_SUPABASE_URL: Your Supabase project URL
      • VITE_SUPABASE_ANON_KEY: Your Supabase anon key
      • Add any other required API keys as needed

Frontend Setup

  1. Install Dependencies

    npm install
  2. Build the Project

    npm run build
  3. Start the Application

    npm run start

Development Mode

For development with hot reload:

npm run dev

The application will be available at http://localhost:8080 (or the port shown in your terminal).

๐Ÿšง Development

๐ŸŽ‰ No humans were harmed in the making of this application!

This entire project was crafted with love by Claude Code - every single line of code, from the sleekest UI component to the smartest trading algorithm, was written by AI. Zero human-written code, 100% AI magic! ๐Ÿช„

Who says robots can't be creative? This production-ready financial platform proves that AI can build sophisticated applications that actually work in the real world. Welcome to the future of software development! ๐Ÿš€



โœ… Feature Checklist

Analysis Features

  • Multi-stock concurrent analysis
  • Cancel/delete running analysis
  • Retry failed analysis from specific failed agent
  • Reactivate stale/stuck analysis workflows
  • Real-time workflow visualization with progress tracking
  • Historical analysis tracking and audit trail

Portfolio Management

  • Position size configuration (min/max)
  • Multi-stock portfolio monitoring

Trading Features

  • Paper trading mode for testing
  • Live trading execution via Alpaca
  • Real-time order status tracking
  • Position management and monitoring

AI Configuration

  • Multiple AI provider support (OpenAI, Anthropic/Claude, Google, DeepSeek)
  • Custom max tokens configuration per agent
  • Provider failover and retry logic
  • Model selection flexibility

Data & Analysis

  • Historical data range selection
  • Custom analysis timeframes
  • Technical indicator calculations
  • Fundamental data integration
  • News sentiment analysis
  • Social media trend tracking

User Management

  • User Acount system
  • API key management interface
  • User activity tracking
  • Secure credential storage

๐Ÿ™ Acknowledgments


Important: Always conduct your own research and consider consulting with a financial advisor before making investment decisions. Past performance does not guarantee future results.

About

Open source LLM stock analysis & trade action execution system built with Supabase & Alpaca API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published