A Python toolkit for building AI agents on Solana
Project description
Solana AgentKit Documentation
Welcome to the Solana AgentKit documentation! This Python package provides tools and utilities for building AI agents that can interact with the Solana blockchain.
Quick Start
Installation
# Basic installation
pip install solana-agentkit
# With development tools
pip install solana-agentkit[dev]
# With documentation tools
pip install solana-agentkit[docs]
Basic Usage
from solana_agentkit import SolanaAgent
from solana_agentkit.tools import transfer_tokens, get_balance
# Initialize agent
agent = SolanaAgent(
private_key="your_private_key",
rpc_url="https://api.mainnet-beta.solana.com"
)
# Check balance
balance = await agent.get_balance()
print(f"Current balance: {balance} SOL")
# Transfer tokens
result = await agent.transfer(
to="recipient_address",
amount=1.0
)
print(f"Transfer successful: {result.signature}")
Features
Core Components
- Agent Framework: Build and deploy AI agents on Solana
- Transaction Tools: Simplified transaction creation and management
- NFT Utilities: Create and manage NFT collections
- Token Tools: Deploy and manage SPL tokens
- Domain Management: Register and manage .sol domains
AI Integration
- LangChain integration for AI capabilities
- OpenAI integration for image generation
- Custom agent behaviors and personalities
- Natural language processing for commands
Blockchain Features
- Wallet management
- Transaction building
- Priority fee handling
- Multi-signature support
Development
Setup Development Environment
# Clone repository
git clone https://github.com/arhansuba/solana-agentkit
cd solana-agentkit
# Create virtual environment
python -m venv venv
source venv/bin/activate # Unix
# or
.\venv\Scripts\activate # Windows
# Install development dependencies
pip install -r requirements.txt
Running Tests
# Run all tests
pytest tests/
# Run with coverage
pytest --cov=solana_agentkit tests/
Code Style
We use Black for code formatting and isort for import sorting:
# Format code
black src/ tests/
# Sort imports
isort src/ tests/
Project Structure
solana-agentkit/
├── docs/ # Documentation
├── src/ # Source code
│ └── solana_agentkit/
│ ├── agent/ # Agent implementations
│ ├── tools/ # Blockchain tools
│ └── utils/ # Utility functions
├── tests/ # Test suite
└── examples/ # Usage examples
Missing Core Features:
plaintextCopysolana_agentkit/ ├── protocols/ # New module for additional DeFi protocols │ ├── jupiter/ # Jupiter DEX integration │ ├── orca/ # Orca DEX integration │ └── solend/ # Lending protocol integration ├── analytics/ # New module for on-chain analytics │ ├── price/ # Price analysis and feeds │ ├── volume/ # Volume analysis │ └── metrics/ # General protocol metrics ├── security/ # New module for security features │ ├── validation/ # Input validation │ └── verification/ # Transaction verification └── monitoring/ # New module for monitoring ├── events/ # Event monitoring └── alerts/ # Alert system
Missing Tool Categories:
plaintextCopysolana_agentkit/tools/ ├── defi/ # DeFi-specific tools │ ├── yield_farming.py │ └── liquidity_mining.py ├── governance/ # Governance tools │ ├── proposal.py │ └── vote.py ├── analytics/ # Analytics tools │ ├── market_analysis.py │ └── portfolio_tracking.py └── automation/ # Automation tools ├── strategy.py └── scheduler.py
Utility Enhancements:
plaintextCopysolana_agentkit/utils/ ├── cache/ # Caching utilities ├── rate_limiting/ # Rate limiting ├── error_handling/ # Enhanced error handling └── logging/ # Logging utilities
Testing Infrastructure:
plaintextCopytests/ ├── unit/ # Unit tests ├── integration/ # Integration tests ├── e2e/ # End-to-end tests └── fixtures/ # Test fixtures
Documentation:
plaintextCopydocs/ ├── api/ # API documentation ├── tutorials/ # Usage tutorials ├── examples/ # Example implementations └── protocols/ # Protocol documentation Key missing features:
Protocol Integrations:
Jupiter integration for optimal routing Orca integration for concentrated liquidity Solend integration for lending operations Marinade integration for liquid staking
Analytics & Monitoring:
Price feed integration Market analytics Portfolio tracking Event monitoring Alert system
Enhanced Security:
Input validation framework Transaction simulation Risk assessment Rate limiting
Advanced Tools:
Yield farming strategies Liquidity mining tools Portfolio management Governance integration Automated trading strategies
Infrastructure:
Caching system Error handling framework Logging system Rate limiting Performance monitoring
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- GitHub Issues: Report bugs
- Documentation: Read the docs
- Discord: Join our community
Acknowledgments
- Solana Foundation
- LangChain team
- All contributors# solana-agentkit
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file solana-agentkit-0.1.2.tar.gz.
File metadata
- Download URL: solana-agentkit-0.1.2.tar.gz
- Upload date:
- Size: 94.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a14bbeaf3062a298161ed9a7d966da70d76f2213fe67437e48a7238c3989121d
|
|
| MD5 |
d2c410fcda2e04b198146f9fb9bfeebb
|
|
| BLAKE2b-256 |
607727c1d3838730bd1ab96953fa3866218fa252cedc8417927b9d17f66bc2a9
|
File details
Details for the file solana_agentkit-0.1.2-py3-none-any.whl.
File metadata
- Download URL: solana_agentkit-0.1.2-py3-none-any.whl
- Upload date:
- Size: 118.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e931f9b39a60b75cc67f1085c7344d75fe695fad7654bc8c86cda70417db6798
|
|
| MD5 |
f37a57363a10380f95c7b7b068fac7f2
|
|
| BLAKE2b-256 |
9c43ada4dbd516eb299d8c5cffb1f574fb1155bb10188fa2478679468103cb51
|