← 返回 Skills 市场
droppingbeans

Avantis Skill

作者 droppingbeans · GitHub ↗ · v1.0.1
cross-platform ⚠ suspicious
1427
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install avantis-skill
功能描述
Execute leverage trading on Avantis (Base). Long/short crypto, forex, commodities with up to 100x leverage. Uses Python SDK with direct wallet integration.
使用说明 (SKILL.md)

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 5

# 10x 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 \x3Cpair_index> \x3Ctrade_index>

# Or close all positions for a pair
avantis_venv/bin/python skills/avantis/scripts/close.py ETH

Wallet Configuration

Main Wallet: 0x79622Ea91BBbDF860e9b0497E4C297fC52c8CE64

  • Private key: /home/ubuntu/clawd/MAIN_WALLET.txt
  • USDC approved: 100 USDC
  • Gas balance: 0.004500 ETH (~89 trades)

Supported Markets

Crypto (up to 50x)

  • ETH/USD, BTC/USD, SOL/USD, LINK/USD
  • ARB/USD, OP/USD, AVAX/USD, etc.

Forex (up to 100x)

  • EUR/USD, GBP/USD, USD/JPY, AUD/USD
  • USD/CAD, USD/CHF, NZD/USD

Commodities (up to 100x)

  • Gold (XAU/USD), Silver (XAG/USD)
  • Oil (WTI, Brent)

Indices (up to 50x)

  • SPX, NDX, DJI

Features

Leverage Trading

  • Long: Profit when price goes up
  • Short: Profit when price goes down
  • Min leverage: 2x
  • Max leverage: 50x crypto, 100x forex/commodities

Risk Management

  • Take Profit: Auto-close at target price (max 500% of entry)
  • Stop Loss: Auto-close to limit losses
  • Margin Updates: Add/remove collateral to adjust leverage
  • Partial Close: Close portion of position

Fee Features

  • Loss Protection: Up to 20% rebate on losses when trading against popular sentiment
  • Positive Slippage: Better execution when helping balance open interest
  • Dynamic Fees: 0.04-0.1% based on market conditions

Common Operations

Open a Position

# 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

Check Positions

python scripts/positions.py

# Output:
# 📊 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=0

# Partial 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

  • ETH/USD: ~$30 minimum position
  • BTC/USD: ~$50 minimum position
  • Formula: collateral × leverage ≥ minimum

Examples

  • ❌ $5 × 5x = $25 position (too small for ETH)
  • ✅ $10 × 5x = $50 position (works for ETH)
  • ✅ $20 × 2.5x = $50 position (works for ETH)

Recommended Sizing

  • Start small: $10-20 collateral for testing
  • Scale up: After confirming strategy works
  • Max risk: Don't exceed 5-10% of account per trade

Leverage Guidelines

Conservative (2-5x)

  • Lower liquidation risk
  • Smaller gains/losses
  • Good for: Learning, uncertain markets

Moderate (5-10x)

  • Balanced risk/reward
  • Common for crypto trading
  • Good for: Directional plays

Aggressive (10-50x)

  • High liquidation risk
  • Large potential gains/losses
  • Good for: Short-term scalping, tight stops

Extreme (50-100x)

  • Very high liquidation risk
  • Only for forex/commodities
  • Good for: Expert traders only

Fees & Costs

Trading Fees

  • Opening: 0.04-0.1% of position size (dynamic)
  • Closing: 0.04-0.1% of position size
  • Example: $50 position × 0.08% = $0.04 fee

Execution Fee

  • Cost: ~$0.10-0.30 in ETH per transaction
  • Covers: Base network gas fees
  • Auto-calculated: SDK handles this

Margin Fee

  • Accrual: 0.02-0.05% daily on position size
  • Example: $50 position × 0.03% = $0.015/day
  • Deducted: When closing or updating margin

Risk Warnings

⚠️ Liquidation Risk

  • Position liquidates if losses exceed collateral
  • Higher leverage = faster liquidation
  • Monitor positions regularly

⚠️ Market Risk

  • Crypto/forex markets are volatile
  • Prices can move against you quickly
  • Use stop losses

⚠️ Fee Impact

  • Small positions pay proportionally more fees
  • Margin fees accrue daily
  • Factor fees into profit calculations

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 leverage

During 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 daily

After 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 instincts

Common Issues

"BELOW_MIN_POS" Error

  • Position size too small
  • Solution: Increase collateral or leverage

"Price Feed Down" (503 Error)

  • Avantis infrastructure issue
  • Solution: Wait 5-10 minutes and retry

"Insufficient Balance"

  • Not enough USDC or gas
  • Solution: Add funds to wallet

Transaction Reverts

  • Usually approval or balance issue
  • Solution: Check allowance, re-approve if needed

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 5

# Remove $3 collateral (increases leverage)
python scripts/update-margin.py 0 0 --withdraw 3

Market Research

# Get current price + analysis
python scripts/market-info.py ETH

# Compare multiple assets
python scripts/market-info.py ETH BTC SOL

Integration with Other Skills

Bankr (Optional)

  • Can use Bankr for market research
  • Avantis for actual trade execution
  • Keep separate for now (different wallets)

Continuous Learning

  • Track successful strategies in instincts/crypto/
  • Note leverage levels that work
  • Document entry/exit patterns

Strategic Compact

  • Checkpoint after closing positions
  • Review performance during checkpoints
  • Adjust strategy based on results

Resources

Scripts Reference

All scripts in skills/avantis/scripts/:

  • positions.py - View open positions
  • trade.py - Open new position
  • close.py - Close position (full or partial)
  • update-tpsl.py - Update take profit / stop loss
  • update-margin.py - Add/remove collateral
  • market-info.py - Get market data
  • balance.py - Check wallet balances

Installation

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/activate

# Check installation
python -c "from avantis_trader_sdk import TraderClient; print('✓ SDK ready')"

Safety Checklist

Before every trade:

  • Check wallet balance (USDC + gas)
  • Verify leverage is appropriate
  • Set stop loss
  • Confirm position size meets minimum
  • Understand max loss scenario
  • Have exit plan ready

⚠️ Important: Leverage trading is high risk. Start small, use stop losses, never risk more than you can afford to lose.

安全使用建议
Do not run this skill or its scripts on any machine that holds real funds or private keys. Specific concerns: (1) The repo contains a hardcoded private key literal in multiple scripts — treat that as compromised and dangerous. (2) Several scripts read a hard-coded absolute file path (/home/ubuntu/clawd/MAIN_WALLET.txt) to extract a private key, which means the skill will look for and use host-stored secrets without clear consent or declaration. Before using: verify the key(s) are not real (rotate any key that matches the literal), remove hardcoded keys, and change the scripts to accept keys via a secure secret store or prompt (do not store plaintext on disk). Run the skill only in an isolated test environment with an empty/test wallet and limited funds. Ask the author for upstream source, audits, and a secure secret-handling design (use environment variables or a secrets manager, and do not hardcode keys or read arbitrary host paths). If unsure, prefer not to install.
功能分析
Type: OpenClaw Skill Name: avantis-skill Version: 1.0.1 This skill is classified as suspicious due to its direct handling of a private key file and the presence of hardcoded private keys in test scripts. The `SKILL.md` and Python scripts (`close.py`, `positions.py`, `trade.py`) explicitly instruct the agent to read a private key from `/home/ubuntu/clawd/MAIN_WALLET.txt` for direct wallet integration, which is a high-risk operation, even if necessary for the skill's stated purpose of leverage trading on Avantis. Furthermore, `scripts/check-positions.py` and `scripts/test-avantis-simple.py` contain hardcoded private keys (e.g., `0xf1e98680b29f30a007d472bd9ab44ed5641d915c946d544174af06fc0bd447cb`), indicating poor security practices around sensitive credentials, even if these are intended as test keys. There is no clear evidence of intentional malicious behavior like data exfiltration to external endpoints or unauthorized remote control.
能力评估
Purpose & Capability
Functionality (open/close trades, check positions) matches the description. However, the skill expects direct wallet private-key access yet declares no credentials or config requirements — instead the code either hardcodes a private key or reads /home/ubuntu/clawd/MAIN_WALLET.txt. Asking for raw private keys is expected for on-chain trading, but the way keys are provided (hardcoded in repo and/or read from an absolute host path) is disproportionate and unsafe.
Instruction Scope
SKILL.md instructs running the included Python scripts. The scripts access sensitive data outside the skill (reads /home/ubuntu/clawd/MAIN_WALLET.txt) and some files contain a hardcoded private key literal. The SKILL.md/README do not declare or warn that scripts will read host files, nor do they require or document secure secret handling — this scope creep (access to arbitrary local host files containing secrets) is dangerous and not properly declared.
Install Mechanism
No install spec or remote downloads are present (instruction-only plus included Python scripts). Dependency on an external Python SDK (avantis-trader-sdk) is declared in documentation but not installed automatically. No suspicious external URLs or archive extraction were used by the skill itself.
Credentials
The package declares no required environment variables or primary credential, yet scripts require a private key. Worse, two scripts embed a literal private key string and several scripts read a specific file path (/home/ubuntu/clawd/MAIN_WALLET.txt) and extract a line. This is disproportionate and unsafe: secrets are present in the codebase and the skill will access host files without explicit, declared permissions or guidance for secure handling.
Persistence & Privilege
always is false and the skill is user-invocable, but autonomous invocation is allowed by default. Combined with embedded/read private keys, autonomous invocation increases the blast radius: an agent could run trades or move funds using the available keys. The skill does not request persistent platform-wide privileges, but its ability to act programmatically on a private key is a significant operational privilege.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install avantis-skill
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /avantis-skill 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
Version 1.0.1 of avantis-skill - No file changes detected in this release. - Functionality, documentation, and metadata remain unchanged from the previous version.
v1.0.0
Avantis Skill 1.0.0 – Initial Release - Enables leverage trading on Avantis (Base's largest derivatives exchange) for crypto, forex, commodities, and indices. - Provides scripts for opening/closing positions, updating take profit/stop loss, and managing margin directly from Python. - Features up to 100x leverage (pair-dependent), dynamic fees, risk management tools, and direct wallet integration. - Includes comprehensive usage instructions, market support, position sizing, and risk/best practice guidelines. - Offers detailed error troubleshooting and advanced features like limit orders and market research scripts.
元数据
Slug avantis-skill
版本 1.0.1
许可证
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Avantis Skill 是什么?

Execute leverage trading on Avantis (Base). Long/short crypto, forex, commodities with up to 100x leverage. Uses Python SDK with direct wallet integration. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1427 次。

如何安装 Avantis Skill?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install avantis-skill」即可一键安装,无需额外配置。

Avantis Skill 是免费的吗?

是的,Avantis Skill 完全免费(开源免费),可自由下载、安装和使用。

Avantis Skill 支持哪些平台?

Avantis Skill 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Avantis Skill?

由 droppingbeans(@droppingbeans)开发并维护,当前版本 v1.0.1。

💬 留言讨论