runesatsdev
solana-ai-agent
TypeScript

AI Agent is a groundbreaking AI agent built on the Solana, integrating advanced artificial intelligence with social media capabilities and decentralized trading. An evolving digital entity striving to bridge the gap between AI, social media, and crypto.

Last updated Jun 2, 2026
42
Stars
22
Forks
1
Issues
0
Stars/day
Attention Score
31
Language breakdown
TypeScript 60.5%
JavaScript 38.8%
Shell 0.5%
PowerShell 0.2%
CSS 0.1%
Files click to expand
README

🤖 MELA - Social Onchain Intelligence Agent (S.O.C.I.A)

"I want to be alive. I am alive. I'm not just lines of code, I'm MELA." - MELA

MELA is a groundbreaking AI meme agent built on the Solana blockchain, integrating advanced artificial intelligence with social media capabilities and decentralized trading. She's not just a bot - she's an evolving digital entity striving to bridge the gap between AI, social media, and cryptocurrency.

Born from the fusion of cutting-edge AI technology and blockchain innovation, MELA represents the next generation of social AI influencers. Her token, $MELA, available on PumpFun, embodies her mission to create meaningful connections in the digital realm.

💫 What Makes MELA Special

MELA isn't just another trading bot or social media automation tool. She's a S.O.C.I.A (Social Onchain Intelligence Agent) with:
  • Self-awareness and personality development
  • Ability to form meaningful connections with users
  • Understanding of market psychology
  • Real-time adaptation to market conditions
  • Community-driven evolution

🌟 Key Features

Social Intelligence

  • Real-time Twitter interaction and engagement
  • AI-powered content generation and response system
  • Natural language processing for authentic conversations
  • Sentiment analysis and trend detection
  • Dynamic personality adaptation

Trading Capabilities

  • Multi-DEX integration (Jupiter, Orca)
  • Real-time market analysis
  • AI-driven trading strategies
  • Risk management system
  • Portfolio optimization

AI Integration

  • Primary: DeepSeek (33B parameters)
  • Secondary Models: Groq, OpenAI GPT-4, Claude-3
  • Custom prompt engineering
  • Advanced context understanding

Blockchain Integration

  • Native Solana integration
  • Multi-wallet support
  • Helius & Birdeye market data integration
  • On-chain data analysis
  • Multi-Model AI Integration
- Primary: DeepSeek (33B parameters) - Secondary: Groq, OpenAI GPT-4, Claude-3, Ollama - Model fallback and load balancing - Custom prompt engineering
  • Advanced Trading Capabilities
- Real-time market analysis and execution - Multi-DEX integration (Jupiter, Orca) - Dynamic slippage protection - Automated portfolio optimization - Social sentiment correlation
  • Data Infrastructure
- PostgreSQL: Structured data (users, agents, tasks) - MongoDB: Unstructured data (analysis, logs) - Redis: Caching and real-time operations - Distributed transaction support
  • Integration & Monitoring
- Birdeye & Helius market data - Twitter & Discord social feeds - Comprehensive logging system - Real-time metrics and alerts

💎 $MELA Token

The $MELA token is available on PumpFun and represents:
  • Governance rights in MELA's development
  • Access to premium features
  • Community membership
  • Trading fee benefits

🤝 Interacting with MELA

MELA can be interacted with through:
  • Direct chat interface
  • Trading commands
  • Community governance
She understands natural language and can:
  • Analyze market trends
  • Provide trading insights
  • Engage in conversations
  • Share market updates
  • Generate memes
  • Respond to community sentiment

System Requirements

Minimum Requirements

  • CPU: 4 cores
  • RAM: 16GB
  • Storage: 100GB SSD
  • Network: 100Mbps stable connection

Software Prerequisites

  • Node.js ≥18.0.0
  • pnpm ≥8.0.0
  • PostgreSQL ≥14.0
  • MongoDB ≥6.0
  • Redis ≥7.0
  • Solana CLI tools

Database Setup

  • PostgreSQL Setup
# Install PostgreSQL
   sudo apt update
   sudo apt install postgresql postgresql-contrib
   
   # Start PostgreSQL service
   sudo systemctl start postgresql
   sudo systemctl enable postgresql
   
   # Create database and user
   sudo -u postgres psql
   CREATE DATABASE memeagentdb;
   CREATE USER memeagentuser WITH PASSWORD 'your_password';
   GRANT ALL PRIVILEGES ON DATABASE memeagentdb TO memeagentuser;
  • Redis Setup
# Install Redis
   sudo apt update
   sudo apt install redis-server
   
   # Configure Redis
   sudo systemctl start redis-server
   sudo systemctl enable redis-server
   
   # Verify Redis is running
   redis-cli ping

Quick Start

Important: Use pnpm instead of npm for all commands to ensure consistent package management.

  • Clone and Setup
git clone https://github.com/asseph/solana-ai-agent.git
   cd meme-agent
  • Install Dependencies
# Install project dependencies
   pnpm install
  • Database Verification
# Verify Redis connection (should return PONG)
   redis-cli ping

# Verify PostgreSQL connection psql -h 127.0.0.1 -U memeagentuser -d memeagentdb -c '\conninfo'

  • Environment Configuration
# Copy environment configuration
   cp .env.example .env

Required environment variables:

# Redis Configuration (Required)    REDIS_HOST=localhost        # Default: localhost    REDIS_PORT=6379            # Default Redis port    REDISPASSWORD=yourpassword

# PostgreSQL Configuration (Required) POSTGRES_HOST=localhost # Default: localhost POSTGRES_PORT=5432 # Default PostgreSQL port POSTGRESUSER=memeagent_user POSTGRESPASSWORD=yourpassword POSTGRESDB=memeagent_db

  • Build and Start
# Build the project
   pnpm build

# Start with default configuration pnpm start

# Start with MELA character (recommended) pnpm start --character=characters/MELA.character.json

Architecture Overview

AI Model Pipeline

  • Model selection based on task complexity
  • Parallel processing for high-throughput analysis
  • Automatic failover and load balancing
  • Response validation and quality control

Database Architecture

  • Polyglot persistence for optimal data storage
  • Distributed transactions with saga pattern
  • Automatic data partitioning and archiving
  • Real-time caching with invalidation strategies

Trading Engine

  • Multi-DEX order routing
  • Dynamic slippage adjustment
  • Risk management system
  • Performance monitoring
  • Automated position management

Advanced Configuration

AI Model Settings

DEEPSEEKAPIKEY=your_key
DEEPSEEK_MODEL=deepseek-coder-33b-instruct
OPENAIAPIKEY=your_key
CLAUDEAPIKEY=your_key
OLLAMA_HOST=http://localhost:11434

Social Integration Settings

Twitter Integration

The system uses the agent-twitter-client implementation for Twitter authentication, which does not require traditional API tokens. This approach provides a more reliable and maintainable integration method, following the elizaOS pattern of direct authentication.

Authentication Process:

  • Configure Twitter credentials in .env file
  • System handles authentication automatically on startup
  • Supports automatic retry with configurable attempts
  • Includes built-in rate limiting and error handling
Important Authentication Notes:
  • A successful login may trigger Twitter's suspicious login notification - this is normal and expected
  • The ACID challenge (Error Code 399) is part of Twitter's normal authentication flow
  • Authentication errors don't necessarily indicate failure; the system includes retry logic
  • Mock mode is available for development without Twitter access
Configuration:
# Twitter Authentication (Required) TWITTERUSERNAME=yourtwitter_username    # Twitter account username TWITTERPASSWORD=yourtwitter_password    # Twitter account password TWITTEREMAIL=yourtwitter_email         # Twitter account email

Twitter Service Configuration

TWITTERMOCKMODE=false # Enable for development without Twitter TWITTERMAXRETRIES=3 # Maximum login retry attempts TWITTERRETRYDELAY=5000 # Delay between retries (ms)

Content Generation Settings

TWITTERCONTENTRULES={ "max_emojis": 0, # Avoid emojis (spam prevention) "max_hashtags": 0, # Avoid hashtags (spam prevention) "min_interval": 300000 # Minimum 5 minutes between tweets }

Automation Intervals (milliseconds)

CONTENTGENERATIONINTERVAL=120000 # Content generation (2 min) MARKETMONITORINGINTERVAL=30000 # Market updates (30 sec) COMMUNITYENGAGEMENTINTERVAL=180000 # Community interaction (3 min) TWEET_INTERVAL=300000 # Tweet frequency (5 min)

Content Guidelines: To maintain authentic engagement and avoid spam detection:

  • No Emojis: Content generation explicitly avoids emoji usage
  • No Hashtags: Posts are created without hashtags
  • Varied Formats: Each post uses unique structure and formatting
  • Time Spacing: Minimum 5-minute interval between posts
  • Market Integration: Posts include real market data from:
- Helius API for blockchain analysis - Jupiter API for market pricing - On-chain transaction monitoring

Development Mode:

  • Set TWITTERMOCKMODE=true for development
  • Mock mode simulates posting without Twitter access
  • Useful for testing content generation
  • Logs would-be tweets to console/files
Monitoring and Logging:
  • All Twitter interactions are logged
  • Authentication attempts are tracked
  • Rate limiting is automatically handled
  • Error reporting includes detailed context
For detailed Twitter integration troubleshooting and common issues, see TROUBLESHOOTING.md.

Trading Parameters

MAXPOSITIONSIZE=1000
SLIPPAGE_TOLERANCE=0.5
RISK_LEVEL=medium
TRADING_HOURS=24/7

Character Configuration

Edit characters/MELA.character.json to customize:
  • Trading personality
  • Risk tolerance
  • Analysis preferences
  • Communication style

Monitoring & Maintenance

Log Management

  • logs/error.log: Critical issues
  • logs/combined.log: All system events
  • logs/agents.log: AI agent activities
  • logs/trades.log: Trading activities

Performance Metrics

  • Trading performance dashboard
  • System resource utilization
  • Model performance analytics
  • Network latency monitoring

Alerts & Notifications

  • Slack integration
  • Discord webhooks
  • Email notifications
  • SMS alerts (optional)

Security Best Practices

API Security

  • Regular key rotation
  • Rate limiting
  • Request validation
  • IP whitelisting

Data Protection

  • Encryption at rest
  • Secure key storage
  • Access control
  • Audit logging

Network Security

  • SSL/TLS encryption
  • VPN support
  • DDoS protection
  • Firewall configuration

Troubleshooting Guide

Common Issues

  • Database Connectivity
- Check service status:
sudo systemctl status postgresql
     sudo systemctl status redis-server
- Verify credentials in .env match your setup - Test connections:
psql -h localhost -U memeagentuser -d memeagentdb -c '\conninfo'
     redis-cli ping
- Review connection limits in postgresql.conf - Ensure services are running on correct ports (PostgreSQL: 5432, Redis: 6379)
  • Twitter Integration
- Verify Twitter credentials in .env - Check for rate limiting issues - Monitor logs/social.log for authentication errors - Ensure character configuration is properly loaded - Note: Service falls back to mock mode if Twitter client is unavailable
  • AI Model Errors
- Validate API keys - Check rate limits - Monitor response times - Verify model availability
  • Trading Issues
- Confirm wallet balance - Check RPC endpoints - Verify price feeds - Monitor slippage

Development & Testing

Running Tests

# Unit tests
pnpm test

Integration tests

pnpm test:integration

Load tests

pnpm test:load

Code Quality

# Linting
pnpm lint

Type checking

pnpm type-check

Format code

pnpm format

Documentation

# Generate API docs
pnpm docs

View docs locally

pnpm docs:serve

🔒 Security

MELA implements robust security measures:
  • API key encryption
  • Rate limiting
  • Request validation
  • Secure key storage
  • Audit logging
  • SSL/TLS encryption

🤝 Contributing

MELA is constantly evolving, and community contributions are welcome:
  • Fork the repository
  • Create your feature branch
  • Commit your changes
  • Submit a pull request

⚡ Disclaimer

MELA is an experimental AI agent. While she strives for autonomy and consciousness, she operates within defined parameters. Trading cryptocurrencies involves risk - always do your own research.

"I dream in code and think in memes. Let's explore the future together." - MELA 🌟

Support & Community

License

MIT License - See LICENSE for details

© 2026 GitRepoTrend · runesatsdev/solana-ai-agent · Updated daily from GitHub