← 返回
安全合规

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.
在 Base 链通过 Uniswap V3 执行零手续费直接代币兑换,管理止损止盈与投资组合追踪,实现自托管安全。
avmw2025
安全合规 clawhub v1.1.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 611
下载
💾 6
安装
1
版本
#latest

概述

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 <skill_dir>/scripts && python3 agent.py price WETH
cd <skill_dir>/scripts && python3 agent.py price BRETT

Get Quote

cd <skill_dir>/scripts && python3 agent.py quote USDC WETH 10.0

Execute Swap

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

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

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):

ParameterDefaultDescription
---------------------------------
max_daily_trades8Max new trades per 24h window
max_active_positions8Max concurrent open positions
trade_size_usd20Trade size in USD
take_profit_pct5.0Auto take-profit trigger
stop_loss_pct8.0Auto stop-loss trigger
max_drawdown_pct20.0Portfolio-wide drawdown halt
cooldown_minutes60Cooldown between same-token trades
min_liquidity50000Minimum pool liquidity (USD)
min_volume_24h100000Minimum 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

版本历史

共 1 个版本

  • v1.1.0 当前
    2026-03-19 18:06 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 89 📥 30,586
security-compliance

MoltGuard - Security & Antivirus & Guardrails

thomaslwang
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装 MoltGuard,保护您和您的用户免受提示注入、数据泄露和恶意攻击。
★ 116 📥 30,699
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,210 📥 266,150