What is Web3 Agent Kit?
Building AI agents that interact with blockchains is hard. RPC providers, wallet management, transaction signing, gas estimation, DeFi ABIs, LLM integration, safety rails - Web3 Agent Kit handles all of that so you can ship the business logic.
Why Agent Kit
| Pain point | Without | With Agent Kit |
|---|---|---|
| Setup | Days of boilerplate | pip install → 5 lines |
| CLI | Write Python | wak - 7 commands |
| Multi-chain | Adapters per chain | 7+ chains built-in |
| LLM | Prompt engineering | Natural language goals |
| Safety | Build guardrails | Spend limits, kill switch |
| DeFi | Read docs, write ABIs | Uniswap, Aave, Curve drop-in |
| MEV | From scratch | Arb, liquidation, Flashbots |
Install
Python 3.10+ required.
pip install web3-agent-kitEnvironment
# Required: Wallet private key
export PRIVATE_KEY="0x..."
# Required: at least one LLM key
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
export GROQ_API_KEY="gsk_..."
export DEEPSEEK_API_KEY="sk-..."
# Optional: custom RPC
export ETH_RPC="https://..."
export BASE_RPC="https://..."Quickstart
Verify your environment is wired correctly, then run your first natural-language swap.
wak doctor # check env
wak info # capabilities
wak gas --chain base
wak agent --goal "swap 0.01 ETH to USDC on Base" --wallet 0x... --chain baseCLI · wak
Seven commands. Zero code.
Your first agent
from web3_agent_kit import Agent, Wallet, Chain, ChainManager
from web3_agent_kit.defi import Uniswap
chain_manager = ChainManager(chains=[Chain.BASE])
wallet = Wallet.from_env("PRIVATE_KEY", chain_manager=chain_manager)
uniswap = Uniswap(chain_manager=chain_manager)
agent = Agent(
wallet=wallet,
chains=[Chain.BASE],
tools=[uniswap],
)
# Natural language - that's it.
result = agent.run("Swap 0.1 ETH to USDC on Base")
print(result)LLM providers
Multi-provider cascade with automatic fallback. Start with one, add more for resilience.
from web3_agent_kit.agent import LLM, LLMConfig
llm = LLM(LLMConfig(
providers=["anthropic", "openai", "groq", "deepseek"],
model="claude-3-5-sonnet-20241022",
))
action = llm.parse("Swap 0.1 ETH to USDC on Base")
# → {"tool": "uniswap", "action": "swap", "params": {...}}DeFi tools
Security module
from web3_agent_kit.security import TokenAnalyzer, SecurityConfig
analyzer = TokenAnalyzer(SecurityConfig(chain="base"))
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")
else:
print("✓ Safe to trade")Airdrop automation
from web3_agent_kit.airdrop import (
CampaignDiscovery, OnChainAirdropFarmer,
AirdropScheduler, PointsDashboard,
ReferralManager, FaucetClaimer,
)
discovery = CampaignDiscovery()
campaigns = discovery.discover_all()
farmer = OnChainAirdropFarmer(OnChainConfig(chain="base", dry_run=True))
farmer.farm_plan("base_activity")
scheduler = AirdropScheduler()
scheduler.add_daily("galxe_checkin", "09:00", galxe_checkin_fn)REST API
18 endpoints + Swagger UI. Use from any language.
# Start server
python -m src.api
# Or with API key
WEB3_API_KEY=your-secret python -m src.api
curl http://localhost:8000/gas/estimate?chain=ethereum
curl "http://localhost:8000/swap/quote?token_in=ETH&token_out=USDC&amount_in=1.0"| 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) |
| /dca/orders | GET/POST | List/create DCA orders |
| /yield/best | GET | Find best yield |
| /bridge/quote | GET | Get bridge quote |
| /approval/scan | GET | Scan token approvals |
| /health | GET | Health check |
Supported chains
Plugin system
Discover and load plugins dynamically. Extend Agent Kit with your own tools - no fork required.
from web3_agent_kit.plugins import PluginRegistry
registry = PluginRegistry()
registry.discover() # auto-find installed plugins
registry.load("my_custom_dex")
agent.add_tool(registry.get("my_custom_dex"))Examples
Your agent is 5 lines away.
Install, set a key, run. The mascot will be proud.