π¦ ClawHub
Avantis Skill
by @droppingbeans
Execute leverage trading on Avantis (Base). Long/short crypto, forex, commodities with up to 100x leverage. Uses Python SDK with direct wallet integration.
TERMINAL
clawhub install avantis-skillπ About This Skill
name: avantis description: Execute leverage trading on Avantis (Base). Long/short crypto, forex, commodities with up to 100x leverage. Uses Python SDK with direct wallet integration. metadata: author: beanbot version: "1.0.0" requires: - Python 3.12+ - avantis-trader-sdk - Wallet: 0x79622Ea91BBbDF860e9b0497E4C297fC52c8CE64
Avantis Leverage Trading
Execute leverage trades on Avantis - Base's largest derivatives exchange for crypto, forex, commodities, and indices.
Quick Start
Check Positions
avantis_venv/bin/python skills/avantis/scripts/positions.py
Open Trade
# 5x long ETH with $10 collateral
avantis_venv/bin/python skills/avantis/scripts/trade.py long ETH 10 510x short BTC with $20 collateral
avantis_venv/bin/python skills/avantis/scripts/trade.py short BTC 20 10
Close Position
# Close specific position
avantis_venv/bin/python skills/avantis/scripts/close.py Or close all positions for a pair
avantis_venv/bin/python skills/avantis/scripts/close.py ETH
Wallet Configuration
Main Wallet: 0x79622Ea91BBbDF860e9b0497E4C297fC52c8CE64
/home/ubuntu/clawd/MAIN_WALLET.txtSupported Markets
Crypto (up to 50x)
Forex (up to 100x)
Commodities (up to 100x)
Indices (up to 50x)
Features
Leverage Trading
Risk Management
Fee Features
Common Operations
Open a Position
# Long ETH: 5x leverage, $10 collateral
Position size: $50 (10 Γ 5)
python scripts/trade.py long ETH 10 5With take profit and stop loss
python scripts/trade.py long ETH 10 5 --tp 3500 --sl 3000
Check Positions
python scripts/positions.pyOutput:
π Open positions: 1
β’ LONG 5x | $10 collateral | ETH/USD
β’ Entry: $3200 | Current: $3250
β’ PnL: +$7.81 (+7.81%)
Close Position
# Full close
python scripts/close.py 0 0 # pair_index=0 (ETH), trade_index=0Partial close (50%)
python scripts/close.py 0 0 --amount 5
Update Stop Loss / Take Profit
python scripts/update-tpsl.py 0 0 --tp 3800 --sl 3100
Position Sizing Guide
Minimum Position Size
collateral Γ leverage β₯ minimumExamples
Recommended Sizing
Leverage Guidelines
Conservative (2-5x)
Moderate (5-10x)
Aggressive (10-50x)
Extreme (50-100x)
Fees & Costs
Trading Fees
Execution Fee
Margin Fee
Risk Warnings
β οΈ Liquidation Risk
β οΈ Market Risk
β οΈ Fee Impact
Best Practices
Before Trading
1. Check balance: Ensure sufficient USDC + gas 2. Check market: Look at current price/volatility 3. Calculate risk: Know your max loss 4. Set stops: Always use stop loss for leverageDuring Trade
1. Monitor positions: Check regularly (especially high leverage) 2. Adjust if needed: Update TP/SL based on market 3. Scale out: Consider partial closes to lock profit 4. Watch fees: Margin fees accrue dailyAfter Trade
1. Review performance: What worked, what didn't 2. Update strategy: Adjust sizing/leverage based on results 3. Document lessons: Add to continuous-learning instinctsCommon Issues
"BELOW_MIN_POS" Error
"Price Feed Down" (503 Error)
"Insufficient Balance"
Transaction Reverts
Advanced Features
Limit Orders
# Open long at specific price
python scripts/trade.py long ETH 10 5 --limit 3000
Margin Updates
# Add $5 collateral (reduces leverage)
python scripts/update-margin.py 0 0 --deposit 5Remove $3 collateral (increases leverage)
python scripts/update-margin.py 0 0 --withdraw 3
Market Research
# Get current price + analysis
python scripts/market-info.py ETHCompare multiple assets
python scripts/market-info.py ETH BTC SOL
Integration with Other Skills
Bankr (Optional)
Continuous Learning
instincts/crypto/Strategic Compact
Resources
Scripts Reference
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 balancesInstallation
The SDK is already installed in /home/ubuntu/clawd/avantis_venv/:
# Activate venv (if needed for manual testing)
source /home/ubuntu/clawd/avantis_venv/bin/activateCheck installation
python -c "from avantis_trader_sdk import TraderClient; print('β SDK ready')"
Safety Checklist
Before every trade:
β οΈ Important: Leverage trading is high risk. Start small, use stop losses, never risk more than you can afford to lose.