Skip to content

MacCracken/BullShift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

55 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

BullShift Trading Platform

Platform Status License Build Status Security Coverage Version

๐Ÿš€ High-Performance Cross-Platform Trading Platform

Professional trading platform combining Rust performance with Flutter cross-platform capabilities. Built for sub-100ms execution with real trading at its core.


๐Ÿ—๏ธ Project Structure

bullshift/
โ”œโ”€โ”€ flutter/                    # Frontend application
โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”‚   โ”œโ”€โ”€ modules/           # Core modules
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ core_trading/  # ๐ŸŽฏ REAL TRADING (Core Module)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ trendsetter/   # Market analytics
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ bullrunnr/     # News sentiment
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ barely_managed/ # AI connector
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ paper_hands/   # Paper trading
โ”‚   โ”‚   โ”œโ”€โ”€ services/          # Backend services
โ”‚   โ”‚   โ””โ”€โ”€ widgets/           # UI components
โ”‚   โ””โ”€โ”€ pubspec.yaml
โ”œโ”€โ”€ rust/                      # Performance-critical backend
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ trading/          # ๐ŸŽฏ Real trading engine
โ”‚   โ”‚   โ”œโ”€โ”€ security/          # API key management
โ”‚   โ”‚   โ”œโ”€โ”€ data_stream/      # WebSocket streaming
โ”‚   โ”‚   โ””โ”€โ”€ ai_bridge/        # AI integration
โ”‚   โ””โ”€โ”€ Cargo.toml
โ””โ”€โ”€ docs/                      # Documentation

๐ŸŽฏ Core Modules Overview

BullShift consists of five integrated modules, each serving a specific trading function:

๐ŸŽฏ Core Trading Module (REAL TRADING)

The heart of BullShift, providing live trading capabilities:

โœ… Real Trading Features

  • Live Market Orders: Market, Limit, Stop, Stop-Limit orders
  • Real-time Position Management: Live P&L tracking
  • API Integration: Alpaca, Interactive Brokers, and more
  • Sub-100ms Execution: Rust-powered order routing
  • Risk Management: Position sizing, stop-loss automation
  • Trading Notes: Symbol-specific note-taking with tags

๐Ÿ”ง Trading Components

  • Order Execution Engine (rust/src/trading/execution.rs)
  • Portfolio Management (rust/src/trading/portfolio.rs)
  • API Integration Layer (rust/src/trading/api.rs)
  • Real-time Data Streaming (rust/src/data_stream/mod.rs)

๐Ÿ“ˆ TrendSetter Module (Market Analytics) โœ…

High-velocity asset discovery with momentum detection:

โœ… Market Analytics Features

  • Momentum Scanner: Real-time momentum scoring with volume spikes
  • Heat Map: Visual market heat indicators for trending assets
  • Shift Alerts: Automated alerts for volume spikes and momentum shifts
  • Social Sentiment Integration: Twitter/Reddit sentiment analysis
  • Multi-factor Scoring: Volume, price, and social sentiment combined

๐Ÿ”ง Analytics Components

  • Momentum Analysis Engine (rust/src/trendsetter/mod.rs)
  • Volume Spike Detection: Unusual volume pattern recognition
  • Price Momentum Calculations: SMA, RSI, MACD indicators
  • Social Buzz Tracking: Real-time social media sentiment

๐Ÿ“ฐ BullRunnr Module (News Sentiment) โœ…

Real-time financial news with NLP sentiment analysis:

โœ… News & Sentiment Features

  • Real-time News Feed: Multi-source news aggregation (Reuters, Bloomberg, etc.)
  • Instant Sentiment Tagging: Bullish/Bearish/Neutral classification
  • Market Sentiment Dashboard: Fear & Greed index, sector sentiment
  • News Search: Advanced search by keywords and symbols
  • Aspect-based Analysis: Revenue, earnings, growth sentiment breakdown

๐Ÿ”ง News Components

  • News Aggregation Engine (rust/src/bullrunnr/mod.rs)
  • NLP Sentiment Analyzer: VADER-based sentiment analysis
  • Multi-source Integration: Alpha Vantage, News API, Twitter
  • Real-time Processing: Sub-second news sentiment updates

๐Ÿค– BearlyManaged Module (AI Setup Connector) ๐Ÿšง

Intelligent automation middleware for AI integration:

๐Ÿšง AI Integration Features (In Progress)

  • AI Setup Wizard: Guided configuration for AI providers
  • Multi-LLM Support: OpenAI, Anthropic, local Ollama instances
  • Secure Credential Vault: Encrypted AI API key management
  • Strategy Prompting: Automated trading strategy generation
  • AI Bridge Architecture: LangChain integration layer

๐Ÿ”ง AI Components

  • AI Bridge Manager (rust/src/ai_bridge/mod.rs)
  • LLM Connector: Multi-provider AI interface
  • Strategy Generator: AI-powered trading strategy creation
  • Secure Key Management: Platform-native AI credential storage

๐ŸŽฎ PaperHands Module (Paper Trading) โœ…

Risk-free simulation environment for strategy testing:

โœ… Paper Trading Features

  • Zero-risk Simulation: Real-time price action testing
  • Strategy Backtesting: Historical performance analysis
  • Virtual Portfolio: Paper money position management
  • Performance Analytics: Win rate, P&L, risk metrics
  • Advanced Charting: Professional chart analysis with indicators
  • Monte Carlo Simulation: Risk analysis with multiple scenarios
  • Portfolio Analytics: Detailed performance and risk metrics
  • Strategy Validation: Test before real money deployment

๐Ÿ”ง Simulation Components

  • Paper Trading Engine (rust/src/paper_hands/mod.rs)
  • Advanced Charting: Multiple chart types and technical indicators
  • Performance Tracker: Detailed analytics and reporting
  • Monte Carlo Engine: Statistical risk analysis
  • Strategy Validator: Risk-free strategy testing

Rust Flutter Security Real-time

๐Ÿ› ๏ธ Technology Stack

Layer Technology Purpose
Frontend Flutter 4.0 Cross-platform UI
Core Logic Rust High-performance trading engine
Data Stream WebSockets/gRPC Real-time market data
Security AES-256 + Platform Keychain API key protection
Database ObjectBox Local historical data

๐Ÿ”’ Security Architecture

API Key Management

  • AES-256 Encryption for all stored credentials
  • Platform Native Storage: macOS Keychain, Linux libsecret
  • Secure Memory Management in Rust backend
  • Zero-Knowledge Architecture: Keys never stored in plaintext

Security Components

  • rust/src/security/mod.rs - Rust security manager
  • flutter/lib/services/security_manager.dart - Flutter security layer

๐Ÿš€ Quick Start

  1. Setup Environment - See Development Setup
  2. Build Platform - ./build.sh or manual build
  3. Configure APIs - Store trading/AI credentials securely
  4. Start Trading - Real-time order execution & analytics

Key Features:

  • ๐ŸŽฏ Live Trading - Sub-100ms order execution
  • ๐Ÿ“ˆ Market Analytics - Momentum detection & sentiment
  • ๐Ÿค– AI Integration - Strategy generation & analysis
  • ๐ŸŽฎ Paper Trading - Risk-free simulation
  • ๐Ÿ“ฑ Cross-Platform - Desktop + mobile apps

๐ŸŽฏ Features

Core Trading

  • Live market orders (Market, Limit, Stop, Stop-Limit)
  • Real-time position management & P&L tracking
  • Sub-100ms execution via Rust engine
  • API integration (Alpaca, Interactive Brokers)
  • Risk management & trading notes

Market Intelligence

  • Momentum scanner with volume spike detection
  • Real-time news sentiment analysis
  • Social sentiment integration (Twitter/Reddit)
  • Market heat maps & shift alerts

AI Integration

  • Multi-LLM support (OpenAI, Anthropic, Ollama)
  • AI-powered trading strategy generation
  • Secure credential vault
  • Custom prompt management

Paper Trading

  • Zero-risk simulation environment
  • Strategy backtesting & performance analytics
  • Virtual portfolio management
  • Monte Carlo risk analysis

Security

  • AES-256 encryption for all credentials
  • Platform native storage (macOS Keychain, Linux libsecret)
  • Zero-knowledge architecture
  • Secure FFI memory management

Cross-Platform

  • Desktop: Linux, macOS, Windows
  • Mobile: iOS, Android
  • Cloud sync across devices
  • Touch-optimized mobile interface

๐Ÿ”— API Integrations

Currently Supported

  • Alpaca Markets: Stocks and ETFs
  • Interactive Brokers: Global markets (planned)

API Integration Architecture

// Trading API trait
pub trait TradingApi {
    async fn submit_order(&self, order: ApiOrderRequest) -> Result<ApiOrderResponse, String>;
    async fn get_positions(&self) -> Result<Vec<ApiPosition>, String>;
    async fn get_account(&self) -> Result<ApiAccount, String>;
}

๐Ÿงช Development

Running Tests

# Rust tests
cd rust && cargo test

# Flutter tests
cd flutter && flutter test

Code Quality

# Rust formatting
cd rust && cargo fmt

# Flutter linting
cd flutter && flutter analyze

Flutter Rust Platforms Modules

๐Ÿ“‹ Status

โœ… Recently Fixed (Feb 2026)

  • 5 Critical compilation errors - Code now builds
  • Memory leaks in FFI trading engine
  • Security vulnerabilities - AES-256 encryption implemented
  • Code duplication - BaseProvider pattern created
  • View refactoring - BullRunnr & PaperHands modules extracted
  • Paper trading backend - Monte Carlo simulation & correlation analysis
  • Dialog implementations - All 6 AI provider dialogs completed
  • Test coverage - 108 new tests across 4 providers
  • Performance - Rust cloning optimizations

๐Ÿšง Remaining Work

  • AI Bridge Backend: 9 TODOs for Anthropic, Ollama, Local LLM, Custom providers
  • Data Streaming: Secure credential loading from storage
  • Testing: Increase coverage from 25% to 80%+
  • TODOs: 9 feature implementations remaining (AI Bridge backend)

๐Ÿ“Š Platform

  • 5 Modules: Trading, Analytics, News, AI, Paper Trading
  • Languages: Rust, Dart, Python
  • Platforms: Linux, macOS, Windows, iOS, Android
  • Status: Ready for development

Documentation

๐Ÿ“š Documentation

Documentation

User Documentation

Developer Documentation

Project Documentation


๐Ÿ“„ License

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


๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for detailed guidelines.

Quick Start:

  1. Fork the repository
  2. Create feature branch
  3. Follow security best practices
  4. Add tests
  5. Submit pull request

Security: All contributions require security review. See Security Policy for details.


๐ŸŽฏ Key Advantages

  • Performance - Sub-100ms execution via Rust engine
  • Security - AES-256 encryption, zero-knowledge architecture
  • Intelligence - AI-powered strategies & multi-factor analysis
  • Risk Management - Paper trading, position sizing, exposure monitoring
  • Cross-Platform - Seamless sync across desktop + mobile

Built with โค๏ธ for the modern quantitative trader

About

A Trading Tool

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages