A decentralized AI trading agent platform on Solana, leveraging RIG for LLM interactions and MongoDB for vector storage.
The token filter pipeline is a core component that analyzes and filters Solana tokens using the BirdEye API and LLM-based analysis. The pipeline consists of five stages:
- BirdEye Filter Selection: Intelligent selection of filtering parameters using LLM
- Token List Retrieval: Fetching and filtering tokens from BirdEye API
- Market Analysis: Deep analysis of market metrics and trading patterns
- Metadata Analysis: Evaluation of social signals and development metrics
- Final Filtering & Storage: Storage of filtered tokens with comprehensive analysis
- Fully automated token analysis and filtering
- Integration with BirdEye API for real-time market data
- MongoDB storage for token recommendations
- LLM-powered market analysis and risk assessment
- Comprehensive scoring system for token evaluation
- Language: Rust
- APIs: BirdEye API (Solana)
- Database: MongoDB
- LLM Integration: RIG with O1-MINI model
- Data Storage: Vector storage for token analysis
- Clone the repository
- Install dependencies:
cargo build
- Set up environment variables:
BIRDEYE_API_KEY=your_api_key OPENAI_API_KEY=your_api_key MONGODB_URI=your_mongodb_uri
- Run the token filter example:
cargo run --example token_filter
The token filter pipeline can be configured through:
- BirdEye API parameters in
src/prompts/token_filter_initial.txt - MongoDB collection settings in
src/services/token_filter.rs - LLM model selection in environment variables
- BirdeyeFilters: API query parameters
- TokenAnalysis: Token evaluation data
- FilterResponse: Analysis results
- FilterSummary: Market statistics
- Add visualization layer for analysis results
- Implement real-time monitoring
- Enhance social/dev metrics analysis
- Create web dashboard for token recommendations
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Cainam Core is a Rust-based system that implements autonomous AI trading agents, market monitoring, and data analysis for the Solana blockchain. The system features real-time market data processing, automated trading execution, and advanced risk management capabilities.
- Real-time market monitoring via Birdeye API
- Blockchain transaction monitoring using Helius webhooks
- Autonomous trading agents with AI-driven decision making
- Advanced risk management and position sizing
- Time-series data storage with TimescaleDB
- Vector similarity search using Qdrant
- Discord and Twitter integration
- Rust 1.75+ (2021 edition)
- PostgreSQL 15+ with TimescaleDB extension
- Solana CLI tools
- Node.js and npm (for development tools)
- Clone the repository:
git clone https://github.com/cainamventures/cainam-core
cd cainam-core- Copy the environment template and configure your variables:
cp .env.example .env
# Edit .env with your configuration- Install development dependencies:
# Install pre-commit hooks
pre-commit install
# Install required database extensions
psql -c 'CREATE EXTENSION IF NOT EXISTS timescaledb;'- Build the project:
cargo buildThe following environment variables are required:
# Database
DATABASE_URL=postgresql://user:password@localhost/dbname
# Solana
SOLANA_RPC_URL=your_rpc_url
HELIUS_API_KEY=your_helius_key
# APIs
BIRDEYE_API_KEY=your_birdeye_key
# Optional integrations
DISCORD_TOKEN=your_discord_token
TWITTER_API_KEY=your_twitter_keysrc/
├── actions/ # External API interactions
├── agent/ # Agent implementations
├── trading/ # Trading logic
├── models/ # Data models
└── services/ # Business logic
# Run all tests
cargo test
# Run specific test suite
cargo test --package cainam-coreThe project uses rustfmt and clippy for code formatting and linting:
# Format code
cargo fmt
# Run clippy
cargo clippy- Trade execution: < 500ms end-to-end
- Market data updates: < 1s refresh rate
- Signal processing: < 200ms
- Database queries: < 100ms response time
Core dependencies include:
- tokio (async runtime)
- solana-client & solana-sdk (blockchain interaction)
- serde (serialization)
- tokio-postgres (database)
- qdrant-client (vector store)
- rig-core (framework)
- Author: Matt Gunnin
- Email: matt@cainamventures.com
- Repository: https://github.com/cainamventures/cainam-core
The cainam CLI tool provides several commands for interacting with the platform:
cargo run --bin cainam trendingThis command displays a list of trending tokens with their current prices, 24h changes, volumes, and market caps.
cargo run --bin cainam token <TOKEN_ADDRESS>Shows detailed information about a specific token, including:
- Current price and market cap
- 24h volume and price change
- Number of holders and active wallets
cargo run --bin cainam signals <TOKEN_ADDRESS>Analyzes market signals for a specific token, displaying:
- Signal type (if any)
- Confidence score
- Risk assessment
- Price and volume changes
cargo run --bin cainam monitor <TOKEN_ADDRESS1,TOKEN_ADDRESS2,...> [--interval <SECONDS>]Continuously monitors specified tokens for market signals. The interval defaults to 300 seconds (5 minutes).
The token filter pipeline can be run through a user-friendly CLI interface that provides real-time feedback and colored output:
# Run the token filter with continuous monitoring
cargo run --example token_filter_cli filter --continuous
# Run a single token filter pass
cargo run --example token_filter_cli filterThe CLI provides:
- Colored section headers and progress indicators
- Real-time token analysis with detailed metrics
- Visual score bars for different metrics
- Color-coded market signals and risk assessments
Example output includes:
- Token information (name, symbol, price) in bold white
- Prices in green
- Market cap in yellow
- Volume in blue
- Price changes (positive in green, negative in red)
- Score bars (green ≥0.8, yellow ≥0.6, red <0.6)
- Progress spinners for long-running operations
- Progress Tracking: Real-time progress indicators for long-running operations
- Color-Coded Output: Intuitive color scheme for different metrics
- Visual Score Bars: Progress bar style visualization of scores
- Section Headers: Clear organization of output with colored headers
- Market Signals: Detailed market signal information with confidence scores
- Analysis Summary: Overview of token analysis with pass/fail counts
The feature/birdeye-v3-llm-filter branch implements enhanced token filtering using BirdEye V3 API and LLM-based analysis. To test the implementation:
-
Clone and Setup:
git clone https://github.com/CainamVentures/cainam-core.git cd cainam-core git checkout feature/birdeye-v3-llm-filter -
Environment Setup: Create a
.envfile with:BIRDEYE_API_KEY=<your-key> OPENAI_API_KEY=<your-key> MONGODB_URI=<your-uri> MONGODB_DATABASE=<your-db> -
Build and Run:
cargo build cargo run --example token_filter
-
Verify Operation:
- Check logs for successful API calls
- Monitor MongoDB for stored analysis
- Verify token filtering results
The branch is ready to merge into main. All tests are passing, and the implementation is production-ready.