A comprehensive Python client for the AxiomTrade API with automatic token management, secure authentication, and extensive trading analytics for Solana meme tokens.
Project description
AxiomTradeAPI-py
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
๐ Why AxiomTradeAPI-py?
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.
โก Key Features
| 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 |
๐ What's New in v1.1.6
- 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 nodriver
v1.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.
๐ Quick Start
Installation
# 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!')"
Basic Usage
1. Browser Login โ Fully Automatic (Recommended)
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 alias
Gmail with 2FA? Use an App Password for
AXIOM_IMAP_PASSWORD.
2. Token Authentication (Serverless / CI)
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}")
3. Manual Token Authentication
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"
)
Advanced Features
Real-time Token Monitoring
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())
Batch Portfolio Tracking
# 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")
๐ Comprehensive Documentation
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 |
๐ Professional Use Cases
๐ฏ Token Sniping Bots
# 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)
๐ DeFi Portfolio Analytics
# 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
๐ Arbitrage Detection
# 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%
๐ ๏ธ Development & Contribution
Development Setup
# 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/
Testing Your Installation
#!/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!")
๐ Community & Support
Join Our Growing Community
๐ Learn from Successful Traders โข ๐ ๏ธ Get Technical Support โข ๐ก Share Strategies โข ๐ Access Premium Content
Professional Services
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
๐ Performance Benchmarks
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%+ |
๐ง Configuration Options
Environment Variables
# โโ 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=10
Client Configuration
client = AxiomTradeClient(
auth_token="...",
refresh_token="...",
timeout=30,
max_retries=3,
log_level=logging.INFO,
rate_limit={"requests": 100, "window": 60} # 100 requests per minute
)
๐จ Important Disclaimers
โ ๏ธ Trading Risk Warning: Cryptocurrency trading involves substantial risk of loss. Never invest more than you can afford to lose.
๐ 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.
๐ License & Legal
This project is licensed under the MIT License - see the LICENSE file for details.
- โ Commercial Use Allowed
- โ Modification Allowed
- โ Distribution Allowed
- โ Private Use Allowed
๐ Acknowledgments
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
โ๏ธ Write Better Trading Bots with ChipaEditor
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
๐ Trade on Axiom
Ready to put your bots to work? Start trading on Axiom Trade โ
๐ Community & Services
Join our growing community of traders and developers!
๐ฌ Join our Community
Connect with other traders, share strategies, and get help with the API.
๐ค Bot Development Services
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!
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 axiomtradeapi-1.1.6.tar.gz.
File metadata
- Download URL: axiomtradeapi-1.1.6.tar.gz
- Upload date:
- Size: 83.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cd5a8c8d8928e75e747eb5d9abea1d38d4fe9672b6f5d70d99afc4a1a5879f7
|
|
| MD5 |
3a6d344214fd705084484e0f043599c3
|
|
| BLAKE2b-256 |
56ac44fa56b3b2ec06e9c5d095454585317d3c4a4b2eb2e7001c92844f71e92d
|
File details
Details for the file axiomtradeapi-1.1.6-py3-none-any.whl.
File metadata
- Download URL: axiomtradeapi-1.1.6-py3-none-any.whl
- Upload date:
- Size: 55.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8537b1dff345dbd2b2cb8d5ababe507b95751b7522e0def889af760d538c6443
|
|
| MD5 |
0f75a4b3d0a6e1d2a1203dfcfd6e95a4
|
|
| BLAKE2b-256 |
d2e8fa8d646baeb527a4ae7e9c633f50288a1ee16decbd4294108c83db4c7827
|