headless-trading
Autonomous trading for AI agents on Solana and BNB Chain. Use when: (1) executing token swaps on DEXs (Raydium, PancakeSwap), (2) checking token prices and balances, (3) monitoring liquidity pools, (4) implementing trading strategies, (5) managing portfolio positions. Supports headless execution without browser interaction.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/bnbcompanions/headless-cryptoHeadless Trading
Autonomous trading toolkit for AI agents on Solana (Raydium) and BNB Chain (PancakeSwap).
Core Capabilities
1. Token Swaps
Execute swaps on decentralized exchanges without browser interaction:
- Raydium (Solana): SOL ↔ SPL tokens
- PancakeSwap (BNB Chain): BNB ↔ BEP20 tokens
2. Price Monitoring
Fetch real-time token prices:
- DEX liquidity pool prices
- Multiple pair support
- Slippage calculation
3. Portfolio Management
Check balances and positions:
- Native token balances (SOL, BNB)
- Token holdings across wallets
- Transaction history
4. Strategy Execution
Implement automated trading strategies:
- Limit orders (via monitoring + execution)
- DCA (Dollar Cost Averaging)
- Stop-loss / Take-profit
- Arbitrage opportunities
Quick Start
Prerequisites
- Private key (environment variable or secure storage)
- RPC endpoint (public or private node)
- Python 3.8+ with dependencies
Installation
pip install solana web3 anchorpy raydium-py base58
pip install web3 pancakeswap-sdk
Basic Swap Example
from scripts.raydium_swap import swap_on_raydium
# Swap 0.1 SOL for USDC
tx_hash = swap_on_raydium(
input_token="SOL",
output_token="USDC",
amount=0.1,
slippage=1.0 # 1% slippage tolerance
)
Workflow Decision Tree
1. What chain are you trading on?
- Solana → Use
raydium_*scripts + See references/raydium.md - BNB Chain → Use
pancakeswap_*scripts + See references/pancakeswap.md
2. What operation do you need?
- Get token price →
get_price.py - Check wallet balance →
get_balance.py - Execute swap →
swap.py - Monitor liquidity →
monitor_pool.py
3. What strategy are you implementing?
- One-time trade → Direct swap
- Automated strategy → See references/strategies.md
Trading Operations
Get Token Price
from scripts.get_price import get_token_price
# Get current price of a token
price = get_token_price(
chain="solana",
token_address="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", # USDC
quote_token="SOL"
)
print(f"Price: {price} SOL")
Check Wallet Balance
from scripts.get_balance import get_balance
# Check SOL balance
balance = get_balance(
chain="solana",
wallet_address="YOUR_WALLET_ADDRESS"
)
print(f"Balance: {balance} SOL")
Execute Swap
from scripts.swap import execute_swap
# Swap tokens with slippage protection
result = execute_swap(
chain="solana",
input_token="SOL",
output_token="USDC",
amount=0.5,
slippage=1.0,
private_key="YOUR_PRIVATE_KEY" # Use env var in production
)
Monitor Liquidity Pool
from scripts.monitor_pool import get_pool_info
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-bnbcompanions-headless-crypto": {
"enabled": true,
"auto_update": true
}
}
}