This comprehensive guide will walk you through installing AxiomTradeAPI-py, the most advanced Python SDK for Solana trading automation and Axiom Trade integration. Whether youβre building trading bots, DeFi automation tools, or market monitoring systems, this guide covers everything you need to know.
Our SDK automatically installs all necessary dependencies:
requests - HTTP client for REST API callswebsockets - Real-time WebSocket communicationasyncio - Asynchronous programming supporttyping - Type hints for better development experience# Install the latest stable version
pip install axiomtradeapi
# Verify installation
python -c "from axiomtradeapi import AxiomTradeClient; print('β
Installation successful!')"
# For developers who want to contribute or extend the library
pip install axiomtradeapi[dev]
# This includes additional tools for:
# - Testing frameworks
# - Code formatting
# - Documentation generation
# Create isolated environment for your trading bot project
python -m venv axiom_trading_env
# Activate virtual environment
# On Windows:
axiom_trading_env\Scripts\activate
# On macOS/Linux:
source axiom_trading_env/bin/activate
# Install AxiomTradeAPI-py
pip install axiomtradeapi
# Verify installation
python -c "from axiomtradeapi import AxiomTradeClient; print('π Ready to build Solana trading bots!')"
Perfect for production deployments and containerized trading systems:
# Dockerfile for Solana trading bot
FROM python:3.11-slim
WORKDIR /app
# Install AxiomTradeAPI-py
RUN pip install axiomtradeapi
# Copy your trading bot code
COPY . .
# Run your trading bot
CMD ["python", "your_trading_bot.py"]
# Build and run your containerized trading bot
docker build -t my-solana-bot .
docker run -d my-solana-bot
Get the cutting-edge features before theyβre released:
# Clone the repository
git clone https://github.com/chipa-tech/AxiomTradeAPI-py.git
cd AxiomTradeAPI-py
# Install in development mode
pip install -e .
# Run tests to ensure everything works
python -m pytest tests/
For maximum performance in trading applications:
# Install with performance optimizations
pip install axiomtradeapi[fast]
# This includes:
# - Optimized JSON parsing
# - Faster WebSocket libraries
# - Enhanced networking capabilities
For advanced market analysis and ML-based trading strategies:
# Install with machine learning capabilities
pip install axiomtradeapi[ml]
# Includes:
# - NumPy for numerical computing
# - Pandas for data analysis
# - Scikit-learn for ML algorithms
Create a configuration file for your trading bot:
# config.py - Basic setup for Solana trading bot
import logging
from axiomtradeapi import AxiomTradeClient
# Configure logging for production trading
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
handlers=[
logging.FileHandler('trading_bot.log'),
logging.StreamHandler()
]
)
# Initialize the client
client = AxiomTradeClient(log_level=logging.INFO)
# Verify connection
balance = client.GetBalance("BJBgjyDZx5FSsyJf6bFKVXuJV7DZY9PCSMSi5d9tcEVh")
print(f"β
Connection verified! Balance: {balance['sol']} SOL")
For WebSocket features and advanced functionality:
# secure_config.py - Production authentication setup
import os
from axiomtradeapi import AxiomTradeClient
# Store sensitive data in environment variables
AUTH_TOKEN = os.getenv('AXIOM_AUTH_TOKEN')
REFRESH_TOKEN = os.getenv('AXIOM_REFRESH_TOKEN')
# Initialize authenticated client
client = AxiomTradeClient(
auth_token=AUTH_TOKEN,
refresh_token=REFRESH_TOKEN,
log_level=logging.INFO
)
print("π Authenticated client ready for WebSocket trading!")
Save this as test_installation.py:
#!/usr/bin/env python3
"""
AxiomTradeAPI-py Installation Verification Script
Tests all core functionality to ensure proper installation
"""
import asyncio
import logging
from axiomtradeapi import AxiomTradeClient
async def test_installation():
"""Comprehensive installation test"""
print("π Testing AxiomTradeAPI-py Installation...")
print("=" * 50)
# Test 1: Basic import
try:
from axiomtradeapi import AxiomTradeClient
print("β
Import test: PASSED")
except ImportError as e:
print(f"β Import test: FAILED - {e}")
return False
# Test 2: Client initialization
try:
client = AxiomTradeClient(log_level=logging.WARNING)
print("β
Client initialization: PASSED")
except Exception as e:
print(f"β Client initialization: FAILED - {e}")
return False
# Test 3: Balance query (using public wallet)
try:
test_wallet = "BJBgjyDZx5FSsyJf6bFKVXuJV7DZY9PCSMSi5d9tcEVh"
balance = client.GetBalance(test_wallet)
print(f"β
Balance query: PASSED - {balance['sol']} SOL")
except Exception as e:
print(f"β Balance query: FAILED - {e}")
return False
# Test 4: Batch balance query
try:
wallets = [
"BJBgjyDZx5FSsyJf6bFKVXuJV7DZY9PCSMSi5d9tcEVh",
"Cpxu7gFhu3fDX1eG5ZVyiFoPmgxpLWiu5LhByNenVbPb"
]
balances = client.GetBatchedBalance(wallets)
print(f"β
Batch query: PASSED - {len(balances)} wallets processed")
except Exception as e:
print(f"β Batch query: FAILED - {e}")
return False
# Test 5: WebSocket client initialization
try:
ws_client = client.ws
print("β
WebSocket client: PASSED")
except Exception as e:
print(f"β WebSocket client: FAILED - {e}")
return False
print("\nπ All tests passed! AxiomTradeAPI-py is ready for Solana trading!")
print("\nπ Next steps:")
print(" 1. Check out the documentation: https://github.com/your-repo/docs/")
print(" 2. Build your first trading bot: https://chipa.tech/product/create-your-bot/")
print(" 3. Explore our shop: https://chipa.tech/shop/")
return True
if __name__ == "__main__":
asyncio.run(test_installation())
Run the verification:
python test_installation.py
# Check your Python version
python --version
# If using Python < 3.8, upgrade:
# On Ubuntu/Debian:
sudo apt update && sudo apt install python3.11
# On macOS with Homebrew:
brew install [email protected]
# On Windows: Download from python.org
# Fix SSL issues on macOS
/Applications/Python\ 3.x/Install\ Certificates.command
# Fix SSL issues on Linux
sudo apt-get update && sudo apt-get install ca-certificates
# Use user installation if permission denied
pip install --user axiomtradeapi
# Or use virtual environment (recommended)
python -m venv trading_env
source trading_env/bin/activate # Linux/macOS
# or
trading_env\Scripts\activate # Windows
pip install axiomtradeapi
# Test network connectivity
import requests
try:
response = requests.get("https://axiom.trade", timeout=10)
print(f"β
Network OK: {response.status_code}")
except Exception as e:
print(f"β Network issue: {e}")
// .vscode/settings.json
{
"python.defaultInterpreterPath": "./trading_env/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.provider": "black"
}
After installation, you can expect:
Now that you have AxiomTradeAPI-py installed:
Building a complex trading system? Chipa.tech offers professional development services:
Visit Chipa.tech Shop for:
Installation guide by Chipa.tech - Your trusted partner for Solana trading automation