The Professional Python SDK for Solana Trading on Axiom Trade
Build advanced trading bots, monitor portfolios, and automate Solana DeFi strategies with enterprise-grade reliability
π Documentation β’ π Quick Start β’ π¬ Community β’ π Bot Development Services β’ π Trade on Axiom
AxiomTradeAPI-py is the most comprehensive Python library for Solana trading automation, trusted by professional traders and DeFi developers worldwide. Whether you're building trading bots, portfolio trackers, or DeFi analytics tools, our SDK provides everything you need.
| Feature | Description | Use Case |
|---|---|---|
| π Real-time WebSocket | Sub-millisecond token updates | Token sniping, live monitoring |
| π Portfolio Tracking | Multi-wallet balance monitoring | Portfolio management, analytics |
| π€ Trading Automation | Advanced bot frameworks | Automated trading strategies |
| π Enterprise Security | Production-grade authentication | Secure API access |
| π Market Data | Comprehensive Solana market info | Price feeds, volume analysis |
| π‘οΈ Risk Management | Built-in trading safeguards | Position sizing, loss limits |
- Browser-based login via
nodriverβ drives real Chrome to bypass Cloudflare Turnstile automatically. No manual steps required. - IMAP OTP auto-reading β provide your email password and the SDK reads the 6-digit OTP from your inbox and enters it automatically. Full zero-touch login.
- Login-once, run-forever β tokens saved to encrypted local storage and auto-refreshed. The browser only opens on first login or when the refresh token expires.
- Alias email support β set
AXIOM_IMAP_USERseparately when your Axiom login email is an alias pointing to a different mailbox.
pip install --upgrade axiomtradeapi
pip install "axiomtradeapi[browser]" # adds nodriverv1.1.5 notes
- Chrome TLS impersonation via
curl_cffiβ WebSocket connections bypass Cloudflare's bot detection. - JWT-aware token refresh β reads the real
expclaim; no more silent expiry failures. - Pre-flight HTTP warm-up β mirrors browser behaviour before WebSocket connect.
- Cluster fallback fixed β automatically tries cluster3/5/7 on primary failure.
# Core SDK
pip install axiomtradeapi
# + browser login support (recommended)
pip install "axiomtradeapi[browser]"
# Or install with development dependencies
pip install axiomtradeapi[dev]
# Verify installation
python -c "from axiomtradeapi import AxiomTradeClient; print('β
Installation successful!')"The SDK uses a real Chrome window to bypass Cloudflare Turnstile. Provide your IMAP credentials and the entire flow β including the OTP β is zero-touch. Tokens are saved locally and auto-refreshed, so the browser only opens once.
import os
from axiomtradeapi import AxiomTradeClient
from dotenv import load_dotenv
load_dotenv()
client = AxiomTradeClient(
username=os.getenv("AXIOM_EMAIL"),
password=os.getenv("AXIOM_PASSWORD"),
)
# First run: Chrome opens, fills credentials, reads OTP from inbox automatically
# Subsequent runs: tokens loaded from disk β login() not needed
if not client.auth_manager.is_authenticated():
result = client.login(
imap_password=os.getenv("AXIOM_IMAP_PASSWORD"),
# imap_user="real@yourdomain.com" # only if AXIOM_EMAIL is an alias
)
if not result["success"]:
raise RuntimeError("Login failed")
balance = client.GetBalance("YOUR_WALLET_ADDRESS")
print(f"Balance: {balance}").env setup:
AXIOM_EMAIL=you@example.com
AXIOM_PASSWORD=yourpassword
AXIOM_IMAP_PASSWORD=your_email_password # enables auto-OTP
AXIOM_IMAP_USER=real@yourdomain.com # only needed if AXIOM_EMAIL is an aliasGmail with 2FA? Use an App Password for
AXIOM_IMAP_PASSWORD.
Use pre-obtained tokens directly β no browser required. The SDK auto-refreshes them.
import os
from axiomtradeapi import AxiomTradeClient
from dotenv import load_dotenv
load_dotenv()
client = AxiomTradeClient(
auth_token=os.getenv("AXIOM_ACCESS_TOKEN"),
refresh_token=os.getenv("AXIOM_REFRESH_TOKEN"),
)
if client.auth_manager.ensure_valid_authentication():
balance = client.GetBalance("YOUR_WALLET_ADDRESS")
print(f"Balance: {balance}")Use this for serverless environments or when you manage tokens externally.
from axiomtradeapi import AxiomTradeClient
client = AxiomTradeClient()
client.set_tokens(
access_token="your_access_token_here",
refresh_token="your_refresh_token_here"
)import asyncio
from axiomtradeapi import AxiomTradeClient
async def token_monitor():
client = AxiomTradeClient(
auth_token="your-auth-token",
refresh_token="your-refresh-token"
)
async def handle_new_tokens(tokens):
for token in tokens:
print(f"π¨ New Token: {token['tokenName']} - ${token['marketCapSol']} SOL")
await client.subscribe_new_tokens(handle_new_tokens)
await client.ws.start()
# Run the monitor
asyncio.run(token_monitor())# Monitor multiple wallets efficiently
wallets = [
"BJBgjyDZx5FSsyJf6bFKVXuJV7DZY9PCSMSi5d9tcEVh",
"Cpxu7gFhu3fDX1eG5ZVyiFoPmgxpLWiu5LhByNenVbPb",
"DsHk4F6QNTK6RdTmaDSKeFzGXMnQ9QxKTkDkG8XF8F4F"
]
balances = client.GetBatchedBalance(wallets)
total_sol = sum(b['sol'] for b in balances.values() if b)
print(f"π Total Portfolio: {total_sol:.6f} SOL")Our documentation covers everything from basic setup to advanced trading strategies:
| Guide | Description | Skill Level |
|---|---|---|
| π₯ Installation | Setup, requirements, troubleshooting | Beginner |
| π Authentication | API keys, security, token management | Beginner |
| π° Balance Queries | Wallet monitoring, portfolio tracking | Intermediate |
| π‘ WebSocket Guide | Real-time data, streaming APIs | Intermediate |
| π€ Trading Bots | Automated strategies, bot frameworks | Advanced |
| β‘ Performance | Optimization, scaling, monitoring | Advanced |
| π‘οΈ Security | Best practices, secure deployment | All Levels |
| π Release Notes 1.1.6 | Browser login, IMAP auto-OTP | All Levels |
| π Release Notes 1.1.5 | Cloudflare bypass, auto token refresh | All Levels |
# High-speed token acquisition on new launches
class TokenSniperBot:
def __init__(self):
self.client = AxiomTradeClient(auth_token="...")
self.min_liquidity = 10.0 # SOL
self.target_profit = 0.20 # 20%
async def analyze_token(self, token_data):
if token_data['liquiditySol'] > self.min_liquidity:
return await self.execute_snipe(token_data)# Track yield farming and LP positions
class DeFiTracker:
def track_yields(self, positions):
total_yield = 0
for position in positions:
balance = self.client.GetBalance(position['wallet'])
yield_pct = (balance['sol'] - position['initial']) / position['initial']
total_yield += yield_pct
return total_yield# Find profitable price differences across DEXs
class ArbitrageBot:
def scan_opportunities(self):
# Compare prices across Raydium, Orca, Serum
opportunities = self.find_price_differences()
return [op for op in opportunities if op['profit'] > 0.005] # 0.5%# Clone repository
git clone https://github.com/ChipaDevTeam/AxiomTradeAPI-py.git
cd AxiomTradeAPI-py
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install development dependencies
pip install -e .[dev]
# Run tests
pytest tests/#!/usr/bin/env python3
"""Test script to verify AxiomTradeAPI-py installation"""
async def test_installation():
from axiomtradeapi import AxiomTradeClient
client = AxiomTradeClient()
test_wallet = "BJBgjyDZx5FSsyJf6bFKVXuJV7DZY9PCSMSi5d9tcEVh"
try:
balance = client.GetBalance(test_wallet)
print(f"β
API Test Passed: {balance['sol']} SOL")
return True
except Exception as e:
print(f"β API Test Failed: {e}")
return False
# Run test
import asyncio
if asyncio.run(test_installation()):
print("π AxiomTradeAPI-py is ready for use!")π Learn from Successful Traders β’ π οΈ Get Technical Support β’ π‘ Share Strategies β’ π Access Premium Content
Need a custom trading solution? Our team of expert developers can build:
- π€ Custom Trading Bots - Tailored to your strategy
- π Portfolio Analytics - Advanced tracking and reporting
- π Multi-Exchange Integration - Cross-platform trading
- π‘οΈ Enterprise Security - Production-grade deployment
Our SDK is optimized for professional trading applications:
| Metric | Performance | Industry Standard |
|---|---|---|
| Balance Query Speed | < 50ms | < 200ms |
| WebSocket Latency | < 10ms | < 50ms |
| Batch Operations | 1000+ wallets/request | 100 wallets/request |
| Memory Usage | < 30MB | < 100MB |
| Uptime | 99.9%+ | 99.5%+ |
# ββ Credentials (for browser login) ββββββββββββββββββββββββββββββββββββββββββ
export AXIOM_EMAIL="you@example.com"
export AXIOM_PASSWORD="yourpassword"
# ββ IMAP auto-OTP (optional β enables fully zero-touch login) βββββββββββββββββ
export AXIOM_IMAP_PASSWORD="your_email_password" # Gmail: use an App Password
export AXIOM_IMAP_USER="real@yourdomain.com" # only if AXIOM_EMAIL is an alias
export AXIOM_IMAP_HOST="imap.hostinger.com" # only if auto-detection is wrong
# ββ Token authentication (for serverless / CI) ββββββββββββββββββββββββββββββββ
export AXIOM_ACCESS_TOKEN="your-access-token"
export AXIOM_REFRESH_TOKEN="your-refresh-token"
# ββ Cloudflare (captured automatically by browser login) ββββββββββββββββββββββ
export CF_CLEARANCE="your-cf_clearance-cookie-value"
# API Configuration
export AXIOM_API_TIMEOUT=30
export AXIOM_MAX_RETRIES=3
export AXIOM_LOG_LEVEL=INFO
# WebSocket Settings
export AXIOM_WS_RECONNECT_DELAY=5
export AXIOM_WS_MAX_RECONNECTS=10client = AxiomTradeClient(
auth_token="...",
refresh_token="...",
timeout=30,
max_retries=3,
log_level=logging.INFO,
rate_limit={"requests": 100, "window": 60} # 100 requests per minute
)π Security Notice: Always secure your API keys and never commit them to version control.
π No Financial Advice: This software is for educational and development purposes. We provide tools, not trading advice.
This project is licensed under the MIT License - see the LICENSE file for details.
- β Commercial Use Allowed
- β Modification Allowed
- β Distribution Allowed
- β Private Use Allowed
Special thanks to:
- The Solana Foundation for the robust blockchain infrastructure
- Axiom Trade for providing excellent API services
- Our community of developers and traders for continuous feedback
- All contributors who help improve this library
ChipaEditor β The AI-powered code editor purpose-built for DeFi developers and Solana traders.
ChipaEditor supercharges your AxiomTradeAPI-py workflow with:
- π€ AI-assisted bot generation β describe your strategy, get working code
- β‘ Real-time Solana code completions β context-aware suggestions for trading patterns
- π Built-in DeFi debugging β trace token flows, inspect transactions inline
- π¦ One-click deployment β ship your trading bots faster than ever
Ready to put your bots to work? Start trading on Axiom Trade β
Join our growing community of traders and developers!
Connect with other traders, share strategies, and get help with the API.
Need a custom trading bot? Our expert team builds high-performance custom solutions tailored to your strategy.
Built with β€οΈ by the ChipaDevTeam
Website β’ Documentation β’ Community β’ Services β’ Trade on Axiom β’ ChipaEditor
β Star this repository if you find it useful!