Execute leverage trading on Avantis (Base). Long/short crypto, forex, commodities with up to 100x leverage. Uses Python SDK with direct wallet integration. Use when this capability is needed.
Execute leverage trades on Avantis - Base's largest derivatives exchange for crypto, forex, commodities, and indices.
avantis_venv/bin/python skills/avantis/scripts/positions.py
# 5x long ETH with $10 collateral
avantis_venv/bin/python skills/avantis/scripts/trade.py long ETH 10 5
# 10x short BTC with $20 collateral
avantis_venv/bin/python skills/avantis/scripts/trade.py short BTC 20 10
# Close specific position
avantis_venv/bin/python skills/avantis/scripts/close.py <pair_index> <trade_index>
# Or close all positions for a pair
avantis_venv/bin/python skills/avantis/scripts/close.py ETH
Main Wallet: 0x79622Ea91BBbDF860e9b0497E4C297fC52c8CE64
/home/ubuntu/clawd/MAIN_WALLET.txt# Long ETH: 5x leverage, $10 collateral
# Position size: $50 (10 × 5)
python scripts/trade.py long ETH 10 5
# With take profit and stop loss
python scripts/trade.py long ETH 10 5 --tp 3500 --sl 3000
python scripts/positions.py
# Output:
# 📊 Open positions: 1
# • LONG 5x | $10 collateral | ETH/USD
# • Entry: $3200 | Current: $3250
# • PnL: +$7.81 (+7.81%)
# Full close
python scripts/close.py 0 0 # pair_index=0 (ETH), trade_index=0
# Partial close (50%)
python scripts/close.py 0 0 --amount 5
python scripts/update-tpsl.py 0 0 --tp 3800 --sl 3100
collateral × leverage ≥ minimum⚠️ Liquidation Risk
⚠️ Market Risk
⚠️ Fee Impact
# Open long at specific price
python scripts/trade.py long ETH 10 5 --limit 3000
# Add $5 collateral (reduces leverage)
python scripts/update-margin.py 0 0 --deposit 5
# Remove $3 collateral (increases leverage)
python scripts/update-margin.py 0 0 --withdraw 3
# Get current price + analysis
python scripts/market-info.py ETH
# Compare multiple assets
python scripts/market-info.py ETH BTC SOL
instincts/crypto/All scripts in skills/avantis/scripts/:
positions.py - View open positionstrade.py - Open new positionclose.py - Close position (full or partial)update-tpsl.py - Update take profit / stop lossupdate-margin.py - Add/remove collateralmarket-info.py - Get market databalance.py - Check wallet balancesThe SDK is already installed in /home/ubuntu/clawd/avantis_venv/:
# Activate venv (if needed for manual testing)
source /home/ubuntu/clawd/avantis_venv/bin/activate
# Check installation
python -c "from avantis_trader_sdk import TraderClient; print('✓ SDK ready')"
Before every trade:
⚠️ Important: Leverage trading is high risk. Start small, use stop losses, never risk more than you can afford to lose.
Converted and distributed by TomeVault Context snippets also available to append to your CLAUDE.md, GEMINI.md, and copilot-instructions.md — download at TomeVault