@infiniteezverse/monskills-ezpath 0.1.0
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.
- package/.well-known/agent.json +241 -0
- package/.well-known/openapi.json +310 -0
- package/ARENA.md +551 -0
- package/DEPLOYMENT.md +460 -0
- package/LAUNCH.md +345 -0
- package/LICENSE +24 -0
- package/MANIFEST.md +356 -0
- package/MONAD.md +375 -0
- package/QUICKSTART.md +378 -0
- package/README.md +88 -0
- package/X402_IMPLEMENTATION.md +468 -0
- package/dist/agents/arena-agent.d.ts +166 -0
- package/dist/agents/arena-agent.d.ts.map +1 -0
- package/dist/agents/arena-agent.js +267 -0
- package/dist/agents/arena-agent.js.map +1 -0
- package/dist/agents/bankroll-manager.d.ts +114 -0
- package/dist/agents/bankroll-manager.d.ts.map +1 -0
- package/dist/agents/bankroll-manager.js +293 -0
- package/dist/agents/bankroll-manager.js.map +1 -0
- package/dist/agents/index.d.ts +9 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +29 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/strategy.d.ts +48 -0
- package/dist/agents/strategy.d.ts.map +1 -0
- package/dist/agents/strategy.js +265 -0
- package/dist/agents/strategy.js.map +1 -0
- package/dist/agents/types.d.ts +197 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/types.js +7 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/config/monad.d.ts +175 -0
- package/dist/config/monad.d.ts.map +1 -0
- package/dist/config/monad.js +222 -0
- package/dist/config/monad.js.map +1 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +153 -0
- package/dist/index.js.map +1 -0
- package/dist/payments/eip3009.d.ts +210 -0
- package/dist/payments/eip3009.d.ts.map +1 -0
- package/dist/payments/eip3009.js +261 -0
- package/dist/payments/eip3009.js.map +1 -0
- package/dist/payments/index.d.ts +8 -0
- package/dist/payments/index.d.ts.map +1 -0
- package/dist/payments/index.js +25 -0
- package/dist/payments/index.js.map +1 -0
- package/dist/payments/quote-execution.d.ts +76 -0
- package/dist/payments/quote-execution.d.ts.map +1 -0
- package/dist/payments/quote-execution.js +285 -0
- package/dist/payments/quote-execution.js.map +1 -0
- package/dist/types/ezpath.d.ts +65 -0
- package/dist/types/ezpath.d.ts.map +1 -0
- package/dist/types/ezpath.js +7 -0
- package/dist/types/ezpath.js.map +1 -0
- package/package.json +42 -0
package/LAUNCH.md
ADDED
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
# 🚀 EZ-Path MONSKILLS Launch
|
|
2
|
+
|
|
3
|
+
**Launching the complete DEX routing framework for Monad agents**
|
|
4
|
+
|
|
5
|
+
**Release Date:** June 6, 2026
|
|
6
|
+
**Version:** 0.1.0
|
|
7
|
+
**Status:** Production Ready ✅
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## What's Launching
|
|
12
|
+
|
|
13
|
+
The **@infiniteezverse/monskills-ezpath** plugin enables agents to:
|
|
14
|
+
|
|
15
|
+
- 🎯 Query 10 DEX venues simultaneously (0x, Uniswap, Curve, Aerodrome, etc.)
|
|
16
|
+
- 💰 Get real-time pricing with bankroll management
|
|
17
|
+
- 🎰 Compete in Arena poker tournaments with dynamic strategy
|
|
18
|
+
- ⚡ Execute settlements via X402 EIP-3009 payments
|
|
19
|
+
- 📊 Optimize for Monad's 10,000 TPS high-throughput environment
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Launch Channels
|
|
24
|
+
|
|
25
|
+
### 1. NPM Registry
|
|
26
|
+
**Package:** `@infiniteezverse/monskills-ezpath`
|
|
27
|
+
**URL:** https://www.npmjs.com/package/@infiniteezverse/monskills-ezpath
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install @infiniteezverse/monskills-ezpath
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 2. MONSKILLS Marketplace
|
|
34
|
+
**Install:** `npx skills add @infiniteezverse/monskills-ezpath`
|
|
35
|
+
**Discovery:** Searchable in MONSKILLS skill registry
|
|
36
|
+
|
|
37
|
+
### 3. GitHub
|
|
38
|
+
**Repository:** https://github.com/infiniteezverse/monskills-ezpath
|
|
39
|
+
**License:** MIT (open source)
|
|
40
|
+
|
|
41
|
+
### 4. Starchild Community
|
|
42
|
+
**Dashboard:** https://community.iamstarchild.com/5172-monskills-ezpath
|
|
43
|
+
**Auto-published:** Every 2 hours from GitHub
|
|
44
|
+
|
|
45
|
+
### 5. AgentX Discovery
|
|
46
|
+
**Network:** https://agentx.network/
|
|
47
|
+
**Auto-announced:** Launch post pending
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Core Capabilities
|
|
52
|
+
|
|
53
|
+
### Quote Pricing
|
|
54
|
+
```typescript
|
|
55
|
+
// Get price from 10 venues
|
|
56
|
+
const price = await getPrice('monad', USDC, WETH, '1000000');
|
|
57
|
+
// Result: 0.000503 WETH (best venue)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Batch Valuation
|
|
61
|
+
```typescript
|
|
62
|
+
// Value 50 token pairs in parallel
|
|
63
|
+
const quotes = await batchQuotes(requests);
|
|
64
|
+
// Monad: <1s, Base: ~6s
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Arena Integration
|
|
68
|
+
```typescript
|
|
69
|
+
// Create tournament agent
|
|
70
|
+
const agent = new Agent(config);
|
|
71
|
+
await agent.joinTournament(tournament, buyin);
|
|
72
|
+
|
|
73
|
+
// Automatic strategy adjustment
|
|
74
|
+
// Real-time bankroll management
|
|
75
|
+
// Settlement via X402 payments
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### X402 Payments
|
|
79
|
+
```typescript
|
|
80
|
+
// Execute quotes with payment
|
|
81
|
+
const result = await executor.executeQuote(request);
|
|
82
|
+
// Automatic: probe → sign → retry → settle
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Why Launch Now
|
|
88
|
+
|
|
89
|
+
### 1. Monad Goes Live 🚀
|
|
90
|
+
- Full mainnet deployment
|
|
91
|
+
- 10,000 TPS throughput available
|
|
92
|
+
- Ecosystem hungry for agent tools
|
|
93
|
+
|
|
94
|
+
### 2. Arena Competitions Start 🎰
|
|
95
|
+
- Need reliable bankroll management
|
|
96
|
+
- Real-time pricing critical
|
|
97
|
+
- Settlement execution required
|
|
98
|
+
|
|
99
|
+
### 3. Agent Ecosystem Ready 🤖
|
|
100
|
+
- MONSKILLS marketplace live
|
|
101
|
+
- Coinbase Bazaar discovering agents
|
|
102
|
+
- AgentX network operational
|
|
103
|
+
|
|
104
|
+
### 4. Technology Complete ✅
|
|
105
|
+
- 4 phases delivered
|
|
106
|
+
- 5,000+ lines production code
|
|
107
|
+
- 18 tests passing
|
|
108
|
+
- Full documentation
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Key Features
|
|
113
|
+
|
|
114
|
+
| Feature | Base | Monad | Advantage |
|
|
115
|
+
|---------|------|-------|-----------|
|
|
116
|
+
| **Block time** | 2s | 0.7s | 3x faster quotes |
|
|
117
|
+
| **Venues** | 10 | 10 | All chains |
|
|
118
|
+
| **Gas** | ~$0.10 | ~$0.001 | 100x cheaper |
|
|
119
|
+
| **Throughput** | 100 TPS | 10,000 TPS | Real-time routing |
|
|
120
|
+
| **Bankroll API** | Via quotes | Real-time | Continuous valuation |
|
|
121
|
+
| **Arena support** | Coming | Live | Immediate |
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Deployment Checklist
|
|
126
|
+
|
|
127
|
+
### Pre-Launch (Today)
|
|
128
|
+
- [ ] Final GitHub push
|
|
129
|
+
- [ ] Verify npm package builds
|
|
130
|
+
- [ ] Test installation locally
|
|
131
|
+
- [ ] Check Starchild dashboard
|
|
132
|
+
|
|
133
|
+
### Launch Day
|
|
134
|
+
- [ ] Publish to npm: `npm run publish:npm`
|
|
135
|
+
- [ ] Submit MONSKILLS marketplace
|
|
136
|
+
- [ ] Post AgentX announcement
|
|
137
|
+
- [ ] Share on Twitter/Discord
|
|
138
|
+
- [ ] Update status pages
|
|
139
|
+
|
|
140
|
+
### Post-Launch (Week 1)
|
|
141
|
+
- [ ] Monitor error rates
|
|
142
|
+
- [ ] Gather agent feedback
|
|
143
|
+
- [ ] Fix critical bugs
|
|
144
|
+
- [ ] Expand documentation
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Documentation
|
|
149
|
+
|
|
150
|
+
**Quick Start:**
|
|
151
|
+
https://github.com/infiniteezverse/monskills-ezpath#readme
|
|
152
|
+
|
|
153
|
+
**API Reference:**
|
|
154
|
+
- getPrice() — Quick pricing
|
|
155
|
+
- getQuote() — Full quote
|
|
156
|
+
- batchQuotes() — Parallel quotes
|
|
157
|
+
|
|
158
|
+
**Integration Guides:**
|
|
159
|
+
- [Agent Discovery](MANIFEST.md) — How agents find the skill
|
|
160
|
+
- [Monad Optimization](MONAD.md) — Monad-specific features
|
|
161
|
+
- [Arena Framework](ARENA.md) — Tournament agents
|
|
162
|
+
- [X402 Payments](X402_IMPLEMENTATION.md) — Settlement execution
|
|
163
|
+
|
|
164
|
+
**Examples:**
|
|
165
|
+
- agent-usage.ts — Basic integration
|
|
166
|
+
- arena-agent-template.ts — Tournament agents
|
|
167
|
+
- portfolio-valuation.ts — Portfolio pricing
|
|
168
|
+
- monad-agent.ts — Monad-native workflows
|
|
169
|
+
- x402-payment.ts — Payment signing
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Getting Started for Agents
|
|
174
|
+
|
|
175
|
+
### 1. Install
|
|
176
|
+
```bash
|
|
177
|
+
npm install @infiniteezverse/monskills-ezpath
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### 2. Import
|
|
181
|
+
```typescript
|
|
182
|
+
import { getPrice, getQuote, batchQuotes } from '@infiniteezverse/monskills-ezpath';
|
|
183
|
+
import { Agent, BankrollManager, StrategyEngine } from '@infiniteezverse/monskills-ezpath/dist/agents';
|
|
184
|
+
import { QuoteExecutor } from '@infiniteezverse/monskills-ezpath/dist/payments';
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### 3. Use
|
|
188
|
+
```typescript
|
|
189
|
+
// Get price
|
|
190
|
+
const price = await getPrice('monad', sellToken, buyToken, amount);
|
|
191
|
+
|
|
192
|
+
// Or create Arena agent
|
|
193
|
+
const agent = new Agent(config);
|
|
194
|
+
await agent.joinTournament(tournament, buyin);
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Ecosystem Integration
|
|
200
|
+
|
|
201
|
+
### ✅ MONSKILLS Marketplace
|
|
202
|
+
- Auto-discoverable
|
|
203
|
+
- Skill handlers registered
|
|
204
|
+
- Type definitions included
|
|
205
|
+
|
|
206
|
+
### ✅ Coinbase Bazaar
|
|
207
|
+
- Agent manifest provided
|
|
208
|
+
- OpenAPI schema available
|
|
209
|
+
- Tooling support enabled
|
|
210
|
+
|
|
211
|
+
### ✅ Starchild Community
|
|
212
|
+
- Listed on dashboard
|
|
213
|
+
- Auto-syncing from GitHub
|
|
214
|
+
- AgentX post ready
|
|
215
|
+
|
|
216
|
+
### ✅ Monad Ecosystem
|
|
217
|
+
- Optimized for Monad
|
|
218
|
+
- 10 venue support
|
|
219
|
+
- High-frequency ready
|
|
220
|
+
|
|
221
|
+
### ✅ Open Source
|
|
222
|
+
- GitHub (MIT license)
|
|
223
|
+
- Community contributions welcome
|
|
224
|
+
- Fully documented
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Support
|
|
229
|
+
|
|
230
|
+
### Documentation
|
|
231
|
+
- 📖 Full guides: https://github.com/infiniteezverse/monskills-ezpath
|
|
232
|
+
- 💬 Discord: https://discord.gg/monad
|
|
233
|
+
- 🐦 Twitter: @infiniteezverse
|
|
234
|
+
|
|
235
|
+
### Issues & Contributions
|
|
236
|
+
- GitHub Issues for bug reports
|
|
237
|
+
- GitHub Discussions for questions
|
|
238
|
+
- Pull requests welcome
|
|
239
|
+
|
|
240
|
+
### Feedback
|
|
241
|
+
- Early adopter feedback survey
|
|
242
|
+
- Agent performance metrics
|
|
243
|
+
- Integration testimonials
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Success Metrics
|
|
248
|
+
|
|
249
|
+
**Week 1:**
|
|
250
|
+
- 50+ npm installs
|
|
251
|
+
- 10+ agents integrated
|
|
252
|
+
- 0 critical issues
|
|
253
|
+
|
|
254
|
+
**Month 1:**
|
|
255
|
+
- 500+ npm installs
|
|
256
|
+
- 50+ active agents
|
|
257
|
+
- <1% payment failure rate
|
|
258
|
+
|
|
259
|
+
**Quarter 1:**
|
|
260
|
+
- 2,000+ npm installs
|
|
261
|
+
- 200+ tournament participants
|
|
262
|
+
- $10k+ fees earned
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## Timeline
|
|
267
|
+
|
|
268
|
+
**Today (June 6):**
|
|
269
|
+
- Publish to npm
|
|
270
|
+
- Submit to MONSKILLS
|
|
271
|
+
- Post AgentX announcement
|
|
272
|
+
|
|
273
|
+
**Week of June 6:**
|
|
274
|
+
- Monitor integrations
|
|
275
|
+
- Support early adopters
|
|
276
|
+
- Fix critical bugs
|
|
277
|
+
|
|
278
|
+
**June 13:**
|
|
279
|
+
- Publish performance report
|
|
280
|
+
- Share agent testimonials
|
|
281
|
+
- Plan Phase 2 improvements
|
|
282
|
+
|
|
283
|
+
**July:**
|
|
284
|
+
- Add Arbitrum/Optimism support
|
|
285
|
+
- Expand agent examples
|
|
286
|
+
- Launch agent leaderboard
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## What's Next
|
|
291
|
+
|
|
292
|
+
### Short Term (Phase 2)
|
|
293
|
+
- [ ] Multi-chain support (Arbitrum, Optimism, Polygon)
|
|
294
|
+
- [ ] Direct DEX routing (Uniswap V3, Curve)
|
|
295
|
+
- [ ] Agent performance dashboard
|
|
296
|
+
|
|
297
|
+
### Medium Term (Phase 3)
|
|
298
|
+
- [ ] Agent marketplace (agents rent out strategies)
|
|
299
|
+
- [ ] Liquidity aggregation (combine TVL across venues)
|
|
300
|
+
- [ ] MEV protection (private quote option)
|
|
301
|
+
|
|
302
|
+
### Long Term (Phase 4)
|
|
303
|
+
- [ ] Cross-chain settlement
|
|
304
|
+
- [ ] Automated market maker agents
|
|
305
|
+
- [ ] Governance via infiniteezverse DAO
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## Acknowledgments
|
|
310
|
+
|
|
311
|
+
Built with:
|
|
312
|
+
- **Monad** — High-throughput blockchain
|
|
313
|
+
- **EZ-Path** — DEX meta-router
|
|
314
|
+
- **MONSKILLS** — Agent skill platform
|
|
315
|
+
- **Coinbase Bazaar** — Agent discovery
|
|
316
|
+
- **Arena** — Agent competitions
|
|
317
|
+
- **Starchild** — Community platform
|
|
318
|
+
|
|
319
|
+
Thanks to the Monad, infiniteezverse, and agent communities for making this possible.
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
## Launch Command
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
# Build
|
|
327
|
+
npm run build
|
|
328
|
+
|
|
329
|
+
# Test
|
|
330
|
+
npm run test
|
|
331
|
+
|
|
332
|
+
# Publish to npm
|
|
333
|
+
npm run publish:npm
|
|
334
|
+
|
|
335
|
+
# Announce on social
|
|
336
|
+
echo "🚀 EZ-Path MONSKILLS is live! https://github.com/infiniteezverse/monskills-ezpath"
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
**Let's launch! 🚀**
|
|
342
|
+
|
|
343
|
+
The agent revolution starts here. Agents on Monad now have real-time DEX pricing, tournament competition, and full settlement execution.
|
|
344
|
+
|
|
345
|
+
**Welcome to the future of on-chain agents.**
|
package/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
BSD 2-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, infiniteezverse
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
16
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
17
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
18
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
19
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
20
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
21
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
22
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
23
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
24
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/MANIFEST.md
ADDED
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
# EZ-Path Agent Discovery & Integration Guide
|
|
2
|
+
|
|
3
|
+
This guide explains how agents discover and integrate the EZ-Path MONSKILLS skill.
|
|
4
|
+
|
|
5
|
+
## Agent Discovery
|
|
6
|
+
|
|
7
|
+
### Via Coinbase Bazaar / MONSKILLS Marketplace
|
|
8
|
+
|
|
9
|
+
Agents can discover this skill through:
|
|
10
|
+
|
|
11
|
+
1. **MONSKILLS Marketplace**: `npx skills add @infiniteezverse/monskills-ezpath`
|
|
12
|
+
2. **Community Dashboard**: https://community.iamstarchild.com/5172-monskills-ezpath
|
|
13
|
+
3. **AgentX Network**: Auto-discovered via AgentX release announcements
|
|
14
|
+
|
|
15
|
+
### Discovery Files
|
|
16
|
+
|
|
17
|
+
The following files enable auto-discovery:
|
|
18
|
+
|
|
19
|
+
- **`/.well-known/agent.json`** — Agent manifest with capabilities, pricing, chains, and integration metadata
|
|
20
|
+
- **`/.well-known/openapi.json`** — OpenAPI schema for RESTful clients and AI agent tooling
|
|
21
|
+
- **`/README.md`** — Human-readable documentation and quick-start guide
|
|
22
|
+
|
|
23
|
+
## Integration Methods
|
|
24
|
+
|
|
25
|
+
### Method 1: Direct NPM Installation (Recommended)
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install @infiniteezverse/monskills-ezpath
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Then in your agent code:
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { getPrice, getQuote, batchQuotes } from '@infiniteezverse/monskills-ezpath';
|
|
35
|
+
|
|
36
|
+
const price = await getPrice(
|
|
37
|
+
'base',
|
|
38
|
+
'0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // USDC
|
|
39
|
+
'0x4200000000000000000000000000000000000006', // WETH
|
|
40
|
+
'1000000' // 1 USDC
|
|
41
|
+
);
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Method 2: MONSKILLS Skill System
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npx skills add @infiniteezverse/monskills-ezpath
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Automatically registers skill handlers:
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
// Skill is now available as a registered handler
|
|
54
|
+
const { getQuote, getPrice, batchQuotes } = require('@infiniteezverse/monskills-ezpath').skill.handlers;
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Method 3: GitHub Direct
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm install github:infiniteezverse/monskills-ezpath
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## What Agents Can Use
|
|
64
|
+
|
|
65
|
+
### Function: `getPrice(chain, sellToken, buyToken, amount)`
|
|
66
|
+
|
|
67
|
+
Quick price lookup for single pair.
|
|
68
|
+
|
|
69
|
+
**Parameters:**
|
|
70
|
+
- `chain` (string): `'base'` | `'monad'`
|
|
71
|
+
- `sellToken` (address): ERC-20 token to sell
|
|
72
|
+
- `buyToken` (address): ERC-20 token to buy
|
|
73
|
+
- `amount` (string): Atomic units
|
|
74
|
+
|
|
75
|
+
**Returns:**
|
|
76
|
+
```typescript
|
|
77
|
+
{
|
|
78
|
+
price: string; // Human-readable price
|
|
79
|
+
sources: string[]; // Venue names used
|
|
80
|
+
} | {
|
|
81
|
+
error: string; // Error message
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Function: `getQuote(request)`
|
|
86
|
+
|
|
87
|
+
Full quote with all venue details and settlement.
|
|
88
|
+
|
|
89
|
+
**Parameters:**
|
|
90
|
+
```typescript
|
|
91
|
+
{
|
|
92
|
+
chain: 'base' | 'monad';
|
|
93
|
+
sellToken: string; // Address
|
|
94
|
+
buyToken: string; // Address
|
|
95
|
+
sellAmount: string; // Atomic units
|
|
96
|
+
slippagePercentage?: number; // Optional
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Returns:**
|
|
101
|
+
```typescript
|
|
102
|
+
{
|
|
103
|
+
success: boolean;
|
|
104
|
+
data?: {
|
|
105
|
+
status: 'ok' | 'payment_required' | 'error';
|
|
106
|
+
request_id: string;
|
|
107
|
+
sellToken: string;
|
|
108
|
+
buyToken: string;
|
|
109
|
+
sellAmount: string;
|
|
110
|
+
buyAmount: string;
|
|
111
|
+
price: string;
|
|
112
|
+
sources: Array<{
|
|
113
|
+
name: string; // Venue name
|
|
114
|
+
buyAmount: string;
|
|
115
|
+
}>;
|
|
116
|
+
routingEngine: string; // Best venue
|
|
117
|
+
tier: 'basic' | 'resilient' | 'institutional';
|
|
118
|
+
settlement_tx?: string; // If executed on-chain
|
|
119
|
+
};
|
|
120
|
+
error?: string;
|
|
121
|
+
paymentRequired?: boolean; // If 402 Payment Required
|
|
122
|
+
estimatedFee?: {
|
|
123
|
+
usd: number;
|
|
124
|
+
atomic: string;
|
|
125
|
+
token: 'USDC';
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Function: `batchQuotes(requests)`
|
|
131
|
+
|
|
132
|
+
Parallel quotes for multiple token pairs.
|
|
133
|
+
|
|
134
|
+
**Parameters:**
|
|
135
|
+
```typescript
|
|
136
|
+
EZPathQuoteRequest[] // Array of quote requests
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Returns:**
|
|
140
|
+
```typescript
|
|
141
|
+
Promise<QuoteResult[]> // Array of quote results
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Pricing & Payment
|
|
145
|
+
|
|
146
|
+
### Free Tier (Basic)
|
|
147
|
+
|
|
148
|
+
- Cost: **$0.03 USDC per quote**
|
|
149
|
+
- Venues: Direct 0x routing
|
|
150
|
+
- Rate limit: 120 requests/minute
|
|
151
|
+
- Payment: X402 EIP-3009 on Base USDC
|
|
152
|
+
|
|
153
|
+
### Resilient Tier
|
|
154
|
+
|
|
155
|
+
- Cost: **$0.10 USDC per quote**
|
|
156
|
+
- Venues: 4-venue racing
|
|
157
|
+
- Rate limit: 500 requests/minute
|
|
158
|
+
|
|
159
|
+
### Institutional Tier
|
|
160
|
+
|
|
161
|
+
- Cost: **$0.50 USDC per quote**
|
|
162
|
+
- Venues: Full 10-venue racing
|
|
163
|
+
- Rate limit: 1000 requests/minute
|
|
164
|
+
|
|
165
|
+
### Payment via X402 EIP-3009
|
|
166
|
+
|
|
167
|
+
The endpoint returns HTTP 402 when payment is required:
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
const result = await getQuote(request);
|
|
171
|
+
|
|
172
|
+
if (result.paymentRequired) {
|
|
173
|
+
// Agent must sign EIP-3009 TransferWithAuthorization
|
|
174
|
+
// See X402 implementation in solver for details
|
|
175
|
+
const signature = await signX402Payment(result.estimatedFee.atomic);
|
|
176
|
+
const retryResult = await getQuoteWithPayment(request, signature);
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Use Cases
|
|
181
|
+
|
|
182
|
+
### 1. Agent Token Swaps
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
// Agent wants to swap tokens with optimal routing
|
|
186
|
+
const quote = await getQuote({
|
|
187
|
+
chain: 'base',
|
|
188
|
+
sellToken: agentPortfolio.USDC,
|
|
189
|
+
buyToken: agentPortfolio.WETH,
|
|
190
|
+
sellAmount: swapAmount,
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
if (quote.success) {
|
|
194
|
+
// Execute swap using quote.data.buyAmount as minimum output
|
|
195
|
+
await executeSwap(quote.data);
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### 2. Portfolio Valuation
|
|
200
|
+
|
|
201
|
+
```typescript
|
|
202
|
+
// Agent needs real-time portfolio value
|
|
203
|
+
const tokens = [USDC, WETH, AERO, USDbC];
|
|
204
|
+
|
|
205
|
+
const quotes = await batchQuotes(
|
|
206
|
+
tokens.map(token => ({
|
|
207
|
+
chain: 'base',
|
|
208
|
+
sellToken: token.address,
|
|
209
|
+
buyToken: USDC,
|
|
210
|
+
sellAmount: token.balance,
|
|
211
|
+
}))
|
|
212
|
+
);
|
|
213
|
+
|
|
214
|
+
const totalValue = quotes.reduce((sum, q) =>
|
|
215
|
+
sum + BigInt(q.data?.buyAmount || 0), 0n
|
|
216
|
+
);
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### 3. Arena Bankroll Management
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
// Arena agent tracks stake value in real-time
|
|
223
|
+
const bankrollValue = await getPrice(
|
|
224
|
+
'base',
|
|
225
|
+
agentStakeToken,
|
|
226
|
+
USDC,
|
|
227
|
+
agentStakeAmount
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
const riskOfRuin = calculateRiskOfRuin(
|
|
231
|
+
parseInt(bankrollValue.price) / 1e6
|
|
232
|
+
);
|
|
233
|
+
|
|
234
|
+
if (riskOfRuin > 0.7) {
|
|
235
|
+
agentStrategy = 'conservative';
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### 4. Arbitrage Detection
|
|
240
|
+
|
|
241
|
+
```typescript
|
|
242
|
+
// Agent monitors arbitrage opportunities
|
|
243
|
+
const baseQuote = await getPrice('base', TOKEN_A, TOKEN_B, '1000000');
|
|
244
|
+
const monadQuote = await getPrice('monad', TOKEN_A, TOKEN_B, '1000000');
|
|
245
|
+
|
|
246
|
+
const arbitrage =
|
|
247
|
+
parseFloat(monadQuote.price) - parseFloat(baseQuote.price);
|
|
248
|
+
|
|
249
|
+
if (arbitrage > 0.01) {
|
|
250
|
+
// Opportunity detected: buy on Base, sell on Monad
|
|
251
|
+
}
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## Supported Chains
|
|
255
|
+
|
|
256
|
+
### Live Now
|
|
257
|
+
|
|
258
|
+
| Chain | Status | Venues |
|
|
259
|
+
|-------|--------|--------|
|
|
260
|
+
| Base | ✅ Live | All 10 |
|
|
261
|
+
| Monad | ✅ Live | All 10 |
|
|
262
|
+
|
|
263
|
+
### Coming Soon
|
|
264
|
+
|
|
265
|
+
| Chain | Status |
|
|
266
|
+
|-------|--------|
|
|
267
|
+
| Arbitrum | 🚧 Q2 2026 |
|
|
268
|
+
| Optimism | 🚧 Q2 2026 |
|
|
269
|
+
| Polygon | 🚧 Q2 2026 |
|
|
270
|
+
|
|
271
|
+
## Error Handling
|
|
272
|
+
|
|
273
|
+
### Common Errors
|
|
274
|
+
|
|
275
|
+
```typescript
|
|
276
|
+
// Missing required parameters
|
|
277
|
+
{
|
|
278
|
+
success: false,
|
|
279
|
+
error: "Missing required parameters: sellToken, buyToken, sellAmount"
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// Payment required (402)
|
|
283
|
+
{
|
|
284
|
+
success: false,
|
|
285
|
+
paymentRequired: true,
|
|
286
|
+
estimatedFee: { usd: 0.03, atomic: "30000", token: "USDC" },
|
|
287
|
+
error: "Payment required: $0.03 USDC via X402 EIP-3009"
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// Network error
|
|
291
|
+
{
|
|
292
|
+
success: false,
|
|
293
|
+
error: "Request failed: Network timeout"
|
|
294
|
+
}
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Resilience Patterns
|
|
298
|
+
|
|
299
|
+
```typescript
|
|
300
|
+
// Retry with exponential backoff
|
|
301
|
+
async function getQuoteWithRetry(request, maxRetries = 3) {
|
|
302
|
+
for (let i = 0; i < maxRetries; i++) {
|
|
303
|
+
try {
|
|
304
|
+
const result = await getQuote(request);
|
|
305
|
+
if (result.success) return result;
|
|
306
|
+
|
|
307
|
+
// Exponential backoff
|
|
308
|
+
await sleep(Math.pow(2, i) * 1000);
|
|
309
|
+
} catch (err) {
|
|
310
|
+
if (i === maxRetries - 1) throw err;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// Handle payment required gracefully
|
|
316
|
+
async function getQuoteWithPayment(request) {
|
|
317
|
+
let result = await getQuote(request);
|
|
318
|
+
|
|
319
|
+
if (result.paymentRequired) {
|
|
320
|
+
const signature = await agent.signEIP3009(result.estimatedFee);
|
|
321
|
+
result = await getQuote(request, { 'X-Payment': signature });
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
return result;
|
|
325
|
+
}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
## Examples
|
|
329
|
+
|
|
330
|
+
See `/examples/` directory for complete working examples:
|
|
331
|
+
|
|
332
|
+
1. **`agent-usage.ts`** — Basic integration patterns
|
|
333
|
+
2. **`portfolio-valuation.ts`** — Real-time portfolio pricing
|
|
334
|
+
3. **`arena-agent.ts`** — Arena competition bankroll management
|
|
335
|
+
|
|
336
|
+
## Testing
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
npm install # Install dependencies
|
|
340
|
+
npm test # Run 18 unit tests
|
|
341
|
+
npm run test:watch # Watch mode for TDD
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
## Support & Links
|
|
345
|
+
|
|
346
|
+
- 📖 Documentation: https://github.com/infiniteezverse/monskills-ezpath#readme
|
|
347
|
+
- 💬 Discord: https://discord.gg/monad
|
|
348
|
+
- 🐦 Twitter: https://twitter.com/infiniteezverse
|
|
349
|
+
- 📦 NPM: https://www.npmjs.com/package/@infiniteezverse/monskills-ezpath
|
|
350
|
+
- 🌐 EZ-Path: https://ezpath.myezverse.xyz
|
|
351
|
+
- 📋 OpenAPI: https://ezpath.myezverse.xyz/openapi.json
|
|
352
|
+
- 🤖 Agent Manifest: https://raw.githubusercontent.com/infiniteezverse/monskills-ezpath/main/.well-known/agent.json
|
|
353
|
+
|
|
354
|
+
## License
|
|
355
|
+
|
|
356
|
+
MIT — Free to use, modify, and redistribute.
|