π€ Web3 Agent Kit
July 6, 2026 Β· View on GitHub
Build autonomous AI agents that interact with blockchains β in minutes, not months.
β‘ Quick Install
pip install web3-agent-kit
Verify installation:
wak info # Show version, modules, chains
wak doctor # Check dependencies
wak examples # List 19 example scripts
Run your first swap:
from web3_agent_kit import Agent
agent = Agent(private_key="0x...")
result = agent.execute("swap 0.01 ETH to USDC on Base")
print(result.tx_hash)
π€ 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 |
| CLI | Write Python for everything | wak β 7 commands, zero code |
| Multi-chain | Write adapters per chain | Built-in for 8 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 V2, Uniswap V3, Aave V3, Curve, bridges |
| Airdrops | Manual quest hunting | Auto-track 7 platforms, multi-wallet farming |
| Security Audit | Manual code review | Static analysis, fuzzing, exploit PoC |
| MEV | Build from scratch | Arbitrage, liquidation, Flashbot support |
| NFT | Write ERC-721 manually | Deploy, batch mint, marketplace listing |
| Trading | Manual recurring buys | DCA bot, yield optimizer, token sniper |
| Multi-wallet | Manage keys manually | Batch ops, consolidated portfolio |
| Restaking | Manual protocol juggling | EigenLayer + Babylon + Solana |
| Price Oracle | Hardcode prices | Chainlink + DexScreener + CoinGecko aggregator |
| TX Simulation | Hope it works | Tenderly + eth_call pre-flight verification |
| Account Abstraction | Build ERC-4337 from scratch | Bundler, paymaster, factory deployment |
| Cross-chain | Manual bridge + relay | LayerZero + Wormhole + CCIP unified API |
| Governance | Check manually | Snapshot + Tally + on-chain governor tracking |
| Extensibility | Hard-coded logic | Plugin system β extend anything |
| Error Handling | Manual retry logic | Auto-fallback across LLM providers & RPCs |
ποΈ Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β User / Application β
β "Swap 0.1 ETH to USDC on Base" / `wak agent "..."` β
ββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Agent Framework β
β βββββββββββββ ββββββββββββββββ βββββββββββββββ ββββββββββββββ β
β β Goal ββ β LLM Planner ββ β Tool ββ β Transactionβ β
β β Parser β β (6 providers)β β Router β β Executor β β
β βββββββββββββ ββββββββββββββββ βββββββββββββββ βββββββ¬βββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββ
β
ββββββββββββββββββββββββββββββΌβββββββββ
β Safety Layer β β
β βββββββββββββββββββββββββββΌβββββββ β
β β Spend Governor β β β
β β β’ Per-tx limits β β β
β β β’ Daily caps β β β
β β β’ Kill switch β β β
β β β’ Operator confirmation β β β
β βββββββββββββββββββββββββββ β β
ββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββ
β Tool Ecosystem β β
β β β
β ββββββββββββ ββββββββββββ ββββββββββββ βββββββββββ β
β β DeFi β β Airdrop β β Security β β MEV ββ β
β β β’Uniswap β β β’Galxe β β β’Static β β β’Arb ββ β
β β β’Aerodromeβ β β’Zealy β β β’Fuzzing β β β’Liq ββ β
β β β’Aave β β β’Layer3 β β β’Exploit β β β’Flash ββ β
β β β’Curve β β β’Gleam β β β’Audit β β bots ββ β
β ββββββββββββ€ ββββββββββββ€ ββββββββββββ€ ββββββββββ€β β
β β Trading β β NFT β β Portfolioβ β Bridge ββ β
β β β’DCA Bot β β β’Deploy β β β’Tracker β β β’Li.Fi ββ β
β β β’Sniper β β β’Mint β β β’P&L β β β’Socketββ β
β β β’Yield β β β’Market β β β’Alerts β β ββ β
β ββββββββββββ ββββββββββββ ββββββββββββ βββββββββββ β
β β β
β ββββββββββββ ββββββββββββ ββββββββββββ βββββββββββ β
β β Gas β β Wallet β β Plugins β βRestake ββ β
β β Optimizerβ β β’Multi β β β’Custom β ββ’Eigen ββ β
β β β β β’Watcher β β β’Communityβ ββ’Babylonββ β
β β β β β’Approvalβ β β ββ’Solana ββ β
β ββββββββββββ ββββββββββββ ββββββββββββ βββββββββββ β
β β β
β ββββββββββββ ββββββββββββ ββββββββββββ βββββββββββ β
β β Oracle β β Events β βSimulator β βAcct ββ β
β ββ’Chainlinkβ ββ’Listener β ββ’Tenderly β βAbstractββ β
β ββ’DexScrnr β ββ’Webhooks β ββ’eth_call β ββ’ERC4337ββ β
β ββ’CoinGeckoβ ββ’Callbacksβ ββ’Anvil β ββ’Paymstrββ β
β ββββββββββββ€ ββββββββββββ€ ββββββββββββ€ ββββββββββ€β β
β βMessaging β βGovernanceβ β β β ββ β
β ββ’LayerZeroβ ββ’Snapshot β β β β ββ β
β ββ’Wormhole β ββ’Tally β β β β ββ β
β ββ’CCIP β ββ’On-chain β β β β ββ β
β ββββββββββββ ββββββββββββ ββββββββββββ βββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββ
β
ββββββββββββββββββββββββββββββΌβββββββββ
β Chain Abstraction Layer β β
β ββββββββ ββββββββ ββββββ β β
β β ETH β β BASE β βARB β β β
β ββββββββ€ ββββββββ€ ββββββ€ β β
β β OP β β MATICβ βAVAXβ β β
β ββββββββ€ ββββββββ€ ββββββ€ β β
β β BSC β β SOL β β β β β
β ββββββββ ββββββββ ββββββ β β
ββββββββββββββββββββββββββββββββββββββ
π Comparison vs Alternatives
| Feature | Web3 Agent Kit | LangChain + Web3 | Custom Bot | Goat SDK |
|---|---|---|---|---|
| Setup Time | Minutes | Hours | Days | Hours |
| Multi-chain | 8 chains | Manual | Manual | Limited |
| Built-in LLM | 6 providers | DIY | β | β |
| CLI Tool | wak (7 cmds) | β | β | β |
| DeFi Tools | Uniswap V2, Uniswap V3, Aave V3, Curve | β | β | Limited |
| Airdrop Suite | 7 platforms | β | β | β |
| Security Audit | Static + Fuzz + Exploit | β | β | β |
| MEV Bots | Arbitrage + Liquidation | β | β | β |
| NFT Tools | Deploy + Mint + Market | β | β | β |
| Token Sniper | β | β | β | β |
| DCA Bot | β | β | β | β |
| Gas Optimizer | β | β | β | β |
| Multi-Wallet | β | β | β | β |
| Plugin System | β | β | β | β |
| Restaking | EigenLayer + Babylon + Solana | β | β | β |
| Safety Rails | β Governor | β | β | β |
| Natural Language | β | Partial | β | β |
| Python Native | β | β | Varies | β (TS) |
| Type Hints | β | Partial | Varies | N/A |
π― Quick Start
5 lines of code. No ceremony.
pip install web3-agent-kit
export PRIVATE_KEY="0x..."
export ANTHROPIC_API_KEY="sk-ant-..."
from web3_agent_kit import Agent, Wallet, Chain, ChainManager
from web3_agent_kit.defi import Uniswap
chain = ChainManager(chains=[Chain.BASE])
wallet = Wallet.from_env("PRIVATE_KEY", chain_manager=chain)
agent = Agent(wallet=wallet, chains=[Chain.BASE], tools=[Uniswap(chain_manager=chain)])
result = agent.run("Swap 0.1 ETH to USDC on Base")
That's it. One pip install, two env vars, five lines of Python, and your AI agent is swapping on-chain.
CLI? wak agent --goal "Swap 0.1 ETH to USDC" --chain base
More examples: wak examples or browse examples/ β 19 working scripts (DCA bot, sniper, airdrop farmer, multi-wallet, yield optimizer, bridge agent, portfolio tracker, and more).
π‘ Tip: Start with
dry_run=Trueon testnet to validate 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
π Security Module (NEW!)
- π― Honeypot detection β Check if token can be sold before buying
- π§Ά Rug pull checker β Assess rug pull risk factors
- π Contract audit β Detect hidden mint, blacklist, pause, proxy patterns
- π° Tax checker β Buy/sell tax analysis
- π§ Liquidity analysis β Locked %, lock duration
- π₯ Holder analysis β Concentration, whale detection
- π Safety score β 0-100 score with risk levels
- π GoPlus API β Real-time token security data
- π DexScreener β Liquidity data integration
πͺ Airdrop Automation (NEW!)
- π Campaign Discovery β Auto-scan 7 platforms (Galxe, Zealy, Layer3, QuestN, TaskOn, Intract, Port3)
- βοΈ On-chain Farming β DeFi interactions for airdrops (Base, Ethereum, Arbitrum, Optimism, Scroll, Linea, zkSync)
- β° Daily Scheduler β Automate recurring tasks with retry logic
- π Points Dashboard β Track points across all platforms with history
- π Referral Manager β Generate, track, and optimize referral links
- π° Faucet Claimer β Auto-claim testnet tokens from 12+ faucets
- π€ Multi-wallet β Sybil avoidance, wallet rotation
- π Plugin System β Extend with custom platform executors
π REST API
- π‘ 37+ endpoints β Full HTTP API for all modules
- π API key auth β Secure access control
- π Swagger UI β Interactive API documentation
- π Auto-fallback β Multi-provider LLM cascade
π Plugin System
- π¦ Plugin registry β Discover and load plugins dynamically
- π οΈ Custom plugins β Extend with your own tools
- π Hot reload β Add plugins without restarting
π Restaking
- π¦ EigenLayer integration β Restake LSTs, delegate to operators, track rewards
- βΏ Babylon BTC restaking β Bitcoin restaking via Babylon protocol
- βοΈ Solana restaking β Solayer, Jito, Marinade support
- π Yield optimizer β Cross-protocol restaking yield optimization with risk-adjusted scoring
- π Slashing monitor β Position tracking, slashing risk alerts, portfolio snapshots
π‘ Oracle Aggregator (NEW!)
- π Chainlink feeds β 12+ mainnet price feeds (ETH, BTC, SOL, UNI, AAVE, etc.)
- π DexScreener β Real-time DEX price data with liquidity ranking
- πͺ CoinGecko β Free API fallback for 20+ tokens
- βοΈ Weighted median β Multi-source aggregation with deviation detection
- πΎ Smart cache β 30s TTL, batch queries, automatic stale detection
π‘ Event Listener (NEW!)
- π On-chain events β Subscribe to any contract event (Transfer, Approval, custom)
- π Webhook support β HTTP POST to any URL on event trigger
- π§΅ Background polling β Multi-subscription threaded listener
- π¦ Pre-built ABIs β ERC-20 Transfer/Approval, ERC-721 Transfer
- π Status tracking β Per-subscription event count, error rate, last block
π§ͺ Transaction Simulator (NEW!)
- π Pre-flight verification β Simulate before broadcasting to catch reverts
- π Tenderly integration β Full state diff, events, gas profiling
- π΄ Local fork mode β Anvil/Hardhat impersonation testing
- β‘ eth_call mode β Fast simulation with gas estimation + safety margin
- β οΈ Smart warnings β Balance checks, approval analysis, MEV exposure
π¦ Account Abstraction (NEW!)
- π¦ ERC-4337 support β UserOperations, EntryPoint v0.6
- π Factory deployment β SimpleAccount, Safe v1.4.3, Kernel v3
- π° Paymaster integration β Pimlico gas sponsorship, token paymaster
- π Multi-chain β Ethereum, Base, Arbitrum, Optimism, Polygon
- π Counterfactual addresses β Pre-compute before deployment
π Cross-chain Messaging (NEW!)
- π‘ LayerZero β 7 chains, endpoint registry, fee estimation
- π Wormhole β Multi-chain message relay, delivery tracking
- βοΈ Chainlink CCIP β Chain selector registry, message verification
- π Status tracking β Real-time delivery status via protocol APIs
- π° Fee estimation β Per-chain cost breakdown
ποΈ Governance (NEW!)
- π Snapshot integration β GraphQL API, active proposal tracking
- π On-chain governor β OpenZeppelin Governor, proposal lifecycle
- π³οΈ Voting power β Token-weighted voting, delegation management
- π Tally API β Delegate discovery, voting history
- π·οΈ Known DAOs β Uniswap, Aave, Arbitrum, Optimism, ENS pre-configured
π 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 |
π‘ Full list of endpoints available in Swagger UI when the server is running.
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.
π¦ 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/airdrop_suite.py | Full airdrop automation suite |
examples/security_analysis.py | Token security analysis |
examples/approval_manager.py | Token approval scanning & management |
examples/gas_optimizer.py | Gas optimization & batch operations |
examples/wallet_watcher.py | Multi-wallet monitoring & alerts |
π§ LLM Integration
Multi-provider cascade with automatic fallback:
from web3_agent_kit.agent import LLM, LLMConfig
# Use any LLM provider with automatic fallback
llm = LLM(LLMConfig(
providers=["anthropic", "openai", "groq", "deepseek"],
model="claude-3-5-sonnet-20241022",
))
# Natural language β structured action
action = llm.parse("Swap 0.1 ETH to USDC on Base")
# β {"tool": "uniswap", "action": "swap", "params": {...}}
π Security Module
Analyze tokens before interacting:
from web3_agent_kit.security import TokenAnalyzer, SecurityConfig
analyzer = TokenAnalyzer(SecurityConfig(chain="base"))
# Quick check
result = analyzer.quick_check("0x...")
print(f"Is Honeypot: {result['is_honeypot']}")
# Full analysis
report = analyzer.analyze_token("0x...")
print(f"Safety Score: {report.safety_score}/100")
print(f"Risk Level: {report.risk_level.value}")
if report.is_honeypot:
print("π¨ HONEYPOT DETECTED!")
elif report.safety_score < 50:
print("β οΈ HIGH RISK TOKEN")
else:
print("β Safe to trade")
πͺ Airdrop Automation
Automate airdrop farming across multiple platforms:
from web3_agent_kit.airdrop import (
CampaignDiscovery,
OnChainAirdropFarmer,
OnChainConfig,
AirdropScheduler,
PointsDashboard,
ReferralManager,
FaucetClaimer,
)
# Discover new campaigns
discovery = CampaignDiscovery()
campaigns = discovery.discover_all()
# On-chain farming (dry run)
farmer = OnChainAirdropFarmer(OnChainConfig(chain="base", dry_run=True))
farmer.farm_plan("base_activity")
# Schedule daily tasks
scheduler = AirdropScheduler()
scheduler.add_daily("galxe_checkin", "09:00", galxe_checkin_fn)
# Track points
dashboard = PointsDashboard(DashboardConfig(wallet="0x..."))
dashboard.sync_all()
# Generate referrals
manager = ReferralManager()
manager.generate_links(count=10)
# Claim testnet tokens
claimer = FaucetClaimer()
claimer.claim_all(wallet="0x...")
π Restaking
Optimize yields across restaking protocols:
from web3_agent_kit.restaking import (
EigenLayer,
EigenLayerConfig,
RestakingOptimizer,
RestakingMonitor,
BabylonBtcRestaking,
SolanaRestaking,
)
# EigenLayer restaking
el = EigenLayer(EigenLayerConfig(chain="ethereum"))
result = el.restake("stETH", 10.0)
print(f"Restaked: {result.tx_hash}")
# Find best restaking yield
optimizer = RestakingOptimizer()
best = optimizer.find_best_opportunity(min_apy=3.0)
print(f"Best: {best.protocol} β {best.apy}% APY")
# Monitor positions
monitor = RestakingMonitor()
snapshot = monitor.get_portfolio_snapshot()
print(f"Total staked: ${snapshot.total_value_usd:,.2f}")
print(f"Slashing risk: {snapshot.total_risk_score}")
π Project Stats
- Version: 1.9.0
- Modules: 23
- Source Files: 115
- Lines of Code: 32,743
- Tests: 991
- Examples: 19
- Chains: 8
- License: MIT
π€ Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
π License
MIT License β see LICENSE for details.
π Acknowledgments
- Uniswap β DEX protocol
- Li.Fi β Bridge aggregator
- Socket β Bridge aggregator
- GoPlus β Token security API
- DexScreener β DEX data
Made with β€οΈ by @itseywacc