Barnacle is a desktop-first analytics and strategy execution platform that bridges Flutter UI with Nautilus Trader's Python engine for algorithmic trading. This platform allows users to script, backtest, visualize, and deploy trading strategies with institutional-grade performance.
Barnacle follows a decoupled architecture with three main components:
┌─────────────────────────────────────────┐
│ Flutter Desktop (UI Layer) │
│ ├─ Glassmorphic Dashboard │
│ ├─ Scriptorium (Code Editor) │
│ ├─ Real-time Charts │
│ └─ Bot Monitoring │
└──────────────┬──────────────────────────┘
│ gRPC/Protobuf
┌──────────────▼──────────────────────────┐
│ Bridge (gRPC Server) │
│ ├─ Bidirectional Streaming │
│ └─ Real-time Event Propagation │
└──────────────┬──────────────────────────┘
│
┌──────────────▼──────────────────────────┐
│ Nautilus Trader Engine │
│ ├─ Backtest Engine │
│ ├─ Live Trading Engine │
│ ├─ Strategy Execution │
│ └─ Risk Management │
└─────────────────────────────────────────┘
- Full Python code editor with syntax highlighting
- Write custom Nautilus Trader strategies, indicators, and risk managers
- Real-time validation and error checking
- Code templates for common patterns
- Dark theme with semi-transparent panels
- Cyan/Purple neon accents inspired by the Crypto Trading Bots Dashboard
- Real-time bot status cards showing:
- Running status (Backtesting/Live/Paused)
- Current PnL (percentage and fiat)
- Uptime duration
- Trade count
- Equity curves and drawdown visualization
- Sharpe Ratio, Sortino Ratio, Profit Factor
- Trade distribution analysis
- Asset allocation charts
- Terminal-style output showing Nautilus logs
- Real-time trade executions
- Color-coded log levels (Info/Success/Warning/Error)
- Seamlessly move validated backtests to live trading
- Encrypted API key management
- Multi-exchange support (Binance, Kraken, IBKR)
barnacle/
├── barnacle_app/ # Flutter Desktop Application
│ ├── lib/
│ │ ├── main.dart # App entry point
│ │ ├── screens/ # UI screens
│ │ │ └── dashboard_screen.dart
│ │ ├── widgets/ # Reusable UI components
│ │ │ ├── glassmorphic_container.dart
│ │ │ ├── bot_status_card.dart
│ │ │ ├── performance_chart.dart
│ │ │ ├── log_console.dart
│ │ │ └── top_bar.dart
│ │ ├── providers/ # Riverpod state management
│ │ ├── models/ # Data models
│ │ └── services/ # gRPC client services
│ └── pubspec.yaml # Flutter dependencies
│
├── backend/ # Python Backend
│ ├── grpc_server/
│ │ └── server.py # gRPC server implementation
│ ├── controllers/
│ │ └── nautilus_controller.py # Nautilus Trader controller
│ ├── protos/
│ │ └── barnacle.proto # Protocol Buffer definitions
│ └── pyproject.toml # Python dependencies (managed by uv)
│
├── nt_strategies/ # Nautilus Trader Strategies
│ ├── lsp_strategy.py # Liquidity Sentiment Profile
│ └── backtest_pipeline.py # Backtesting framework
│
└── instructions.md # Project specifications
- Flutter 3.10.7 - Desktop UI framework (macOS/Windows/Linux)
- Riverpod - State management
- fl_chart - Performance charting
- flutter_code_editor - Python code editing
- gRPC - Communication with Python backend
- Google Fonts (Inter) - Typography
- Nautilus Trader - Trading engine
- gRPC & Protobuf - High-speed bidirectional communication
- asyncio - Asynchronous execution
- uv - Dependency management
- Glassmorphism - Frosted glass effect with blur
- Dark Mode - Primary theme
- Neon Accents - Cyan (#00F5FF) and Purple (#B857FF)
- Flutter SDK 3.10.7+
- Python 3.11+
- uv package manager
cd barnacle_app
# Install dependencies
flutter pub get
# Run on desktop
flutter run -d linux # or macos, windowscd backend
# Install dependencies with uv
uv pip install -e .
# Generate Protobuf code
python -m grpc_tools.protoc \
-I./protos \
--python_out=. \
--grpc_python_out=. \
./protos/barnacle.proto
# Start the gRPC server
python -m grpc_server.server- Flutter Desktop project bootstrapping
- Glassmorphic dashboard UI
- Bot status cards with real-time metrics
- Performance chart component
- Live console with log streaming
- Protocol Buffer definitions for gRPC
- Python gRPC server scaffolding
- Nautilus Trader controller
- Scriptorium code editor integration
- Riverpod state management for bot lifecycle
- Backtest execution with streaming progress
- gRPC client implementation in Flutter
- Real-time chart updates from backtest data
- Live trading hot-swap functionality
- Secure API key storage (flutter_secure_storage)
- Asset allocation radar chart
- Multi-strategy portfolio management
- Python environment bundling (PyInstaller)
- Cross-platform installers
The project includes several pre-built Nautilus Trader strategies:
- Entry based on Value Area breakouts/rejections
- Point of Control (PoC) interactions
- Sentiment confluence analysis
- Dynamic position sizing with risk management
Create a .env file in the backend directory:
# gRPC Server
GRPC_PORT=50051
GRPC_MAX_WORKERS=10
# Nautilus Trader
NAUTILUS_LOG_LEVEL=INFO
NAUTILUS_DATA_DIR=./data
# Exchange API Keys (encrypted)
BINANCE_API_KEY=your_key_here
BINANCE_API_SECRET=your_secret_hereContributions are welcome! Please follow the established code style and architecture patterns.
This project is licensed under the MIT License - see the LICENSE file for details.
- UI Design inspired by Crypto Trading Bots Dashboard
- Trading Engine: Nautilus Trader
- Built with Flutter and Python
Barnacle - Stick to your edge, execute with precision.