web3-agent-kit 0.3.0__tar.gz → 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. web3_agent_kit-0.5.0/PKG-INFO +568 -0
  2. web3_agent_kit-0.5.0/README.md +534 -0
  3. {web3_agent_kit-0.3.0 → web3_agent_kit-0.5.0}/pyproject.toml +43 -2
  4. web3_agent_kit-0.5.0/src/__init__.py +70 -0
  5. web3_agent_kit-0.5.0/src/dca_bot.py +483 -0
  6. web3_agent_kit-0.5.0/src/multi_wallet.py +618 -0
  7. web3_agent_kit-0.5.0/src/plugins/__init__.py +430 -0
  8. web3_agent_kit-0.5.0/src/plugins/examples/gas_tracker.py +66 -0
  9. web3_agent_kit-0.5.0/src/yield_optimizer.py +559 -0
  10. web3_agent_kit-0.5.0/tests/test_bridge.py +143 -0
  11. web3_agent_kit-0.5.0/tests/test_dca_bot.py +255 -0
  12. web3_agent_kit-0.5.0/tests/test_defi.py +510 -0
  13. web3_agent_kit-0.5.0/tests/test_llm.py +156 -0
  14. web3_agent_kit-0.5.0/tests/test_multi_wallet.py +201 -0
  15. web3_agent_kit-0.5.0/tests/test_plugins.py +335 -0
  16. web3_agent_kit-0.5.0/tests/test_portfolio.py +175 -0
  17. web3_agent_kit-0.5.0/tests/test_sniper.py +186 -0
  18. web3_agent_kit-0.5.0/tests/test_yield_optimizer.py +262 -0
  19. web3_agent_kit-0.5.0/web3_agent_kit.egg-info/PKG-INFO +568 -0
  20. {web3_agent_kit-0.3.0 → web3_agent_kit-0.5.0}/web3_agent_kit.egg-info/SOURCES.txt +14 -0
  21. {web3_agent_kit-0.3.0 → web3_agent_kit-0.5.0}/web3_agent_kit.egg-info/requires.txt +2 -0
  22. web3_agent_kit-0.3.0/PKG-INFO +0 -333
  23. web3_agent_kit-0.3.0/README.md +0 -301
  24. web3_agent_kit-0.3.0/src/__init__.py +0 -33
  25. web3_agent_kit-0.3.0/web3_agent_kit.egg-info/PKG-INFO +0 -333
  26. {web3_agent_kit-0.3.0 → web3_agent_kit-0.5.0}/LICENSE +0 -0
  27. {web3_agent_kit-0.3.0 → web3_agent_kit-0.5.0}/setup.cfg +0 -0
  28. {web3_agent_kit-0.3.0 → web3_agent_kit-0.5.0}/setup.py +0 -0
  29. {web3_agent_kit-0.3.0 → web3_agent_kit-0.5.0}/src/agent.py +0 -0
  30. {web3_agent_kit-0.3.0 → web3_agent_kit-0.5.0}/src/bridge.py +0 -0
  31. {web3_agent_kit-0.3.0 → web3_agent_kit-0.5.0}/src/chain.py +0 -0
  32. {web3_agent_kit-0.3.0 → web3_agent_kit-0.5.0}/src/defi/__init__.py +0 -0
  33. {web3_agent_kit-0.3.0 → web3_agent_kit-0.5.0}/src/llm.py +0 -0
  34. {web3_agent_kit-0.3.0 → web3_agent_kit-0.5.0}/src/portfolio.py +0 -0
  35. {web3_agent_kit-0.3.0 → web3_agent_kit-0.5.0}/src/sniper.py +0 -0
  36. {web3_agent_kit-0.3.0 → web3_agent_kit-0.5.0}/src/utils/__init__.py +0 -0
  37. {web3_agent_kit-0.3.0 → web3_agent_kit-0.5.0}/src/wallet.py +0 -0
  38. {web3_agent_kit-0.3.0 → web3_agent_kit-0.5.0}/tests/test_core.py +0 -0
  39. {web3_agent_kit-0.3.0 → web3_agent_kit-0.5.0}/web3_agent_kit.egg-info/dependency_links.txt +0 -0
  40. {web3_agent_kit-0.3.0 → web3_agent_kit-0.5.0}/web3_agent_kit.egg-info/top_level.txt +0 -0
@@ -0,0 +1,568 @@
1
+ Metadata-Version: 2.4
2
+ Name: web3-agent-kit
3
+ Version: 0.5.0
4
+ Summary: Open-source framework for building autonomous AI agents that interact with blockchain networks
5
+ Author-email: Maulana <khasbim240803@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/ulsreall/web3-agent-kit
8
+ Project-URL: Repository, https://github.com/ulsreall/web3-agent-kit
9
+ Project-URL: Issues, https://github.com/ulsreall/web3-agent-kit/issues
10
+ Project-URL: Documentation, https://github.com/ulsreall/web3-agent-kit#readme
11
+ Keywords: web3,ai,agent,blockchain,defi,ethereum,uniswap,llm,yield,multi-wallet,plugins
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Classifier: Topic :: Office/Business :: Financial
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: web3>=6.0.0
25
+ Requires-Dist: eth-account>=0.10.0
26
+ Requires-Dist: python-dotenv>=1.0.0
27
+ Requires-Dist: requests>=2.31.0
28
+ Requires-Dist: httpx>=0.25.0
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest>=7.0; extra == "dev"
31
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
32
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
33
+ Dynamic: license-file
34
+
35
+ # 🤖 Web3 Agent Kit
36
+
37
+ > **Build autonomous AI agents that interact with blockchains — in minutes, not months.**
38
+
39
+ [![PyPI](https://img.shields.io/pypi/v/web3-agent-kit.svg)](https://pypi.org/project/web3-agent-kit/)
40
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
41
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
42
+ [![CI](https://github.com/ulsreall/web3-agent-kit/actions/workflows/ci.yml/badge.svg)](https://github.com/ulsreall/web3-agent-kit/actions)
43
+ | [![Coverage](https://img.shields.io/badge/coverage-66%25-green.svg)](https://github.com/ulsreall/web3-agent-kit#readme) |
44
+ [![Twitter](https://img.shields.io/twitter/follow/itseywacc?style=social)](https://twitter.com/itseywacc)
45
+
46
+ <p align="center">
47
+ <img src="assets/demo.gif" alt="Web3 Agent Kit Demo" width="700"/>
48
+ </p>
49
+
50
+ ---
51
+
52
+ ## 🤔 Why Web3 Agent Kit?
53
+
54
+ 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.
55
+
56
+ **Web3 Agent Kit handles all of that for you.**
57
+
58
+ | Pain Point | Without Web3 Agent Kit | With Web3 Agent Kit |
59
+ |------------|------------------------|---------------------|
60
+ | **Setup** | Days of boilerplate | `pip install` → 5 lines of code |
61
+ | **Multi-chain** | Write adapters per chain | Built-in for 7+ chains |
62
+ | **LLM Integration** | Manual prompt engineering | Natural language goals, auto-parsed |
63
+ | **Safety** | Build your own guardrails | Spend limits, kill switch, operator confirmation |
64
+ | **DeFi** | Read docs, write ABIs | Drop-in Uniswap, Aave, bridges |
65
+ | **Yield** | Manual research, claim, compound | Auto-compound, cross-protocol APY comparison |
66
+ | **DCA** | Manual recurring buys | Automated DCA with intervals, limits, callbacks |
67
+ | **Multi-wallet** | Manage keys manually | Batch ops, consolidated portfolio, wallet groups |
68
+ | **Extensibility** | Hard-coded logic | Plugin system — community can extend anything |
69
+ | **Error Handling** | Manual retry logic | Auto-fallback across LLM providers & RPCs |
70
+
71
+ ---
72
+
73
+ ## 🏗️ Architecture
74
+
75
+ ```
76
+ ┌─────────────────────────────────────────────────────────────────────┐
77
+ │ User / Application │
78
+ │ "Swap 0.1 ETH to USDC on Base" │
79
+ └──────────────────────────────┬──────────────────────────────────────┘
80
+
81
+
82
+ ┌─────────────────────────────────────────────────────────────────────┐
83
+ │ Agent Framework │
84
+ │ ┌───────────┐ ┌──────────────┐ ┌─────────────┐ ┌────────────┐ │
85
+ │ │ Goal │→ │ LLM Planner │→ │ Tool │→ │ Transaction│ │
86
+ │ │ Parser │ │ (cascade) │ │ Router │ │ Executor │ │
87
+ │ └───────────┘ └──────────────┘ └─────────────┘ └─────┬──────┘ │
88
+ └───────────────────────────────────────────────────────────┼────────┘
89
+
90
+ ┌────────────────────────────┼────────┐
91
+ │ Safety Layer │ │
92
+ │ ┌─────────────────────────┼──────┐ │
93
+ │ │ Spend Governor │ │ │
94
+ │ │ • Per-tx limits │ │ │
95
+ │ │ • Daily caps │ │ │
96
+ │ │ • Kill switch │ │ │
97
+ │ │ • Operator confirmation │ │ │
98
+ │ └─────────────────────────┘ │ │
99
+ └────────────────────────────────────┘
100
+
101
+ ┌────────────────────────────┼────────┐
102
+ │ Tool Ecosystem │ │
103
+ │ ┌─────────┐ ┌──────────┐ │ │
104
+ │ │ Uniswap │ │ Bridge │ │ │
105
+ │ │ V2/V3 │ │ Agg. │ │ │
106
+ │ ├─────────┤ ├──────────┤ │ │
107
+ │ │ Sniper │ │ Portfolio│ │ │
108
+ │ │ Module │ │ Tracker │ │ │
109
+ │ └─────────┘ └──────────┘ │ │
110
+ └────────────────────────────┼────────┘
111
+
112
+ ┌────────────────────────────┼────────┐
113
+ │ Chain Abstraction Layer │ │
114
+ │ ┌──────┐ ┌──────┐ ┌────┐ │ │
115
+ │ │ ETH │ │ BASE │ │ARB │ │ │
116
+ │ ├──────┤ ├──────┤ ├────┤ │ │
117
+ │ │ OP │ │ MATIC│ │AVAX│ │ │
118
+ │ ├──────┤ ├──────┤ ├────┤ │ │
119
+ │ │ BSC │ │ │ │ │ │ │
120
+ │ └──────┘ └──────┘ └────┘ │ │
121
+ └────────────────────────────────────┘
122
+ ```
123
+
124
+ ---
125
+
126
+ ## 📊 Comparison vs Alternatives
127
+
128
+ | Feature | Web3 Agent Kit | LangChain + Web3 | Custom Bot | Goat SDK |
129
+ |---------|:--------------:|:----------------:|:----------:|:--------:|
130
+ | **Setup Time** | Minutes | Hours | Days | Hours |
131
+ | **Multi-chain** | 7+ chains | Manual | Manual | Limited |
132
+ | **Built-in LLM** | 6 providers | DIY | ❌ | ❌ |
133
+ | **DeFi Tools** | Uniswap, Aave, bridges | ❌ | ❌ | Limited |
134
+ | **Token Sniper** | ✅ | ❌ | ❌ | ❌ |
135
+ | **DCA Bot** | ✅ | ❌ | ❌ | ❌ |
136
+ | **Yield Optimizer** | ✅ | ❌ | ❌ | ❌ |
137
+ | **Multi-Wallet** | ✅ | ❌ | ❌ | ❌ |
138
+ | **Plugin System** | ✅ | ❌ | ❌ | ❌ |
139
+ | **Safety Rails** | ✅ Governor | ❌ | ❌ | ❌ |
140
+ | **Natural Language** | ✅ | Partial | ❌ | ❌ |
141
+ | **Python Native** | ✅ | ✅ | Varies | ❌ (TS) |
142
+ | **Type Hints** | ✅ | Partial | Varies | N/A |
143
+ | **Active Maintenance** | ✅ | ✅ | Depends | Limited |
144
+
145
+ ---
146
+
147
+ ## 🎯 Quick Start
148
+
149
+ ### 1. Install
150
+
151
+ ```bash
152
+ pip install web3-agent-kit
153
+ ```
154
+
155
+ ### 2. Set Environment Variables
156
+
157
+ ```bash
158
+ # Required: Wallet private key
159
+ export PRIVATE_KEY="0x..."
160
+
161
+ # Required: At least one LLM provider key
162
+ export OPENAI_API_KEY="sk-..." # OpenAI
163
+ export ANTHROPIC_API_KEY="sk-ant-..." # Anthropic (best reasoning)
164
+ export GROQ_API_KEY="gsk_..." # Groq (fastest)
165
+ export DEEPSEEK_API_KEY="sk-..." # DeepSeek (cheapest)
166
+
167
+ # Optional: Custom RPC endpoints (public defaults are provided)
168
+ export ETH_RPC="https://..."
169
+ export BASE_RPC="https://..."
170
+ ```
171
+
172
+ ### 3. Write Your First Agent
173
+
174
+ ```python
175
+ from web3_agent_kit import Agent, Wallet, Chain, ChainManager
176
+ from web3_agent_kit.defi import Uniswap
177
+
178
+ # Setup
179
+ chain_manager = ChainManager(chains=[Chain.BASE])
180
+ wallet = Wallet.from_env("PRIVATE_KEY", chain_manager=chain_manager)
181
+ uniswap = Uniswap(chain_manager=chain_manager)
182
+
183
+ # Create agent with LLM reasoning
184
+ agent = Agent(
185
+ wallet=wallet,
186
+ chains=[Chain.BASE],
187
+ tools=[uniswap],
188
+ )
189
+
190
+ # Natural language swap — that's it!
191
+ result = agent.run("Swap 0.1 ETH to USDC on Base")
192
+ print(result)
193
+ ```
194
+
195
+ ### 4. Run It
196
+
197
+ ```bash
198
+ python my_agent.py
199
+ ```
200
+
201
+ > 💡 **Tip:** Start with a small amount on a testnet or use `dry_run=True` mode to validate behavior before going live.
202
+
203
+ ---
204
+
205
+ ## ✨ Features
206
+
207
+ ### 🤖 Core
208
+ - 🔗 **Multi-chain support** — Ethereum, Base, Arbitrum, Optimism, Polygon, Avalanche, BSC
209
+ - 🧠 **LLM-powered reasoning** — Multi-provider cascade (OpenAI, Anthropic, Groq, DeepSeek, OpenRouter, Kimi)
210
+ - 🎯 **Natural language goals** — Tell the agent what to do in plain English
211
+ - 🔐 **Governed signing** — Safety caps, kill-switch, operator confirmation
212
+
213
+ ### 💰 DeFi
214
+ - 💱 **Uniswap V2 swaps** — Actual token swaps with quotes, approvals, slippage protection
215
+ - 🌉 **Cross-chain bridges** — Li.Fi + Socket aggregators for best routes
216
+ - 📊 **Portfolio tracking** — Real-time balances, P&L across all chains
217
+
218
+ ### 🔫 Sniper
219
+ - 🎯 **Token sniper** — Monitor new liquidity pools, auto-buy safe tokens
220
+ - 🛡️ **Risk assessment** — Honeypot detection, liquidity checks, contract analysis
221
+ - ⚡ **Live monitoring** — Background thread with callback alerts
222
+
223
+ ### 📈 DCA Bot
224
+ - 🔄 **Recurring buys** — Dollar-cost average into any token automatically
225
+ - ⏰ **Flexible intervals** — Hourly, daily, weekly, biweekly, monthly
226
+ - 🛑 **Spending limits** — Max buys, max total spend, auto-stop
227
+ - 📊 **Cost average analysis** — Track avg price, min/max, P&L
228
+ - 💾 **Persistent orders** — Survives restarts, stored on disk
229
+ - 🔔 **Callbacks** — Hook into execution events for notifications
230
+
231
+ ---
232
+
233
+ ## 🎯 Showcase
234
+
235
+ ### Telegram Bot
236
+ A full-featured Telegram bot built with web3-agent-kit:
237
+
238
+ ```bash
239
+ cd showcase/telegram-bot
240
+ pip install -r requirements.txt
241
+ python bot.py
242
+ ```
243
+
244
+ Features: balance check, token swap, portfolio tracking, token sniper, cross-chain bridge.
245
+
246
+ [![Telegram Bot Demo](showcase/telegram-bot/demo.gif)](showcase/telegram-bot/)
247
+
248
+ ---
249
+
250
+ ## 📦 Examples
251
+
252
+ | Example | Description |
253
+ |---------|-------------|
254
+ | `examples/llm_swap_agent.py` | LLM-powered natural language swapping |
255
+ | `examples/direct_swap.py` | Programmatic Uniswap swap without LLM |
256
+ | `examples/token_sniper.py` | Monitor new pairs, auto-buy safe tokens |
257
+ | `examples/portfolio_dashboard.py` | Real-time portfolio across chains |
258
+ | `examples/bridge_agent.py` | Cross-chain transfers via Li.Fi/Socket |
259
+ | `examples/swap_agent.py` | Autonomous token swapping |
260
+ | `examples/yield_optimizer.py` | Cross-protocol yield farming + auto-compound |
261
+ | `examples/multi_wallet.py` | Multi-wallet management + batch ops |
262
+ | `examples/plugin_system.py` | Plugin system usage + custom plugins |
263
+ | `examples/dca_bot.py` | Dollar-cost averaging bot with intervals & limits |
264
+ | `examples/airdrop_farmer.py` | Multi-chain airdrop farming |
265
+ | `examples/sniper_bot.py` | Token launch sniper |
266
+ | `examples/portfolio_tracker.py` | Portfolio tracking & reporting |
267
+ | `examples/llm_swap_agent.py` | LLM-powered natural language swapping |
268
+
269
+ ---
270
+
271
+ ## 🧠 LLM Integration
272
+
273
+ Multi-provider cascade with automatic fallback:
274
+
275
+ ```python
276
+ from web3_agent_kit.llm import LLM
277
+
278
+ # Auto-detect from environment variables
279
+ llm = LLM()
280
+
281
+ # Cascade order: Anthropic → Kimi → OpenRouter → DeepSeek → Groq → OpenAI
282
+
283
+ # Simple chat
284
+ response = llm.chat("What is the best yield on Base?")
285
+
286
+ # JSON response
287
+ data = llm.chat_json("Analyze this swap: 0.1 ETH to USDC")
288
+ ```
289
+
290
+ **Supported providers:**
291
+ - **Anthropic** (Claude) — Best reasoning
292
+ - **OpenAI** (GPT-4) — General purpose
293
+ - **Groq** (Llama) — Fastest inference
294
+ - **DeepSeek** — Cheapest
295
+ - **OpenRouter** — Multi-model fallback
296
+ - **Kimi** — Long context
297
+
298
+ ---
299
+
300
+ ## 🔫 Token Sniper
301
+
302
+ Monitor new liquidity pools and auto-buy safe tokens:
303
+
304
+ ```python
305
+ from web3_agent_kit import TokenSniper, SniperConfig, RiskLevel
306
+
307
+ config = SniperConfig(
308
+ max_buy=0.005, # max 0.005 ETH per snipe
309
+ auto_buy=True, # auto-buy safe tokens
310
+ honeypot_check=True, # check if token is honeypot
311
+ min_liquidity=0.5, # min 0.5 ETH liquidity
312
+ )
313
+
314
+ sniper = TokenSniper(chain_manager, wallet, config, uniswap=uniswap)
315
+
316
+ # Scan recent blocks
317
+ pairs = sniper.scan_recent_blocks(num_blocks=100, chain=Chain.BASE)
318
+
319
+ # Or start live monitoring
320
+ sniper.start(chain=Chain.BASE, poll_interval=12)
321
+ ```
322
+
323
+ ---
324
+
325
+ ## 📊 Portfolio Dashboard
326
+
327
+ Track balances and P&L across chains:
328
+
329
+ ```python
330
+ from web3_agent_kit import PortfolioTracker
331
+
332
+ tracker = PortfolioTracker(chain_manager, wallet)
333
+ summary = tracker.get_summary()
334
+
335
+ print(summary)
336
+ # 📊 Portfolio: 0x1234...
337
+ # 💰 Total Value: $12,345.67
338
+ #
339
+ # 🔗 ETHEREUM: $8,000.00
340
+ # Native: 1.5000 ETH ($5,250.00)
341
+ # USDC: 2750.0000 ($2,750.00)
342
+ #
343
+ # 🔗 BASE: $4,345.67
344
+ # Native: 1.2000 ETH ($4,200.00)
345
+ # USDC: 145.6700 ($145.67)
346
+ ```
347
+
348
+ ---
349
+
350
+ ## 🌉 Bridge Agent
351
+
352
+ Cross-chain transfers via Li.Fi and Socket:
353
+
354
+ ```python
355
+ from web3_agent_kit import BridgeAgent
356
+
357
+ bridge = BridgeAgent(chain_manager, wallet)
358
+
359
+ # Get best routes
360
+ routes = bridge.get_routes("ETH", 0.1, Chain.ETHEREUM, Chain.BASE)
361
+
362
+ for route in routes:
363
+ print(f"{route.bridge_name}: {route.amount_out:.6f} ETH (fee: ${route.fee_usd:.2f})")
364
+
365
+ # Execute transfer
366
+ result = bridge.transfer("ETH", 0.1, Chain.ETHEREUM, Chain.BASE)
367
+ print(f"TX: {result.tx_hash}")
368
+ ```
369
+
370
+ ---
371
+
372
+ ## 🌾 Yield Optimizer
373
+
374
+ Auto-compound and compare yield across DeFi protocols:
375
+
376
+ ```python
377
+ from web3_agent_kit import YieldOptimizer, YieldConfig, RiskLevel
378
+
379
+ optimizer = YieldOptimizer(wallet, Chain.ETHEREUM, YieldConfig(
380
+ min_apy=2.0,
381
+ max_risk=RiskLevel.MEDIUM,
382
+ auto_compound_threshold=25,
383
+ ))
384
+
385
+ # Scan & compare
386
+ opportunities = optimizer.scan_opportunities("USDC")
387
+ best = optimizer.find_best("USDC", amount=10000)
388
+
389
+ # Deposit & auto-compound
390
+ optimizer.deposit(best, amount=10000)
391
+ optimizer.auto_compound_all()
392
+ ```
393
+
394
+ **Protocols:** Aave V3, Compound V3, Morpho, Lido, Rocket Pool, Fluid
395
+ **Data source:** DeFiLlama API (real-time APY/TVL)
396
+
397
+ ---
398
+
399
+ ## 👛 Multi-Wallet Manager
400
+
401
+ Manage multiple wallets with batch operations:
402
+
403
+ ```python
404
+ from web3_agent_kit import MultiWalletManager, Chain
405
+
406
+ manager = MultiWalletManager(chain=Chain.ETHEREUM)
407
+
408
+ # Create wallet groups
409
+ manager.create_wallet("trading-01", group="trading")
410
+ manager.create_wallet("airdrop-01", group="airdrop")
411
+
412
+ # Batch send from all airdrop wallets
413
+ results = manager.batch_send(
414
+ recipients=["0xAddr1", "0xAddr2"],
415
+ amount=0.001,
416
+ group_filter="airdrop",
417
+ )
418
+
419
+ # Consolidate funds back
420
+ manager.consolidate_to("main", group_filter="airdrop")
421
+ ```
422
+
423
+ **Features:** Wallet groups, batch send (native + ERC20), consolidated portfolio, fund consolidation.
424
+
425
+ ---
426
+
427
+ ## 🔌 Plugin System
428
+
429
+ Extend with community plugins:
430
+
431
+ ```python
432
+ from web3_agent_kit.plugins import PluginManager
433
+
434
+ manager = PluginManager()
435
+ manager.load_dir("./my_plugins/")
436
+ manager.setup_all(agent)
437
+
438
+ # Plugins can hook into agent lifecycle
439
+ # manager.before_transaction(tx)
440
+ # manager.on_block(block_number)
441
+ ```
442
+
443
+ **Create a plugin:**
444
+
445
+ ```python
446
+ from web3_agent_kit.plugins import Plugin, PluginMeta
447
+
448
+ class MyPlugin(Plugin):
449
+ @property
450
+ def meta(self):
451
+ return PluginMeta(name="my-plugin", version="1.0.0",
452
+ description="Does cool things", author="You")
453
+
454
+ def setup(self, agent):
455
+ self.agent = agent
456
+
457
+ def execute(self, action, **kwargs):
458
+ return {"result": "done"}
459
+ ```
460
+
461
+ **Discovery:** Local directories, Python entry points, or manual registration.
462
+
463
+ ---
464
+
465
+ ## 📁 Project Structure
466
+
467
+ ```
468
+ web3-agent-kit/
469
+ ├── src/
470
+ │ ├── __init__.py # Package exports
471
+ │ ├── agent.py # Agent framework + LLM reasoning
472
+ │ ├── llm.py # Multi-provider LLM client
473
+ │ ├── wallet.py # Wallet management + signing
474
+ │ ├── chain.py # Multi-chain RPC + config
475
+ │ ├── sniper.py # Token sniper + monitoring
476
+ │ ├── portfolio.py # Portfolio tracking + P&L
477
+ │ ├── bridge.py # Cross-chain bridge agent
478
+ │ ├── yield_optimizer.py # Yield optimizer + auto-compound
479
+ │ ├── multi_wallet.py # Multi-wallet manager + batch ops
480
+ │ ├── plugins/
481
+ │ │ ├── __init__.py # Plugin system (base, registry, manager)
482
+ │ │ └── examples/
483
+ │ │ └── gas_tracker.py
484
+ │ └── defi/
485
+ │ └── __init__.py # Uniswap, Aerodrome, Aave, Curve
486
+ ├── examples/ # 13 ready-to-use examples
487
+ ├── tests/ # Test suite
488
+ └── docs/ # Documentation
489
+ ```
490
+
491
+ ---
492
+
493
+ ## ⚡ Benchmarks
494
+
495
+ > 📝 *Benchmarks will be published after v1.0 release. Numbers below are preliminary estimates on standard hardware.*
496
+
497
+ | Metric | Value | Notes |
498
+ |--------|-------|-------|
499
+ | Swap execution (incl. LLM) | ~3–8s | Depends on LLM provider |
500
+ | Swap execution (no LLM) | ~1–3s | Direct RPC interaction |
501
+ | Portfolio fetch (7 chains) | ~2–4s | Parallel RPC calls |
502
+ | Sniper block scan (100 blocks) | ~5–10s | Per chain |
503
+ | Bridge route discovery | ~1–2s | Aggregator API latency |
504
+
505
+ *Benchmarks run on: Python 3.11, 4-core CPU, SSD, public RPC endpoints.*
506
+
507
+ ---
508
+
509
+ ## 🔐 Safety
510
+
511
+ Web3 Agent Kit includes built-in safety features:
512
+
513
+ ```python
514
+ from web3_agent_kit.safety import SpendGovernor, SpendLimits
515
+
516
+ governor = SpendGovernor(
517
+ limits=SpendLimits(
518
+ max_per_tx=0.1, # max 0.1 ETH per transaction
519
+ daily_limit=1.0, # max 1 ETH per day
520
+ ),
521
+ require_confirm=True, # operator must confirm
522
+ )
523
+
524
+ # Kill switch for emergencies
525
+ governor.kill() # blocks all transactions
526
+ governor.unkill() # resume
527
+ ```
528
+
529
+ ---
530
+
531
+ ## 🛠️ Supported Chains
532
+
533
+ | Chain | Status | Uniswap | Bridge |
534
+ |-------|--------|---------|--------|
535
+ | Ethereum | ✅ | ✅ | ✅ |
536
+ | Base | ✅ | ✅ | ✅ |
537
+ | Arbitrum | ✅ | ✅ | ✅ |
538
+ | Optimism | ✅ | ✅ | ✅ |
539
+ | Polygon | ✅ | ✅ | ✅ |
540
+ | Avalanche | ✅ | — | ✅ |
541
+ | BSC | ✅ | — | ✅ |
542
+ | Solana | 🔜 | — | — |
543
+
544
+ ---
545
+
546
+ ## 🤝 Contributing
547
+
548
+ We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
549
+
550
+ ---
551
+
552
+ ## 📄 License
553
+
554
+ MIT License — see [LICENSE](LICENSE) for details.
555
+
556
+ ---
557
+
558
+ ## 🙏 Acknowledgments
559
+
560
+ Built with:
561
+ - [web3.py](https://github.com/ethereum/web3.py) — Ethereum interactions
562
+ - [OpenAI](https://openai.com) / [Anthropic](https://anthropic.com) / [Groq](https://groq.com) — LLM providers
563
+ - [Uniswap](https://uniswap.org) — DEX protocol
564
+ - [Li.Fi](https://li.fi) / [Socket](https://socket.tech) — Bridge aggregators
565
+
566
+ ---
567
+
568
+ **Built by [Maulana](https://github.com/ulsreall)** · [Twitter](https://twitter.com/itseywacc)