Documentation/Getting Started
šŸš€

Getting Started

Build your first Solana trading bot in 30 minutes

Beginner30 minutes

šŸ“‹ What You'll Learn

  • āœ… Install and configure AxiomTradeAPI-py
  • āœ… Set up authentication for advanced features
  • āœ… Query Solana wallet balances
  • āœ… Monitor your portfolio in real-time
  • āœ… Track new token launches with WebSocket
  • āœ… Build your first automated trading bot

šŸ“‹ Prerequisites

Required

  • šŸ Python 3.8+ (recommended: Python 3.10 or newer)
  • šŸ’» Code editor (VS Code, PyCharm, or similar)
  • šŸ”§ pip package manager (comes with Python)
  • 🌐 Internet connection for API access

Recommended

  • šŸ“š Basic Python knowledge (variables, functions, async/await)
  • šŸ”— Understanding of Solana wallets and transactions
  • šŸ’° Axiom Trade account for WebSocket features (free to create)

šŸ”§ Step 1: Installation

Create Virtual Environment
# Create a new project directory
mkdir my-solana-bot
cd my-solana-bot

# Create virtual environment
python -m venv venv

# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate

# Install AxiomTradeAPI-py
pip install axiomtradeapi

# Verify installation
python -c "from axiomtradeapi import AxiomTradeClient; print('āœ… Installation successful!')"
šŸ’”

Pro Tip: Virtual Environments

Always use virtual environments to avoid package conflicts. This keeps your trading bot dependencies isolated from other Python projects.

šŸ” Step 2: Authentication Setup

Get Your API Credentials

  1. 1. Visit Axiom Trade and sign in
  2. 2. Open Developer Tools (F12 or right-click → Inspect)
  3. 3. Go to the Application or Storage tab
  4. 4. Find Cookies and look for:
    • • auth-access-token
    • • auth-refresh-token
  5. 5. Copy the values (they start with eyJ...)
Create .env File
# .env file - NEVER commit this to version control!
AXIOM_AUTH_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
AXIOM_REFRESH_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
āš ļø

Security Warning

Never commit your .env file to Git. Add it to .gitignore immediately!

šŸ’° Step 3: Your First Balance Query

portfolio_tracker.pyPython
from axiomtradeapi import AxiomTradeClient

# Initialize the client
client = AxiomTradeClient()

# Query any Solana wallet balance
wallet_address = "BJBgjyDZx5FSsyJf6bFKVXuJV7DZY9PCSMSi5d9tcEVh"
balance = client.GetBalance(wallet_address)

print(f"šŸ’° Wallet Balance:")
print(f"   SOL: {balance['sol']}")
print(f"   Lamports: {balance['lamports']:,}")
print(f"   Slot: {balance['slot']}")

# Check multiple wallets at once
wallets = [
    "BJBgjyDZx5FSsyJf6bFKVXuJV7DZY9PCSMSi5d9tcEVh",
    "Cpxu7gFhu3fDX1eG5ZVyiFoPmgxpLWiu5LhByNenVbPb"
]

balances = client.GetBatchedBalance(wallets)

total_sol = sum(b['sol'] for b in balances.values() if b)
print(f"\nšŸ“Š Total Portfolio: {total_sol:.6f} SOL")
Expected Output
šŸ’° Wallet Balance:
   SOL: 1.234567
   Lamports: 1,234,567,890
   Slot: 344031778

šŸ“Š Total Portfolio: 1.802457 SOL

šŸ“” Step 4: Real-Time Token Monitoring

Now let's set up real-time WebSocket monitoring to detect new token launches as they happen.

token_monitor.py
import asyncio
from axiomtradeapi import AxiomTradeClient

class TokenMonitor:
    def __init__(self, auth_token, refresh_token):
        self.client = AxiomTradeClient(
            auth_token=auth_token,
            refresh_token=refresh_token
        )
        self.min_liquidity = 10.0  # Minimum 10 SOL liquidity
    
    async def handle_new_tokens(self, tokens):
        """Process incoming token data"""
        for token in tokens:
            name = token.get('tokenName', 'Unknown')
            liquidity = token.get('liquiditySol', 0)
            
            if liquidity >= self.min_liquidity:
                print(f"🚨 NEW TOKEN: {name}")
                print(f"   Liquidity: {liquidity:.2f} SOL")
                print(f"   Address: {token['tokenAddress']}")
    
    async def start_monitoring(self):
        """Start real-time monitoring"""
        print("šŸ” Monitoring new token launches...")
        await self.client.subscribe_new_tokens(
            callback=self.handle_new_tokens
        )

# Run the monitor
if __name__ == "__main__":
    monitor = TokenMonitor(
        auth_token="your-auth-token",
        refresh_token="your-refresh-token"
    )
    asyncio.run(monitor.start_monitoring())

šŸŽÆ Next Steps

Need Help?

• Join our Discord community for live support

• Check the troubleshooting guide for common issues

• Explore API reference for detailed documentation