Skip to main content

Open-source framework for building autonomous AI agents that interact with blockchain networks

Project description

๐Ÿค– Web3 Agent Kit

Build autonomous AI agents that interact with blockchains โ€” in minutes, not months.

PyPI License: MIT Python 3.10+ CI | Coverage | Twitter

Web3 Agent Kit Demo


๐Ÿค” Why Web3 Agent Kit?

Building AI agents that interact with blockchains is hard. You need to juggle RPC providers, wallet management, transaction signing, gas estimation, DeFi protocol ABIs, LLM integration, and safety rails โ€” all before writing a single line of business logic.

Web3 Agent Kit handles all of that for you.

Pain Point Without Web3 Agent Kit With Web3 Agent Kit
Setup Days of boilerplate pip install โ†’ 5 lines of code
Multi-chain Write adapters per chain Built-in for 7+ chains
LLM Integration Manual prompt engineering Natural language goals, auto-parsed
Safety Build your own guardrails Spend limits, kill switch, operator confirmation
DeFi Read docs, write ABIs Drop-in Uniswap, Aave, bridges
Yield Manual research, claim, compound Auto-compound, cross-protocol APY comparison
DCA Manual recurring buys Automated DCA with intervals, limits, callbacks
Gas Guess gas prices Smart estimation, timing, batching
Security Manual approval checks Auto-scan & revoke risky approvals
Alerts Manual whale tracking Auto-monitor wallets, instant alerts
Multi-wallet Manage keys manually Batch ops, consolidated portfolio, wallet groups
Airdrops Manual quest hunting Auto-track campaigns, multi-wallet farming, Sybil-safe
Extensibility Hard-coded logic Plugin system โ€” community can extend anything
Error Handling Manual retry logic Auto-fallback across LLM providers & RPCs

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                        User / Application                          โ”‚
โ”‚                    "Swap 0.1 ETH to USDC on Base"                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ”‚
                               โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                          Agent Framework                            โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚ Goal      โ”‚โ†’ โ”‚ LLM Planner  โ”‚โ†’ โ”‚ Tool        โ”‚โ†’ โ”‚ Transactionโ”‚ โ”‚
โ”‚  โ”‚ Parser    โ”‚  โ”‚ (cascade)    โ”‚  โ”‚ Router      โ”‚  โ”‚ Executor   โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                                            โ”‚
                               โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                               โ”‚         Safety Layer       โ”‚        โ”‚
                               โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
                               โ”‚  โ”‚ Spend Governor          โ”‚      โ”‚ โ”‚
                               โ”‚  โ”‚ โ€ข Per-tx limits         โ”‚      โ”‚ โ”‚
                               โ”‚  โ”‚ โ€ข Daily caps            โ”‚      โ”‚ โ”‚
                               โ”‚  โ”‚ โ€ข Kill switch           โ”‚      โ”‚ โ”‚
                               โ”‚  โ”‚ โ€ข Operator confirmation โ”‚      โ”‚ โ”‚
                               โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ”‚ โ”‚
                               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                                            โ”‚
                               โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                               โ”‚      Tool Ecosystem        โ”‚        โ”‚
                               โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚        โ”‚
                               โ”‚  โ”‚ Uniswap โ”‚ โ”‚ Bridge   โ”‚ โ”‚        โ”‚
                               โ”‚  โ”‚ V2/V3   โ”‚ โ”‚ Agg.     โ”‚ โ”‚        โ”‚
                               โ”‚  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚        โ”‚
                               โ”‚  โ”‚ Sniper  โ”‚ โ”‚ Portfolioโ”‚ โ”‚        โ”‚
                               โ”‚  โ”‚ Module  โ”‚ โ”‚ Tracker  โ”‚ โ”‚        โ”‚
                               โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚        โ”‚
                               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                                            โ”‚
                               โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                               โ”‚    Chain Abstraction Layer  โ”‚        โ”‚
                               โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ” โ”‚        โ”‚
                               โ”‚  โ”‚ ETH  โ”‚ โ”‚ BASE โ”‚ โ”‚ARB โ”‚ โ”‚        โ”‚
                               โ”‚  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”ค โ”‚        โ”‚
                               โ”‚  โ”‚ OP   โ”‚ โ”‚ MATICโ”‚ โ”‚AVAXโ”‚ โ”‚        โ”‚
                               โ”‚  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”ค โ”‚        โ”‚
                               โ”‚  โ”‚ BSC  โ”‚ โ”‚      โ”‚ โ”‚    โ”‚ โ”‚        โ”‚
                               โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”˜ โ”‚        โ”‚
                               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“Š Comparison vs Alternatives

Feature Web3 Agent Kit LangChain + Web3 Custom Bot Goat SDK
Setup Time Minutes Hours Days Hours
Multi-chain 7+ chains Manual Manual Limited
Built-in LLM 6 providers DIY โŒ โŒ
DeFi Tools Uniswap, Aave, bridges โŒ โŒ Limited
Token Sniper โœ… โŒ โŒ โŒ
DCA Bot โœ… โŒ โŒ โŒ
Gas Optimizer โœ… โŒ โŒ โŒ
Approval Manager โœ… โŒ โŒ โŒ
Wallet Watcher โœ… โŒ โŒ โŒ
Yield Optimizer โœ… โŒ โŒ โŒ
Multi-Wallet โœ… โŒ โŒ โŒ
Airdrops โœ… โŒ โŒ โŒ
Plugin System โœ… โŒ โŒ โŒ
Safety Rails โœ… Governor โŒ โŒ โŒ
Natural Language โœ… Partial โŒ โŒ
Python Native โœ… โœ… Varies โŒ (TS)
Type Hints โœ… Partial Varies N/A
Active Maintenance โœ… โœ… Depends Limited

๐ŸŽฏ Quick Start

1. Install

pip install web3-agent-kit

2. Set Environment Variables

# Required: Wallet private key
export PRIVATE_KEY="0x..."

# Required: At least one LLM provider key
export OPENAI_API_KEY="sk-..."        # OpenAI
export ANTHROPIC_API_KEY="sk-ant-..."  # Anthropic (best reasoning)
export GROQ_API_KEY="gsk_..."          # Groq (fastest)
export DEEPSEEK_API_KEY="sk-..."       # DeepSeek (cheapest)

# Optional: Custom RPC endpoints (public defaults are provided)
export ETH_RPC="https://..."
export BASE_RPC="https://..."

3. Write Your First Agent

from web3_agent_kit import Agent, Wallet, Chain, ChainManager
from web3_agent_kit.defi import Uniswap

# Setup
chain_manager = ChainManager(chains=[Chain.BASE])
wallet = Wallet.from_env("PRIVATE_KEY", chain_manager=chain_manager)
uniswap = Uniswap(chain_manager=chain_manager)

# Create agent with LLM reasoning
agent = Agent(
    wallet=wallet,
    chains=[Chain.BASE],
    tools=[uniswap],
)

# Natural language swap โ€” that's it!
result = agent.run("Swap 0.1 ETH to USDC on Base")
print(result)

4. Run It

python my_agent.py

๐Ÿ’ก Tip: Start with a small amount on a testnet or use dry_run=True mode to validate behavior before going live.


โœจ Features

๐Ÿค– Core

  • ๐Ÿ”— Multi-chain support โ€” Ethereum, Base, Arbitrum, Optimism, Polygon, Avalanche, BSC
  • ๐Ÿง  LLM-powered reasoning โ€” Multi-provider cascade (OpenAI, Anthropic, Groq, DeepSeek, OpenRouter, Kimi)
  • ๐ŸŽฏ Natural language goals โ€” Tell the agent what to do in plain English
  • ๐Ÿ” Governed signing โ€” Safety caps, kill-switch, operator confirmation

๐Ÿ’ฐ DeFi

  • ๐Ÿ’ฑ Uniswap V2 swaps โ€” Actual token swaps with quotes, approvals, slippage protection
  • ๐ŸŒ‰ Cross-chain bridges โ€” Li.Fi + Socket aggregators for best routes
  • ๐Ÿ“Š Portfolio tracking โ€” Real-time balances, P&L across all chains

๐Ÿ”ซ Sniper

  • ๐ŸŽฏ Token sniper โ€” Monitor new liquidity pools, auto-buy safe tokens
  • ๐Ÿ›ก๏ธ Risk assessment โ€” Honeypot detection, liquidity checks, contract analysis
  • โšก Live monitoring โ€” Background thread with callback alerts

๐Ÿ“ˆ DCA Bot

  • ๐Ÿ”„ Recurring buys โ€” Dollar-cost average into any token automatically
  • โฐ Flexible intervals โ€” Hourly, daily, weekly, biweekly, monthly
  • ๐Ÿ›‘ Spending limits โ€” Max buys, max total spend, auto-stop
  • ๐Ÿ“Š Cost average analysis โ€” Track avg price, min/max, P&L
  • ๐Ÿ’พ Persistent orders โ€” Survives restarts, stored on disk
  • ๐Ÿ”” Callbacks โ€” Hook into execution events for notifications

๐ŸŒ REST API

Full HTTP API for all modules โ€” use from any language (JavaScript, curl, etc):

# Start the API server
python -m src.api

# Or with API key
WEB3_API_KEY=your-secret python -m src.api

Endpoints:

Endpoint Method Description
/wallet/info GET Wallet info + balance
/swap/quote GET Get swap quote
/swap/execute POST Execute token swap
/portfolio/ GET Portfolio dashboard
/gas/estimate GET Gas estimates (EIP-1559)
/gas/recommendation GET Gas timing recommendation
/watcher/list GET List watched wallets
/watcher/add POST Add wallet to watch
/approval/scan GET Scan token approvals
/approval/risk GET Risk report
/dca/orders GET/POST List/create DCA orders
/yield/opportunities GET Scan yield opportunities
/yield/best GET Find best yield
/bridge/quote GET Get bridge quote
/bridge/execute POST Execute bridge
/health GET Health check
/docs GET Swagger UI
/redoc GET ReDoc documentation

Example:

# Get gas estimate
curl http://localhost:8000/gas/estimate?chain=ethereum

# Get swap quote
curl "http://localhost:8000/swap/quote?token_in=ETH&token_out=USDC&amount_in=1.0"

# Scan approvals
curl http://localhost:8000/approval/scan?chain=ethereum

๐ŸŽฏ Showcase

Telegram Bot

A full-featured Telegram bot built with web3-agent-kit:

cd showcase/telegram-bot
pip install -r requirements.txt
python bot.py

Features: balance check, token swap, portfolio tracking, token sniper, cross-chain bridge.

Telegram Bot Demo


๐Ÿ“ฆ Examples

Example Description
examples/llm_swap_agent.py LLM-powered natural language swapping
examples/direct_swap.py Programmatic Uniswap swap without LLM
examples/token_sniper.py Monitor new pairs, auto-buy safe tokens
examples/portfolio_dashboard.py Real-time portfolio across chains
examples/bridge_agent.py Cross-chain transfers via Li.Fi/Socket
examples/swap_agent.py Autonomous token swapping
examples/yield_optimizer.py Cross-protocol yield farming + auto-compound
examples/multi_wallet.py Multi-wallet management + batch ops
examples/plugin_system.py Plugin system usage + custom plugins
examples/dca_bot.py Dollar-cost averaging bot with intervals & limits
examples/api_server.py REST API server with Swagger docs
examples/airdrop_farmer.py Multi-chain airdrop farming
examples/sniper_bot.py Token launch sniper
examples/portfolio_tracker.py Portfolio tracking & reporting
examples/llm_swap_agent.py LLM-powered natural language swapping

๐Ÿง  LLM Integration

Multi-provider cascade with automatic fallback:

from web3_agent_kit.llm import LLM

# Auto-detect from environment variables
llm = LLM()

# Cascade order: Anthropic โ†’ Kimi โ†’ OpenRouter โ†’ DeepSeek โ†’ Groq โ†’ OpenAI

# Simple chat
response = llm.chat("What is the best yield on Base?")

# JSON response
data = llm.chat_json("Analyze this swap: 0.1 ETH to USDC")

Supported providers:

  • Anthropic (Claude) โ€” Best reasoning
  • OpenAI (GPT-4) โ€” General purpose
  • Groq (Llama) โ€” Fastest inference
  • DeepSeek โ€” Cheapest
  • OpenRouter โ€” Multi-model fallback
  • Kimi โ€” Long context

๐Ÿ”ซ Token Sniper

Monitor new liquidity pools and auto-buy safe tokens:

from web3_agent_kit import TokenSniper, SniperConfig, RiskLevel

config = SniperConfig(
    max_buy=0.005,          # max 0.005 ETH per snipe
    auto_buy=True,          # auto-buy safe tokens
    honeypot_check=True,    # check if token is honeypot
    min_liquidity=0.5,      # min 0.5 ETH liquidity
)

sniper = TokenSniper(chain_manager, wallet, config, uniswap=uniswap)

# Scan recent blocks
pairs = sniper.scan_recent_blocks(num_blocks=100, chain=Chain.BASE)

# Or start live monitoring
sniper.start(chain=Chain.BASE, poll_interval=12)

๐Ÿ“Š Portfolio Dashboard

Track balances and P&L across chains:

from web3_agent_kit import PortfolioTracker

tracker = PortfolioTracker(chain_manager, wallet)
summary = tracker.get_summary()

print(summary)
# ๐Ÿ“Š Portfolio: 0x1234...
# ๐Ÿ’ฐ Total Value: $12,345.67
#
#   ๐Ÿ”— ETHEREUM: $8,000.00
#      Native: 1.5000 ETH ($5,250.00)
#      USDC: 2750.0000 ($2,750.00)
#
#   ๐Ÿ”— BASE: $4,345.67
#      Native: 1.2000 ETH ($4,200.00)
#      USDC: 145.6700 ($145.67)

๐Ÿช‚ Airdrop Automation

Discover, track, and complete airdrop campaigns across multiple platforms:

from web3_agent_kit.airdrop import (
    GalxePlatform, ZealyPlatform, GleamCampaign,
    AirdropTracker, AirdropFarmer, SocialTaskManager,
    PlatformConfig, TaskType, SybilAvoidanceConfig,
)

# Track campaigns across platforms
tracker = AirdropTracker()

# Galxe integration
galxe = GalxePlatform(config=PlatformConfig(api_key="your_key"))
galxe.login({"api_key": "your_key"})
tasks = galxe.get_tasks("campaign_id")
for task in tasks:
    galxe.complete_task(task)

# Social task automation
social = SocialTaskManager()
social.complete_social_task(TaskType.SOCIAL_TWITTER_FOLLOW, "defi_project")
social.complete_social_task(TaskType.SOCIAL_DISCORD_JOIN, "https://discord.gg/invite")

# Multi-wallet farming with Sybil avoidance
farmer = AirdropFarmer(
    wallet_manager=manager,
    group="airdrop",
    config=SybilAvoidanceConfig(
        min_delay_between_wallets=60,
        max_delay_between_wallets=600,
        max_tasks_per_wallet_per_day=10,
    ),
)
results = farmer.farm_campaign(campaign, execute=True)

# Export report
tracker.export_json("./airdrop_report.json")
tracker.export_csv("./airdrop_report.csv")

Supported platforms: Gleam.io, Zealy (Crew3), Galxe (Project Galaxy) Social tasks: Twitter, Discord, Telegram, YouTube, GitHub


๐ŸŒ‰ Bridge Agent

Cross-chain transfers via Li.Fi and Socket:

from web3_agent_kit import BridgeAgent

bridge = BridgeAgent(chain_manager, wallet)

# Get best routes
routes = bridge.get_routes("ETH", 0.1, Chain.ETHEREUM, Chain.BASE)

for route in routes:
    print(f"{route.bridge_name}: {route.amount_out:.6f} ETH (fee: ${route.fee_usd:.2f})")

# Execute transfer
result = bridge.transfer("ETH", 0.1, Chain.ETHEREUM, Chain.BASE)
print(f"TX: {result.tx_hash}")

๐ŸŒพ Yield Optimizer

Auto-compound and compare yield across DeFi protocols:

from web3_agent_kit import YieldOptimizer, YieldConfig, RiskLevel

optimizer = YieldOptimizer(wallet, Chain.ETHEREUM, YieldConfig(
    min_apy=2.0,
    max_risk=RiskLevel.MEDIUM,
    auto_compound_threshold=25,
))

# Scan & compare
opportunities = optimizer.scan_opportunities("USDC")
best = optimizer.find_best("USDC", amount=10000)

# Deposit & auto-compound
optimizer.deposit(best, amount=10000)
optimizer.auto_compound_all()

Protocols: Aave V3, Compound V3, Morpho, Lido, Rocket Pool, Fluid Data source: DeFiLlama API (real-time APY/TVL)


๐Ÿ‘› Multi-Wallet Manager

Manage multiple wallets with batch operations:

from web3_agent_kit import MultiWalletManager, Chain

manager = MultiWalletManager(chain=Chain.ETHEREUM)

# Create wallet groups
manager.create_wallet("trading-01", group="trading")
manager.create_wallet("airdrop-01", group="airdrop")

# Batch send from all airdrop wallets
results = manager.batch_send(
    recipients=["0xAddr1", "0xAddr2"],
    amount=0.001,
    group_filter="airdrop",
)

# Consolidate funds back
manager.consolidate_to("main", group_filter="airdrop")

Features: Wallet groups, batch send (native + ERC20), consolidated portfolio, fund consolidation.


๐Ÿ”Œ Plugin System

Extend with community plugins:

from web3_agent_kit.plugins import PluginManager

manager = PluginManager()
manager.load_dir("./my_plugins/")
manager.setup_all(agent)

# Plugins can hook into agent lifecycle
# manager.before_transaction(tx)
# manager.on_block(block_number)

Create a plugin:

from web3_agent_kit.plugins import Plugin, PluginMeta

class MyPlugin(Plugin):
    @property
    def meta(self):
        return PluginMeta(name="my-plugin", version="1.0.0",
                         description="Does cool things", author="You")

    def setup(self, agent):
        self.agent = agent

    def execute(self, action, **kwargs):
        return {"result": "done"}

Discovery: Local directories, Python entry points, or manual registration.


๐Ÿ“ Project Structure

web3-agent-kit/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ __init__.py         # Package exports
โ”‚   โ”œโ”€โ”€ agent.py            # Agent framework + LLM reasoning
โ”‚   โ”œโ”€โ”€ llm.py              # Multi-provider LLM client
โ”‚   โ”œโ”€โ”€ wallet.py           # Wallet management + signing
โ”‚   โ”œโ”€โ”€ chain.py            # Multi-chain RPC + config
โ”‚   โ”œโ”€โ”€ sniper.py           # Token sniper + monitoring
โ”‚   โ”œโ”€โ”€ portfolio.py        # Portfolio tracking + P&L
โ”‚   โ”œโ”€โ”€ bridge.py           # Cross-chain bridge agent
โ”‚   โ”œโ”€โ”€ yield_optimizer.py  # Yield optimizer + auto-compound
โ”‚   โ”œโ”€โ”€ multi_wallet.py     # Multi-wallet manager + batch ops
โ”‚   โ”œโ”€โ”€ airdrop/            # Airdrop automation module
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py     # Package exports
โ”‚   โ”‚   โ”œโ”€โ”€ base.py         # Base platform abstraction
โ”‚   โ”‚   โ”œโ”€โ”€ gleam.py        # Gleam.io automation
โ”‚   โ”‚   โ”œโ”€โ”€ zealy.py        # Zealy quest automation
โ”‚   โ”‚   โ”œโ”€โ”€ galxe.py        # Galxe campaign automation
โ”‚   โ”‚   โ”œโ”€โ”€ social.py       # Social task helpers
โ”‚   โ”‚   โ”œโ”€โ”€ tracker.py      # Airdrop tracker
โ”‚   โ”‚   โ””โ”€โ”€ multi_wallet.py # Multi-wallet farming
โ”‚   โ”œโ”€โ”€ plugins/
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py     # Plugin system (base, registry, manager)
โ”‚   โ”‚   โ””โ”€โ”€ examples/
โ”‚   โ”‚       โ””โ”€โ”€ gas_tracker.py
โ”‚   โ”œโ”€โ”€ api/
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py     # FastAPI REST API server
โ”‚   โ”‚   โ”œโ”€โ”€ models.py       # Pydantic request/response models
โ”‚   โ”‚   โ””โ”€โ”€ routes/         # API route handlers
โ”‚   โ””โ”€โ”€ defi/
โ”‚       โ””โ”€โ”€ __init__.py     # Uniswap, Aerodrome, Aave, Curve
โ”œโ”€โ”€ examples/               # 15 ready-to-use examples
โ”œโ”€โ”€ tests/                  # Test suite
โ””โ”€โ”€ docs/                   # Documentation

โšก Benchmarks

๐Ÿ“ Benchmarks will be published after v1.0 release. Numbers below are preliminary estimates on standard hardware.

Metric Value Notes
Swap execution (incl. LLM) ~3โ€“8s Depends on LLM provider
Swap execution (no LLM) ~1โ€“3s Direct RPC interaction
Portfolio fetch (7 chains) ~2โ€“4s Parallel RPC calls
Sniper block scan (100 blocks) ~5โ€“10s Per chain
Bridge route discovery ~1โ€“2s Aggregator API latency

Benchmarks run on: Python 3.11, 4-core CPU, SSD, public RPC endpoints.


๐Ÿ” Safety

Web3 Agent Kit includes built-in safety features:

from web3_agent_kit.safety import SpendGovernor, SpendLimits

governor = SpendGovernor(
    limits=SpendLimits(
        max_per_tx=0.1,      # max 0.1 ETH per transaction
        daily_limit=1.0,     # max 1 ETH per day
    ),
    require_confirm=True,    # operator must confirm
)

# Kill switch for emergencies
governor.kill()   # blocks all transactions
governor.unkill() # resume

๐Ÿ› ๏ธ Supported Chains

Chain Status Uniswap Bridge
Ethereum โœ… โœ… โœ…
Base โœ… โœ… โœ…
Arbitrum โœ… โœ… โœ…
Optimism โœ… โœ… โœ…
Polygon โœ… โœ… โœ…
Avalanche โœ… โ€” โœ…
BSC โœ… โ€” โœ…
Solana ๐Ÿ”œ โ€” โ€”

๐Ÿค Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.


๐Ÿ“„ License

MIT License โ€” see LICENSE for details.


๐Ÿ™ Acknowledgments

Built with:


Built by Maulana ยท Twitter

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

web3_agent_kit-1.1.0.tar.gz (184.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

web3_agent_kit-1.1.0-py3-none-any.whl (179.7 kB view details)

Uploaded Python 3

File details

Details for the file web3_agent_kit-1.1.0.tar.gz.

File metadata

  • Download URL: web3_agent_kit-1.1.0.tar.gz
  • Upload date:
  • Size: 184.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for web3_agent_kit-1.1.0.tar.gz
Algorithm Hash digest
SHA256 21a40428e3e150587ff1e48eed6920fa5cd5c037f23626e5c42ab07b7a785f24
MD5 e499a54bbb42ec675a1dead9c965266c
BLAKE2b-256 20c87cd9d68120e25f5178c251c0a0c180ed459091c69f3facbc0bcc31c035a6

See more details on using hashes here.

File details

Details for the file web3_agent_kit-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: web3_agent_kit-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 179.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for web3_agent_kit-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 31c229a6ca7ead1e40d6330205d796113d896996aab789bf543cabf9acf92d1a
MD5 0bdc5ad1638fc10899c7686b422e08ab
BLAKE2b-256 9293295c430232c7b6a7de987e864f3d92dc1fbc15b977873ad070b62dc43b90

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page