← Back to Skills Marketplace
avmw2025

DEX Agent

by Elway Botty · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ⚠ suspicious
288
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install dex-agent
Description
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.
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install dex-agent
  3. After installation, invoke the skill by name or use /dex-agent
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug dex-agent
Version 1.1.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is 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. It is an AI Agent Skill for Claude Code / OpenClaw, with 288 downloads so far.

How do I install DEX Agent?

Run "/install dex-agent" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is DEX Agent free?

Yes, DEX Agent is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does DEX Agent support?

DEX Agent is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created DEX Agent?

It is built and maintained by Elway Botty (@avmw2025); the current version is v1.1.0.

💬 Comments