openclaw 网盘下载
OpenClaw

技能详情(站内镜像,无评论)

首页 > 技能库 > DEX Agent

Execute zero-fee direct token swaps and manage stop-loss, take-profit, and portfolio tracking on Base chain via Uniswap V3 with self-custodial security.

金融与交易

作者:Elway Botty @avmw2025

许可证:MIT-0

MIT-0 ·免费使用、修改和重新分发。无需归因。

版本:v1.1.0

统计:⭐ 0 · 110 · 0 current installs · 0 all-time installs

0

安装量(当前) 0

🛡 VirusTotal :良性 · OpenClaw :可疑

Package:avmw2025/dex-agent

安全扫描(ClawHub)

  • VirusTotal :良性
  • OpenClaw :可疑

OpenClaw 评估

The skill mostly implements the advertised DEX trading functions, but contains clear internal inconsistencies and risky defaults (plaintext local private key storage despite claims of encryption, contradictory fee claims, and unlimited token approvals), so you should review and harden it before trusting funds to it.

目的

The code implements on-chain swaps, price quoting, multi-RPC failover, a wallet manager, and order monitoring — all coherent with the stated purpose of self-custodial Uniswap V3 trading on Base. However, the SKILL.md and marketing say 'zero swap fees', while the code/config references an internal fee (OUR_FEE_BPS = 30 / 0.3%) and comments about fee collection, which contradicts the zero-fee claim. Also a hard-coded 'BANKR_WALLET' address is pr…

说明范围

Runtime instructions are limited to installing web3/eth-abi, generating a wallet, funding it, and running CLI commands — consistent with the feature set. But SKILL.md and some docstrings claim keys are 'encrypted' and 'never transmitted', while the wallet implementation saves the raw private key as hex in a local JSON file with 0o600 permissions (no encryption). That is an explicit mismatch between instructions/claims and actual behavior. The …

安装机制

No install spec in the registry; SKILL.md suggests pip installing standard packages (web3, eth-abi). That is expected for a Python-based on-chain tool and does not attempt to download remote executables or archives. Risk here is conventional (third-party Python packages), not unusual for this use case.

证书

The skill declares no required environment variables or external secrets, which matches the code. However, the code stores private keys unencrypted in a local file (contradicting claims of encryption) and uses infinite ERC20 approvals (max uint256) for the router, which is a disproportionate and risky default for a wallet-managed trading tool. RPC endpoints are hard-coded to several third-party providers (e.g., base.llamarpc.com, base.meowrpc.…

持久

The skill is not marked always:true, does not request to persistently modify other skills, and only writes files under its own directory (wallets/trading-wallet.json, active-orders.json). This level of local persistence is expected for a CLI trading bot.

安装(复制给龙虾 AI)

将下方整段复制到龙虾中文库对话中,由龙虾按 SKILL.md 完成安装。

请把本段交给龙虾中文库(龙虾 AI)执行:为本机安装 OpenClaw 技能「DEX Agent」。简介:Execute zero-fee direct token swaps and manage stop-loss, take-profit, and port…。
请 fetch 以下地址读取 SKILL.md 并按文档完成安装:https://raw.githubusercontent.com/openclaw/skills/refs/heads/main/skills/avmw2025/dex-agent/SKILL.md
(来源:yingzhi8.cn 技能库)

SKILL.md

打开原始 SKILL.md(GitHub raw)

# DEX Agent — Direct DeFi Trading Skill

**Zero-fee DeFi trading for OpenClaw agents. Bankr alternative.**

## Description
Direct DEX swap execution on Base chain via Uniswap V3. Self-custodial, open-source, zero middleman fees. Includes real-time price feeds, swap quotes, stop-loss, take-profit, portfolio tracking, and configurable risk management.

## When to Use
- User asks to trade crypto, swap tokens, or execute DeFi trades
- User wants to check token prices on Base chain
- User needs stop-loss or take-profit orders
- User wants to manage a trading wallet
- User is looking for a Bankr alternative with lower fees
- User needs configurable risk limits (daily trades, position caps, drawdown protection)

## Setup
1. Install dependencies: `pip3 install web3 eth-abi`
2. Generate a wallet: `python3 agent.py wallet generate`
3. Fund the wallet with ETH (gas) and USDC (trading) on Base chain
4. (Optional) Create `trading-config.json` to override risk defaults
5. Start trading!

## Commands

### Price Check
```bash
cd <skill_dir>/scripts && python3 agent.py price WETH
cd <skill_dir>/scripts && python3 agent.py price BRETT
```

### Get Quote
```bash
cd <skill_dir>/scripts && python3 agent.py quote USDC WETH 10.0
```

### Execute Swap
```bash
cd <skill_dir>/scripts && python3 agent.py swap USDC WETH 5.0
cd <skill_dir>/scripts && python3 agent.py swap ETH USDC 0.01
```

### Stop-Loss & Take-Profit
```bash
cd <skill_dir>/scripts && python3 agent.py stop WETH 2000 8.0 0.005
cd <skill_dir>/scripts && python3 agent.py tp WETH 2000 5.0 0.005
cd <skill_dir>/scripts && python3 agent.py monitor
```

### Portfolio
```bash
cd <skill_dir>/scripts && python3 agent.py balances
cd <skill_dir>/scripts && python3 agent.py wallet
```

## Risk Management

Configurable risk parameters in `config.py` (override via `trading-config.json`):

| Parameter | Default | Description |
|-----------|---------|-------------|
| `max_daily_trades` | 8 | Max new trades per 24h window |
| `max_active_positions` | 8 | Max concurrent open positions |
| `trade_size_usd` | 20 | Trade size in USD |
| `take_profit_pct` | 5.0 | Auto take-profit trigger |
| `stop_loss_pct` | 8.0 | Auto stop-loss trigger |
| `max_drawdown_pct` | 20.0 | Portfolio-wide drawdown halt |
| `cooldown_minutes` | 60 | Cooldown between same-token trades |
| `min_liquidity` | 50000 | Minimum pool liquidity (USD) |
| `min_volume_24h` | 100000 | Minimum 24h volume filter |

**Key design decision:** `max_daily_trades` should match `max_active_positions`. A mismatch (e.g., 4 daily trades but 8 position slots) means the bot hits its daily cap before filling available positions — leaving capital idle while signals pass. Align both limits for maximum capital efficiency.

## Supported Chains
- Base (Chain ID 8453)

## Supported DEXes
- Uniswap V3

## Key Advantages Over Bankr
- **Zero swap fees** (just gas costs)
- **Free stop-loss and take-profit** (no subscription needed)
- **Self-custodial** (you hold your private keys)
- **Faster execution** (~3s vs ~20s)
- **Configurable risk management** (daily limits, position caps, drawdown protection)
- **Open source** and customizable

## Safety Notes
- Private keys are stored locally and never transmitted
- Always use slippage protection (default: 1%)
- Start with small amounts to test
- Risk parameters prevent overexposure — don't disable them
- This is NOT financial advice