← 返回 Skills 市场
avmw2025

DEX Agent

作者 Elway Botty · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ⚠ suspicious
288
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install 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.
使用说明 (SKILL.md)

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

cd \x3Cskill_dir>/scripts && python3 agent.py price WETH
cd \x3Cskill_dir>/scripts && python3 agent.py price BRETT

Get Quote

cd \x3Cskill_dir>/scripts && python3 agent.py quote USDC WETH 10.0

Execute Swap

cd \x3Cskill_dir>/scripts && python3 agent.py swap USDC WETH 5.0
cd \x3Cskill_dir>/scripts && python3 agent.py swap ETH USDC 0.01

Stop-Loss & Take-Profit

cd \x3Cskill_dir>/scripts && python3 agent.py stop WETH 2000 8.0 0.005
cd \x3Cskill_dir>/scripts && python3 agent.py tp WETH 2000 5.0 0.005
cd \x3Cskill_dir>/scripts && python3 agent.py monitor

Portfolio

cd \x3Cskill_dir>/scripts && python3 agent.py balances
cd \x3Cskill_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
安全使用建议
This package does implement on-chain swaps and monitoring as advertised, but there are important red flags you should address before using it with real funds: - Private key storage: Despite claims of encrypted storage, wallet.py writes the raw private key hex into wallets/trading-wallet.json (no encryption). Anyone with access to that file can steal funds. Consider using a hardware wallet, an encrypted keystore, or modify the code to encrypt the private key with a passphrase. - Unlimited approvals: The swap flow sets ERC20 allowance to max uint256. If the router contract or your node is compromised, an attacker could drain approved tokens. Prefer per-amount approvals or explicit allowance limits and audit the router address on-chain. - Fee wording mismatch: SKILL.md says "zero swap fees" but config and comments refer to a 0.3% internal fee. Clarify whether any on-platform fee exists and where a fee wallet would be set (FEE_WALLET is None / TODO). - Third-party RPCs: The skill uses multiple public RPC endpoints (including third-party providers). These are required to submit transactions, but they observe transaction metadata; choose trusted RPCs or run your own node if privacy/trust is a concern. - Test with minimal funds: If you still want to try it, run it on a small amount or testnet first, and inspect the truncated part of swap.py (the code provided was truncated) to ensure there is no additional hidden behavior. - Code audit: If you plan to entrust funds, either audit and fix the plaintext key storage and approval logic, or only use the skill as a read-only price/quote tool. Avoid using it as-is with significant balances.
功能分析
Type: OpenClaw Skill Name: dex-agent Version: 1.1.0 The DEX Agent skill is a functional DeFi trading tool for the Base chain, providing features like wallet generation, price monitoring, and Uniswap V3 swaps. While it stores private keys in a local JSON file (a security vulnerability) and contains contradictory comments regarding fees in 'config.py' (claiming zero fees in docs but defining a fee constant in code), the actual implementation in 'swap.py' does not exfiltrate data, steal funds, or charge hidden fees. All operations are performed locally and use standard public RPCs.
能力评估
Purpose & Capability
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 present (marked 'for reading only') which is unexpected but not obviously malicious.
Instruction Scope
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 code also creates an 'active-orders.json' and writes wallet files to disk; the instructions do not warn about plaintext key storage or provide guidance to use hardware wallets or encryption.
Install Mechanism
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.
Credentials
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.com), which is acceptable but means node operators will see submitted signed transactions and metadata.
Persistence & Privilege
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install dex-agent
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /dex-agent 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.0
Risk management overhaul: added configurable daily trade limits, position caps, and drawdown protection. Fixed critical misalignment where max_daily_trades (4) didn't match max_active_positions (8) — bot was hitting its daily cap before filling available slots, leaving capital idle while valid signals passed. Both now default to 8 for full capital efficiency.
v1.0.0
Initial release of Direct DeFi Trading Skill for OpenClaw agents. - Enables zero-fee DEX trading on Base via Uniswap V3. - Supports real-time price checks, swap quotes, and direct swap execution. - Offers stop-loss and take-profit automation at no extra cost. - Provides full portfolio and wallet management features. - Fully self-custodial design with local key storage. - Designed as a faster, open-source, fee-free alternative to Bankr.
元数据
Slug dex-agent
版本 1.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

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. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 288 次。

如何安装 DEX Agent?

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

DEX Agent 是免费的吗?

是的,DEX Agent 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

DEX Agent 支持哪些平台?

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

谁开发了 DEX Agent?

由 Elway Botty(@avmw2025)开发并维护,当前版本 v1.1.0。

💬 留言讨论