Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Saina

Intelligent cryptocurrency trading through advanced AI orchestration

License: MIT Status: Active Development

Saina is an autonomous trading system that leverages multiple AI agents working in concert with real-time market data to identify opportunities and execute strategic positions in cryptocurrency markets. By combining cutting-edge machine learning with sophisticated market analysis, Saina delivers intelligent, data-driven trading decisions.


Table of Contents


Key Features

Market Intelligence

  • Real-time Analysis: Comprehensive monitoring of market movements and key indicators
  • Multi-timeframe Assessment: Analysis across multiple time horizons for robust signal generation
  • Sentiment Analysis: Integration of social media and news sentiment data

Predictive Analytics

  • Machine Learning Models: Advanced forecasting of price trends using historical and real-time data
  • Technical Indicators: Integration of dozens of technical analysis indicators
  • Pattern Recognition: Automated identification of chart patterns and market behaviors

Autonomous Trading

  • Intelligent Execution: Smart order routing and execution strategies
  • Dynamic Risk Management: Real-time position sizing and portfolio rebalancing
  • Stop-loss & Take-profit: Automated risk controls with adaptive thresholds

Data Integration

  • On-chain Metrics: Blockchain data analysis including wallet movements and network activity
  • Exchange Data: Real-time price feeds, order book depth, and trading volume
  • Alternative Data: News, social sentiment, and macroeconomic indicators

Architecture

Saina employs a distributed multi-agent architecture where specialized AI components collaborate through a sophisticated orchestration layer:

┌─────────────────────────────────────────────────────────┐
│                    Orchestration Layer                   │
│         (Agent Coordination & Decision Making)           │
└─────────────────────────────────────────────────────────┘
                            │
        ┌───────────────────┼───────────────────┐
        ▼                   ▼                   ▼
┌──────────────┐   ┌──────────────┐   ┌──────────────┐
│   Research   │   │     Risk     │   │  Execution   │
│    Agent     │   │   Manager    │   │    Agent     │
└──────────────┘   └──────────────┘   └──────────────┘
        │                   │                   │
        └───────────────────┴───────────────────┘
                            │
                ┌───────────┴───────────┐
                ▼                       ▼
        ┌──────────────┐       ┌──────────────┐
        │     Data     │       │   Trading    │
        │   Pipeline   │       │   Platform   │
        └──────────────┘       └──────────────┘

Agent Responsibilities

  • Research Agent: Market analysis, signal generation, and opportunity identification
  • Risk Manager: Position sizing, portfolio optimization, and risk assessment
  • Execution Agent: Trade execution, order management, and performance tracking
  • Orchestrator: Coordinates agent communication and manages the decision workflow

Technology Stack

Core Technologies

  • Language: Python 3.9+
  • AI Framework: LangChain / Custom multi-agent framework
  • LLM Providers: OpenAI, Anthropic, and other leading providers
  • Data Processing: Pandas, NumPy, TA-Lib

Infrastructure

  • Database: PostgreSQL for historical data, Redis for caching
  • Message Queue: RabbitMQ or Kafka for agent communication
  • API Integration: CCXT for exchange connectivity
  • Monitoring: Prometheus + Grafana for system metrics

Development Tools

  • Testing: pytest, unittest
  • Code Quality: black, flake8, mypy
  • Version Control: Git
  • CI/CD: GitHub Actions

Prerequisites

Before installing Saina, ensure you have the following:

  • Python: Version 3.9 or higher
  • pip: Python package manager
  • Git: For cloning the repository
  • API Keys:
    • OpenAI or Anthropic API key for LLM access
    • Exchange API keys (for live trading)
    • Market data provider API keys (optional)
  • System Requirements:
    • Minimum 4GB RAM
    • 10GB free disk space
    • Stable internet connection

Installation

1. Clone the Repository

git clone https://github.com/yourusername/saina.git
cd saina

2. Create Virtual Environment

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Install Development Dependencies (Optional)

pip install -r requirements-dev.txt

Configuration

1. Environment Variables

Create a .env file in the project root:

cp .env.example .env

Edit .env with your configuration:

# AI Provider Configuration
OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key

# Exchange API Keys
EXCHANGE_API_KEY=your_exchange_api_key
EXCHANGE_SECRET=your_exchange_secret

# Database Configuration
DATABASE_URL=postgresql://user:password@localhost:5432/saina
REDIS_URL=redis://localhost:6379

# Risk Management
MAX_POSITION_SIZE=0.1
MAX_PORTFOLIO_RISK=0.02
DEFAULT_STOP_LOSS=0.05

# Trading Configuration
TRADING_MODE=paper  # paper or live
DEFAULT_SYMBOL=BTC/USDT

2. Configuration Files

Customize config/settings.yaml for advanced configuration:

trading:
  mode: paper
  exchanges: [binance, coinbase]
  symbols: [BTC/USDT, ETH/USDT]

agents:
  research:
    update_interval: 300
    data_sources: [technical, sentiment, onchain]

  risk:
    max_drawdown: 0.15
    position_sizing: kelly_criterion

execution:
  order_type: limit
  slippage_tolerance: 0.001

Usage

Running in Paper Trading Mode

python main.py --mode paper

Running in Live Trading Mode

python main.py --mode live --symbols BTC/USDT,ETH/USDT

Running Specific Agents

# Research agent only
python main.py --agent research

# Risk management analysis
python main.py --agent risk --analyze-portfolio

Backtesting

python backtest.py --start 2024-01-01 --end 2024-12-31 --symbols BTC/USDT

Monitoring

Access the monitoring dashboard:

python dashboard.py
# Navigate to http://localhost:8080

Project Structure

saina/
├── agents/              # AI agent implementations
│   ├── research.py
│   ├── risk.py
│   ├── execution.py
│   └── orchestrator.py
├── config/              # Configuration files
│   ├── settings.yaml
│   └── exchanges.yaml
├── data/                # Data pipeline
│   ├── collectors/
│   ├── processors/
│   └── storage/
├── models/              # ML models and strategies
│   ├── predictive/
│   └── technical/
├── tests/               # Test suite
│   ├── unit/
│   └── integration/
├── utils/               # Utility functions
├── .env.example         # Example environment variables
├── .gitignore
├── main.py              # Main entry point
├── requirements.txt     # Python dependencies
└── README.md

Contributing

We welcome contributions from the community! Here's how you can help:

Getting Started

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature-name
  3. Make your changes
  4. Write tests for your changes
  5. Run the test suite: pytest
  6. Commit your changes: git commit -m "Add your feature"
  7. Push to your fork: git push origin feature/your-feature-name
  8. Open a Pull Request

Code Standards

  • Follow PEP 8 style guidelines
  • Write unit tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting PR

Areas for Contribution

  • New trading strategies
  • Additional data sources
  • Performance optimizations
  • Documentation improvements
  • Bug fixes and issue reports

Disclaimer

IMPORTANT: This software is provided for educational and research purposes only.

  • Cryptocurrency trading involves substantial risk of loss
  • Past performance does not guarantee future results
  • This is NOT financial advice
  • Use at your own risk
  • The authors and contributors assume no liability for financial losses
  • Always test thoroughly in paper trading mode before live deployment
  • Consult with a qualified financial advisor before making investment decisions

License

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


Contact


Built with by the Saina Team

About

AI-driven cryptocurrency trading platform leveraging multi-agent systems for market intelligence, predictive analysis, and autonomous trade execution

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors