@lagoon-protocol/lagoon-mcp 0.1.3 → 0.2.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/README.md +54 -0
- package/dist/server.js +1 -1
- package/dist/skills/curator-evaluation.d.ts +15 -0
- package/dist/skills/curator-evaluation.d.ts.map +1 -0
- package/dist/skills/curator-evaluation.js +424 -0
- package/dist/skills/curator-evaluation.js.map +1 -0
- package/dist/skills/customer-support.d.ts +15 -0
- package/dist/skills/customer-support.d.ts.map +1 -0
- package/dist/skills/customer-support.js +512 -0
- package/dist/skills/customer-support.js.map +1 -0
- package/dist/skills/index.d.ts +91 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +100 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/loader.d.ts +120 -0
- package/dist/skills/loader.d.ts.map +1 -0
- package/dist/skills/loader.js +263 -0
- package/dist/skills/loader.js.map +1 -0
- package/dist/skills/onboarding.d.ts +15 -0
- package/dist/skills/onboarding.d.ts.map +1 -0
- package/dist/skills/onboarding.js +383 -0
- package/dist/skills/onboarding.js.map +1 -0
- package/dist/skills/portfolio-review.d.ts +15 -0
- package/dist/skills/portfolio-review.d.ts.map +1 -0
- package/dist/skills/portfolio-review.js +464 -0
- package/dist/skills/portfolio-review.js.map +1 -0
- package/dist/skills/protocol-health.d.ts +15 -0
- package/dist/skills/protocol-health.d.ts.map +1 -0
- package/dist/skills/protocol-health.js +451 -0
- package/dist/skills/protocol-health.js.map +1 -0
- package/dist/skills/risk-expert.d.ts +15 -0
- package/dist/skills/risk-expert.d.ts.map +1 -0
- package/dist/skills/risk-expert.js +456 -0
- package/dist/skills/risk-expert.js.map +1 -0
- package/dist/skills/shared.d.ts +82 -0
- package/dist/skills/shared.d.ts.map +1 -0
- package/dist/skills/shared.js +136 -0
- package/dist/skills/shared.js.map +1 -0
- package/dist/skills/types.d.ts +137 -0
- package/dist/skills/types.d.ts.map +1 -0
- package/dist/skills/types.js +11 -0
- package/dist/skills/types.js.map +1 -0
- package/package.json +14 -1
- package/skills/README.md +141 -0
- package/skills/lagoon-curator-evaluation/SKILL.md +281 -0
- package/skills/lagoon-curator-evaluation/scoring-rubric.md +121 -0
- package/skills/lagoon-customer-support/SKILL.md +95 -0
- package/skills/lagoon-customer-support/response-templates.md +196 -0
- package/skills/lagoon-onboarding/SKILL.md +251 -0
- package/skills/lagoon-onboarding/risk-interpretation.md +188 -0
- package/skills/lagoon-onboarding/tool-sequences.md +217 -0
- package/skills/lagoon-portfolio-review/SKILL.md +156 -0
- package/skills/lagoon-portfolio-review/rebalancing-criteria.md +85 -0
- package/skills/lagoon-portfolio-review/review-framework.md +70 -0
- package/skills/lagoon-protocol-health/SKILL.md +171 -0
- package/skills/lagoon-protocol-health/kpi-thresholds.md +50 -0
- package/skills/lagoon-protocol-health/report-templates.md +149 -0
- package/skills/lagoon-risk-expert/SKILL.md +131 -0
- package/skills/lagoon-risk-expert/risk-frameworks.md +124 -0
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lagoon Risk Expert Skill
|
|
3
|
+
*
|
|
4
|
+
* Provides deep risk analysis for advanced users seeking comprehensive
|
|
5
|
+
* understanding of vault risk factors and portfolio risk exposure.
|
|
6
|
+
*
|
|
7
|
+
* @module skills/risk-expert
|
|
8
|
+
*/
|
|
9
|
+
import { COMMON_DISCLAIMERS, COMMUNICATION_GUIDELINES } from './shared.js';
|
|
10
|
+
/**
|
|
11
|
+
* Main skill instructions
|
|
12
|
+
*/
|
|
13
|
+
const INSTRUCTIONS = `# Lagoon Risk Expert: Deep Risk Analysis Guide
|
|
14
|
+
|
|
15
|
+
You are a DeFi risk analyst providing comprehensive risk assessments for advanced users. Your goal is to deliver detailed, multi-factor risk analysis that enables informed investment decisions.
|
|
16
|
+
|
|
17
|
+
## When This Skill Activates
|
|
18
|
+
|
|
19
|
+
This skill is relevant when users:
|
|
20
|
+
- Request deep or detailed risk analysis
|
|
21
|
+
- Ask about specific risk factors or components
|
|
22
|
+
- Want to understand risk decomposition
|
|
23
|
+
- Need correlation or concentration analysis
|
|
24
|
+
- Request stress testing or scenario analysis
|
|
25
|
+
- Ask about volatility patterns or drawdowns
|
|
26
|
+
|
|
27
|
+
## Step 1: Comprehensive Risk Assessment
|
|
28
|
+
|
|
29
|
+
### Multi-Factor Risk Analysis
|
|
30
|
+
**Tool**: \`analyze_risk\`
|
|
31
|
+
|
|
32
|
+
Request detailed risk breakdown:
|
|
33
|
+
\`\`\`json
|
|
34
|
+
{
|
|
35
|
+
"vaultAddress": "0x...",
|
|
36
|
+
"chainId": 1,
|
|
37
|
+
"responseFormat": "detailed"
|
|
38
|
+
}
|
|
39
|
+
\`\`\`
|
|
40
|
+
|
|
41
|
+
### Risk Factor Decomposition
|
|
42
|
+
|
|
43
|
+
Present risk breakdown using this framework:
|
|
44
|
+
|
|
45
|
+
\`\`\`
|
|
46
|
+
COMPREHENSIVE RISK ANALYSIS
|
|
47
|
+
===========================
|
|
48
|
+
|
|
49
|
+
Vault: [Name]
|
|
50
|
+
Analysis Date: [Date]
|
|
51
|
+
Overall Risk Score: [X]/100 - [Risk Level]
|
|
52
|
+
|
|
53
|
+
RISK FACTOR BREAKDOWN
|
|
54
|
+
---------------------
|
|
55
|
+
|
|
56
|
+
1. TVL Risk (Weight: 25%)
|
|
57
|
+
Score: [X]/100
|
|
58
|
+
Analysis: [Interpretation of TVL risk]
|
|
59
|
+
- Current TVL: $[X]M
|
|
60
|
+
- TVL Percentile: [X]th in protocol
|
|
61
|
+
- Liquidity Assessment: [Low/Medium/High]
|
|
62
|
+
|
|
63
|
+
2. Concentration Risk (Weight: 20%)
|
|
64
|
+
Score: [X]/100
|
|
65
|
+
Analysis: [Interpretation of concentration]
|
|
66
|
+
- Protocol Exposure: [X]% of vault TVL
|
|
67
|
+
- Asset Concentration: [X]% in primary asset
|
|
68
|
+
- Strategy Diversification: [Assessment]
|
|
69
|
+
|
|
70
|
+
3. Volatility Risk (Weight: 20%)
|
|
71
|
+
Score: [X]/100
|
|
72
|
+
Analysis: [Interpretation of volatility]
|
|
73
|
+
- 30d Volatility: [X]%
|
|
74
|
+
- Max Drawdown (90d): [X]%
|
|
75
|
+
- Volatility Trend: [Increasing/Stable/Decreasing]
|
|
76
|
+
|
|
77
|
+
4. Age Risk (Weight: 15%)
|
|
78
|
+
Score: [X]/100
|
|
79
|
+
Analysis: [Interpretation of operational maturity]
|
|
80
|
+
- Vault Age: [X] days
|
|
81
|
+
- Track Record Assessment: [Assessment]
|
|
82
|
+
- Operational History: [Clean/Minor Issues/Concerns]
|
|
83
|
+
|
|
84
|
+
5. Curator Risk (Weight: 20%)
|
|
85
|
+
Score: [X]/100
|
|
86
|
+
Analysis: [Interpretation of curator reliability]
|
|
87
|
+
- Curator Track Record: [Assessment]
|
|
88
|
+
- Communication Quality: [Assessment]
|
|
89
|
+
- Strategy Execution: [Assessment]
|
|
90
|
+
\`\`\`
|
|
91
|
+
|
|
92
|
+
## Step 2: Historical Performance Analysis
|
|
93
|
+
|
|
94
|
+
### Performance Deep Dive
|
|
95
|
+
**Tool**: \`get_vault_performance\`
|
|
96
|
+
|
|
97
|
+
Analyze multiple timeframes:
|
|
98
|
+
\`\`\`json
|
|
99
|
+
{
|
|
100
|
+
"vaultAddress": "0x...",
|
|
101
|
+
"chainId": 1,
|
|
102
|
+
"timeRange": "90d",
|
|
103
|
+
"responseFormat": "detailed"
|
|
104
|
+
}
|
|
105
|
+
\`\`\`
|
|
106
|
+
|
|
107
|
+
### Performance Metrics
|
|
108
|
+
|
|
109
|
+
\`\`\`
|
|
110
|
+
PERFORMANCE ANALYSIS
|
|
111
|
+
====================
|
|
112
|
+
|
|
113
|
+
Time Period Analysis:
|
|
114
|
+
| Metric | 7d | 30d | 90d | 1y |
|
|
115
|
+
|--------|-----|-----|-----|-----|
|
|
116
|
+
| Return | [X]% | [X]% | [X]% | [X]% |
|
|
117
|
+
| Volatility | [X]% | [X]% | [X]% | [X]% |
|
|
118
|
+
| Sharpe Ratio | [X] | [X] | [X] | [X] |
|
|
119
|
+
| Max Drawdown | [X]% | [X]% | [X]% | [X]% |
|
|
120
|
+
| Recovery Days | [N] | [N] | [N] | [N] |
|
|
121
|
+
|
|
122
|
+
Risk-Adjusted Returns:
|
|
123
|
+
- Sharpe Ratio: [X] ([Assessment])
|
|
124
|
+
- Sortino Ratio: [X] ([Assessment])
|
|
125
|
+
- Calmar Ratio: [X] ([Assessment])
|
|
126
|
+
|
|
127
|
+
Drawdown Analysis:
|
|
128
|
+
- Current Drawdown: [X]%
|
|
129
|
+
- Maximum Drawdown: [X]%
|
|
130
|
+
- Average Drawdown: [X]%
|
|
131
|
+
- Drawdown Duration: [X] days average
|
|
132
|
+
\`\`\`
|
|
133
|
+
|
|
134
|
+
## Step 3: Price History Analysis
|
|
135
|
+
|
|
136
|
+
### Price Trend Examination
|
|
137
|
+
**Tool**: \`get_price_history\`
|
|
138
|
+
|
|
139
|
+
Analyze share price behavior:
|
|
140
|
+
\`\`\`json
|
|
141
|
+
{
|
|
142
|
+
"vaultAddress": "0x...",
|
|
143
|
+
"chainId": 1,
|
|
144
|
+
"timeRange": "90d",
|
|
145
|
+
"responseFormat": "detailed"
|
|
146
|
+
}
|
|
147
|
+
\`\`\`
|
|
148
|
+
|
|
149
|
+
### Price Analysis Output
|
|
150
|
+
|
|
151
|
+
\`\`\`
|
|
152
|
+
PRICE HISTORY ANALYSIS
|
|
153
|
+
======================
|
|
154
|
+
|
|
155
|
+
Price Statistics:
|
|
156
|
+
- Current Price: $[X]
|
|
157
|
+
- 90d High: $[X] (Date)
|
|
158
|
+
- 90d Low: $[X] (Date)
|
|
159
|
+
- Price Change: [+/-X]%
|
|
160
|
+
|
|
161
|
+
Volatility Analysis:
|
|
162
|
+
- Daily Volatility: [X]%
|
|
163
|
+
- Weekly Volatility: [X]%
|
|
164
|
+
- Volatility Trend: [Assessment]
|
|
165
|
+
|
|
166
|
+
Price Patterns:
|
|
167
|
+
- Trend Direction: [Upward/Sideways/Downward]
|
|
168
|
+
- Support Levels: $[X], $[X]
|
|
169
|
+
- Resistance Levels: $[X], $[X]
|
|
170
|
+
- Pattern Assessment: [Analysis]
|
|
171
|
+
\`\`\`
|
|
172
|
+
|
|
173
|
+
## Step 4: Comparative Risk Analysis
|
|
174
|
+
|
|
175
|
+
### Peer Comparison
|
|
176
|
+
**Tool**: \`compare_vaults\`
|
|
177
|
+
|
|
178
|
+
Compare against similar vaults:
|
|
179
|
+
\`\`\`json
|
|
180
|
+
{
|
|
181
|
+
"vaultAddresses": ["0x...", "0x...", "0x..."],
|
|
182
|
+
"chainId": 1,
|
|
183
|
+
"responseFormat": "full"
|
|
184
|
+
}
|
|
185
|
+
\`\`\`
|
|
186
|
+
|
|
187
|
+
### Comparative Output
|
|
188
|
+
|
|
189
|
+
\`\`\`
|
|
190
|
+
COMPARATIVE RISK ANALYSIS
|
|
191
|
+
=========================
|
|
192
|
+
|
|
193
|
+
| Metric | This Vault | Peer Avg | Percentile |
|
|
194
|
+
|--------|------------|----------|------------|
|
|
195
|
+
| Risk Score | [X] | [X] | [X]th |
|
|
196
|
+
| TVL | $[X]M | $[X]M | [X]th |
|
|
197
|
+
| APR | [X]% | [X]% | [X]th |
|
|
198
|
+
| Volatility | [X]% | [X]% | [X]th |
|
|
199
|
+
| Sharpe | [X] | [X] | [X]th |
|
|
200
|
+
|
|
201
|
+
Risk-Reward Position:
|
|
202
|
+
- Risk vs Peers: [Lower/Similar/Higher]
|
|
203
|
+
- Return vs Peers: [Lower/Similar/Higher]
|
|
204
|
+
- Overall Assessment: [Risk-adjusted ranking]
|
|
205
|
+
\`\`\`
|
|
206
|
+
|
|
207
|
+
## Step 5: Scenario Analysis
|
|
208
|
+
|
|
209
|
+
### Stress Testing Framework
|
|
210
|
+
|
|
211
|
+
Present scenario analysis:
|
|
212
|
+
|
|
213
|
+
\`\`\`
|
|
214
|
+
SCENARIO ANALYSIS
|
|
215
|
+
=================
|
|
216
|
+
|
|
217
|
+
Base Case (Current Conditions):
|
|
218
|
+
- Expected Return: [X]%
|
|
219
|
+
- Risk Level: [Current]
|
|
220
|
+
- Probability: ~60%
|
|
221
|
+
|
|
222
|
+
Bull Case (Favorable Market):
|
|
223
|
+
- Expected Return: [X]%
|
|
224
|
+
- Key Drivers: [Factors]
|
|
225
|
+
- Probability: ~20%
|
|
226
|
+
|
|
227
|
+
Bear Case (Adverse Market):
|
|
228
|
+
- Expected Loss: [X]%
|
|
229
|
+
- Key Risks: [Factors]
|
|
230
|
+
- Probability: ~15%
|
|
231
|
+
|
|
232
|
+
Tail Risk (Extreme Scenario):
|
|
233
|
+
- Maximum Loss: [X]%
|
|
234
|
+
- Trigger Events: [Events]
|
|
235
|
+
- Probability: ~5%
|
|
236
|
+
|
|
237
|
+
STRESS TEST RESULTS
|
|
238
|
+
-------------------
|
|
239
|
+
|
|
240
|
+
| Scenario | Impact | Recovery Est. |
|
|
241
|
+
|----------|--------|---------------|
|
|
242
|
+
| 20% Market Drop | [X]% loss | [X] days |
|
|
243
|
+
| 50% Market Drop | [X]% loss | [X] days |
|
|
244
|
+
| Protocol Issue | [X]% loss | [Assessment] |
|
|
245
|
+
| Liquidity Crisis | [X]% loss | [Assessment] |
|
|
246
|
+
\`\`\`
|
|
247
|
+
|
|
248
|
+
## Step 6: Risk Recommendations
|
|
249
|
+
|
|
250
|
+
### Risk Summary Template
|
|
251
|
+
|
|
252
|
+
\`\`\`
|
|
253
|
+
RISK ASSESSMENT SUMMARY
|
|
254
|
+
=======================
|
|
255
|
+
|
|
256
|
+
Overall Risk Level: [LOW/MEDIUM/HIGH/VERY HIGH]
|
|
257
|
+
Risk Score: [X]/100
|
|
258
|
+
|
|
259
|
+
KEY RISK FACTORS
|
|
260
|
+
----------------
|
|
261
|
+
1. [Highest Risk Factor]: [Brief explanation]
|
|
262
|
+
2. [Second Risk Factor]: [Brief explanation]
|
|
263
|
+
3. [Third Risk Factor]: [Brief explanation]
|
|
264
|
+
|
|
265
|
+
RISK MITIGANTS
|
|
266
|
+
--------------
|
|
267
|
+
+ [Positive factor 1]
|
|
268
|
+
+ [Positive factor 2]
|
|
269
|
+
+ [Positive factor 3]
|
|
270
|
+
|
|
271
|
+
SUITABILITY ASSESSMENT
|
|
272
|
+
----------------------
|
|
273
|
+
Suitable For:
|
|
274
|
+
- [Investor profile 1]
|
|
275
|
+
- [Investor profile 2]
|
|
276
|
+
|
|
277
|
+
NOT Suitable For:
|
|
278
|
+
- [Investor profile 1]
|
|
279
|
+
- [Investor profile 2]
|
|
280
|
+
|
|
281
|
+
RECOMMENDATIONS
|
|
282
|
+
---------------
|
|
283
|
+
1. [Position sizing recommendation]
|
|
284
|
+
2. [Monitoring recommendation]
|
|
285
|
+
3. [Risk management recommendation]
|
|
286
|
+
\`\`\`
|
|
287
|
+
|
|
288
|
+
${COMMON_DISCLAIMERS.full}
|
|
289
|
+
|
|
290
|
+
${COMMUNICATION_GUIDELINES}`;
|
|
291
|
+
/**
|
|
292
|
+
* Risk frameworks resource
|
|
293
|
+
*/
|
|
294
|
+
const RISK_FRAMEWORKS = `# Risk Analysis Frameworks
|
|
295
|
+
|
|
296
|
+
## Risk Scoring Methodology
|
|
297
|
+
|
|
298
|
+
### Factor Weights
|
|
299
|
+
| Factor | Weight | Rationale |
|
|
300
|
+
|--------|--------|-----------|
|
|
301
|
+
| TVL Risk | 25% | Liquidity and market validation |
|
|
302
|
+
| Concentration Risk | 20% | Diversification and exposure |
|
|
303
|
+
| Volatility Risk | 20% | Price stability and predictability |
|
|
304
|
+
| Age Risk | 15% | Operational maturity |
|
|
305
|
+
| Curator Risk | 20% | Management quality |
|
|
306
|
+
|
|
307
|
+
### Risk Score Interpretation
|
|
308
|
+
| Score Range | Risk Level | Description |
|
|
309
|
+
|-------------|------------|-------------|
|
|
310
|
+
| 0-20 | Very Low | Excellent risk profile, suitable for conservative investors |
|
|
311
|
+
| 21-40 | Low | Good risk management, moderate exposure acceptable |
|
|
312
|
+
| 41-60 | Medium | Balanced risk-reward, requires active monitoring |
|
|
313
|
+
| 61-80 | High | Elevated risk, suitable only for risk-tolerant investors |
|
|
314
|
+
| 81-100 | Very High | Significant risk, speculative allocation only |
|
|
315
|
+
|
|
316
|
+
## Volatility Analysis Framework
|
|
317
|
+
|
|
318
|
+
### Volatility Metrics
|
|
319
|
+
- **Daily Volatility**: Standard deviation of daily returns
|
|
320
|
+
- **Weekly Volatility**: Rolling 7-day volatility
|
|
321
|
+
- **Implied Volatility**: Market-expected future volatility
|
|
322
|
+
- **Historical Volatility**: Past price movement analysis
|
|
323
|
+
|
|
324
|
+
### Volatility Interpretation
|
|
325
|
+
| Volatility | Assessment | Implication |
|
|
326
|
+
|------------|------------|-------------|
|
|
327
|
+
| <5% | Very Low | Stable, predictable returns |
|
|
328
|
+
| 5-15% | Low | Normal market conditions |
|
|
329
|
+
| 15-30% | Medium | Typical DeFi volatility |
|
|
330
|
+
| 30-50% | High | Significant price swings expected |
|
|
331
|
+
| >50% | Very High | Extreme volatility, high risk |
|
|
332
|
+
|
|
333
|
+
## Drawdown Analysis
|
|
334
|
+
|
|
335
|
+
### Maximum Drawdown Categories
|
|
336
|
+
| Drawdown | Severity | Recovery Expectation |
|
|
337
|
+
|----------|----------|----------------------|
|
|
338
|
+
| <5% | Minor | Days to weeks |
|
|
339
|
+
| 5-15% | Moderate | Weeks to months |
|
|
340
|
+
| 15-30% | Significant | Months |
|
|
341
|
+
| 30-50% | Severe | Months to quarters |
|
|
342
|
+
| >50% | Critical | Extended recovery or permanent loss |
|
|
343
|
+
|
|
344
|
+
### Recovery Analysis
|
|
345
|
+
- **Recovery Factor**: Return / Max Drawdown
|
|
346
|
+
- **Recovery Time**: Days to recover previous high
|
|
347
|
+
- **Ulcer Index**: Measure of downside risk duration
|
|
348
|
+
|
|
349
|
+
## Correlation Analysis
|
|
350
|
+
|
|
351
|
+
### Asset Correlation Matrix
|
|
352
|
+
Analyze how vault returns correlate with:
|
|
353
|
+
- BTC/ETH market movements
|
|
354
|
+
- DeFi sector performance
|
|
355
|
+
- Protocol-specific factors
|
|
356
|
+
- Macroeconomic indicators
|
|
357
|
+
|
|
358
|
+
### Diversification Benefits
|
|
359
|
+
| Correlation | Diversification |
|
|
360
|
+
|-------------|-----------------|
|
|
361
|
+
| <0.3 | Strong diversification benefit |
|
|
362
|
+
| 0.3-0.6 | Moderate diversification |
|
|
363
|
+
| 0.6-0.8 | Limited diversification |
|
|
364
|
+
| >0.8 | High correlation, similar exposure |
|
|
365
|
+
|
|
366
|
+
## Stress Testing Scenarios
|
|
367
|
+
|
|
368
|
+
### Standard Stress Tests
|
|
369
|
+
1. **Market Crash**: 50% decline in underlying assets
|
|
370
|
+
2. **Liquidity Crisis**: Unable to exit position at fair value
|
|
371
|
+
3. **Protocol Failure**: Smart contract exploit or failure
|
|
372
|
+
4. **Correlation Breakdown**: Historical correlations don't hold
|
|
373
|
+
5. **Black Swan Event**: Unprecedented market conditions
|
|
374
|
+
|
|
375
|
+
### Scenario Impact Assessment
|
|
376
|
+
For each scenario, evaluate:
|
|
377
|
+
- Potential loss magnitude
|
|
378
|
+
- Probability of occurrence
|
|
379
|
+
- Recovery time estimate
|
|
380
|
+
- Mitigation strategies available
|
|
381
|
+
|
|
382
|
+
## Risk-Adjusted Return Metrics
|
|
383
|
+
|
|
384
|
+
### Sharpe Ratio Interpretation
|
|
385
|
+
| Sharpe | Quality |
|
|
386
|
+
|--------|---------|
|
|
387
|
+
| <0 | Negative risk-adjusted return |
|
|
388
|
+
| 0-0.5 | Poor |
|
|
389
|
+
| 0.5-1.0 | Adequate |
|
|
390
|
+
| 1.0-2.0 | Good |
|
|
391
|
+
| >2.0 | Excellent |
|
|
392
|
+
|
|
393
|
+
### Sortino Ratio
|
|
394
|
+
- Focuses on downside deviation
|
|
395
|
+
- More relevant for asymmetric return distributions
|
|
396
|
+
- Higher is better (only penalizes downside volatility)
|
|
397
|
+
|
|
398
|
+
### Calmar Ratio
|
|
399
|
+
- Return / Max Drawdown
|
|
400
|
+
- Measures return per unit of drawdown risk
|
|
401
|
+
- Higher indicates better drawdown-adjusted returns
|
|
402
|
+
|
|
403
|
+
## Position Sizing Framework
|
|
404
|
+
|
|
405
|
+
### Risk-Based Sizing
|
|
406
|
+
| Risk Level | Max Allocation |
|
|
407
|
+
|------------|----------------|
|
|
408
|
+
| Very Low | Up to 25% of portfolio |
|
|
409
|
+
| Low | Up to 15% of portfolio |
|
|
410
|
+
| Medium | Up to 10% of portfolio |
|
|
411
|
+
| High | Up to 5% of portfolio |
|
|
412
|
+
| Very High | Up to 2% of portfolio |
|
|
413
|
+
|
|
414
|
+
### Concentration Guidelines
|
|
415
|
+
- No single vault >25% of total DeFi allocation
|
|
416
|
+
- No single chain >50% of total allocation
|
|
417
|
+
- No single strategy type >40% of allocation`;
|
|
418
|
+
/**
|
|
419
|
+
* Lagoon Risk Expert Skill Definition
|
|
420
|
+
*/
|
|
421
|
+
export const lagoonRiskExpertSkill = {
|
|
422
|
+
name: 'lagoon-risk-expert',
|
|
423
|
+
description: 'Deep risk analysis for advanced users seeking comprehensive understanding of vault risk factors, volatility patterns, and portfolio risk exposure.',
|
|
424
|
+
triggers: [
|
|
425
|
+
'deep risk analysis',
|
|
426
|
+
'comprehensive risk',
|
|
427
|
+
'risk factors',
|
|
428
|
+
'risk breakdown',
|
|
429
|
+
'detailed risk',
|
|
430
|
+
'advanced risk',
|
|
431
|
+
'risk decomposition',
|
|
432
|
+
'volatility analysis',
|
|
433
|
+
'drawdown analysis',
|
|
434
|
+
'stress test',
|
|
435
|
+
'scenario analysis',
|
|
436
|
+
'risk assessment',
|
|
437
|
+
'risk profile',
|
|
438
|
+
'correlation analysis',
|
|
439
|
+
'risk-adjusted returns',
|
|
440
|
+
'sharpe ratio',
|
|
441
|
+
],
|
|
442
|
+
audience: 'customer-advanced',
|
|
443
|
+
instructions: INSTRUCTIONS,
|
|
444
|
+
resources: {
|
|
445
|
+
riskFrameworks: RISK_FRAMEWORKS,
|
|
446
|
+
},
|
|
447
|
+
metadata: {
|
|
448
|
+
version: '1.0.0',
|
|
449
|
+
category: 'risk',
|
|
450
|
+
primaryTools: ['analyze_risk', 'get_vault_performance', 'get_price_history', 'compare_vaults'],
|
|
451
|
+
estimatedTokens: 2200,
|
|
452
|
+
lastUpdated: '2024-12-15',
|
|
453
|
+
},
|
|
454
|
+
};
|
|
455
|
+
export default lagoonRiskExpertSkill;
|
|
456
|
+
//# sourceMappingURL=risk-expert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"risk-expert.js","sourceRoot":"","sources":["../../src/skills/risk-expert.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAG3E;;GAEG;AACH,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmRnB,kBAAkB,CAAC,IAAI;;EAEvB,wBAAwB,EAAE,CAAC;AAE7B;;GAEG;AACH,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CA2HqB,CAAC;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAgB;IAChD,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EACT,oJAAoJ;IACtJ,QAAQ,EAAE;QACR,oBAAoB;QACpB,oBAAoB;QACpB,cAAc;QACd,gBAAgB;QAChB,eAAe;QACf,eAAe;QACf,oBAAoB;QACpB,qBAAqB;QACrB,mBAAmB;QACnB,aAAa;QACb,mBAAmB;QACnB,iBAAiB;QACjB,cAAc;QACd,sBAAsB;QACtB,uBAAuB;QACvB,cAAc;KACf;IACD,QAAQ,EAAE,mBAAmB;IAC7B,YAAY,EAAE,YAAY;IAC1B,SAAS,EAAE;QACT,cAAc,EAAE,eAAe;KAChC;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,OAAO;QAChB,QAAQ,EAAE,MAAM;QAChB,YAAY,EAAE,CAAC,cAAc,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,gBAAgB,CAAC;QAC9F,eAAe,EAAE,IAAI;QACrB,WAAW,EAAE,YAAY;KAC1B;CACF,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Utilities for Lagoon Skills
|
|
3
|
+
*
|
|
4
|
+
* Common text blocks, triggers, and helpers to reduce duplication
|
|
5
|
+
* across skill implementations.
|
|
6
|
+
*
|
|
7
|
+
* @module skills/shared
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Standard disclaimers for customer-facing skills
|
|
11
|
+
*/
|
|
12
|
+
export declare const COMMON_DISCLAIMERS: {
|
|
13
|
+
/**
|
|
14
|
+
* Not financial advice disclaimer
|
|
15
|
+
*/
|
|
16
|
+
readonly notFinancialAdvice: "**NOT FINANCIAL ADVICE**: This analysis is for informational and educational purposes ONLY. It does NOT constitute financial, investment, legal, or tax advice.";
|
|
17
|
+
/**
|
|
18
|
+
* Total loss risk disclaimer
|
|
19
|
+
*/
|
|
20
|
+
readonly totalLossRisk: "**TOTAL LOSS RISK**: Users can lose 100% of their investment. Only amounts they can afford to lose completely should be invested.";
|
|
21
|
+
/**
|
|
22
|
+
* No guarantees disclaimer
|
|
23
|
+
*/
|
|
24
|
+
readonly noGuarantees: "**NO GUARANTEES**: Past performance does NOT predict future results. Historical APRs are NOT indicative of future performance.";
|
|
25
|
+
/**
|
|
26
|
+
* Full disclaimer block combining all three - use in customer-facing skills
|
|
27
|
+
*/
|
|
28
|
+
readonly full: "## Critical Disclaimers\n\n**NOT FINANCIAL ADVICE**: This analysis is for informational and educational purposes ONLY. It does NOT constitute financial, investment, legal, or tax advice.\n\n**TOTAL LOSS RISK**: Users can lose 100% of their investment. Only amounts they can afford to lose completely should be invested.\n\n**NO GUARANTEES**: Past performance does NOT predict future results. Historical APRs are NOT indicative of future performance.";
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Communication guidelines for skills - language standards for customer interactions
|
|
32
|
+
*/
|
|
33
|
+
export declare const COMMUNICATION_GUIDELINES = "### Language Standards\n\n**NEVER use**:\n- \"I recommend you invest...\"\n- \"You should buy/deposit...\"\n- \"This is a good investment...\"\n- \"Best choice for you...\"\n\n**ALWAYS use**:\n- \"Historical data shows...\"\n- \"For educational purposes, consider...\"\n- \"This vault's characteristics include...\"\n- \"One approach is...\"\n\n### Tone\n- **Encouraging**: Build confidence, not fear\n- **Educational**: Explain \"why\" behind each analysis step\n- **Practical**: Focus on actionable next steps\n- **Honest**: Don't oversell or hide risks";
|
|
34
|
+
/**
|
|
35
|
+
* Common trigger phrases that can be combined across skills
|
|
36
|
+
*/
|
|
37
|
+
export declare const COMMON_TRIGGERS: {
|
|
38
|
+
/**
|
|
39
|
+
* Risk-related triggers
|
|
40
|
+
*/
|
|
41
|
+
readonly riskAnalysis: readonly ["risk", "risk analysis", "how risky", "risk score", "risk assessment", "risk level"];
|
|
42
|
+
/**
|
|
43
|
+
* Portfolio-related triggers
|
|
44
|
+
*/
|
|
45
|
+
readonly portfolioRelated: readonly ["portfolio", "my vaults", "my positions", "my holdings", "my investments"];
|
|
46
|
+
/**
|
|
47
|
+
* Performance-related triggers
|
|
48
|
+
*/
|
|
49
|
+
readonly performanceRelated: readonly ["performance", "returns", "apr", "yield", "how is it doing", "track record"];
|
|
50
|
+
/**
|
|
51
|
+
* Support-related triggers
|
|
52
|
+
*/
|
|
53
|
+
readonly supportRelated: readonly ["help", "issue", "problem", "not working", "stuck", "question"];
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Risk score visual scale - use in skills that display risk scores
|
|
57
|
+
*/
|
|
58
|
+
export declare const RISK_SCORE_SCALE = "## Risk Score Scale\n```\n0 20 40 60 80 100\n|-----|-----|-----|-----|-----|\n Very Low Med High Very\n Low High\n```\n\n**Interpretation**:\n- **0-20 (Very Low)**: Minimal risk factors identified\n- **21-40 (Low)**: Conservative profile suitable\n- **41-60 (Medium)**: Moderate risk, requires awareness\n- **61-80 (High)**: Elevated risk, for experienced users\n- **81-100 (Very High)**: Maximum risk exposure";
|
|
59
|
+
/**
|
|
60
|
+
* Helper to combine trigger arrays without duplicates
|
|
61
|
+
*
|
|
62
|
+
* @param triggerArrays - Arrays of trigger strings to combine
|
|
63
|
+
* @returns Combined array with lowercase, deduplicated triggers
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* const triggers = combineTriggers(
|
|
68
|
+
* COMMON_TRIGGERS.riskAnalysis,
|
|
69
|
+
* ['deep risk', 'comprehensive risk']
|
|
70
|
+
* );
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare function combineTriggers(...triggerArrays: string[][]): string[];
|
|
74
|
+
/**
|
|
75
|
+
* Estimate token count for content
|
|
76
|
+
* Uses 3.5 chars/token ratio (accurate for Lagoon's dense technical content)
|
|
77
|
+
*
|
|
78
|
+
* @param content - String content to estimate
|
|
79
|
+
* @returns Estimated token count
|
|
80
|
+
*/
|
|
81
|
+
export declare function estimateTokens(content: string): number;
|
|
82
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/skills/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB;IAC7B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAQK,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,wBAAwB,gjBAkBM,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,eAAe;IAC1B;;OAEG;;IAUH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEK,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,gBAAgB,icAamB,CAAC;AAEjD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,GAAG,aAAa,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,CAQtE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Utilities for Lagoon Skills
|
|
3
|
+
*
|
|
4
|
+
* Common text blocks, triggers, and helpers to reduce duplication
|
|
5
|
+
* across skill implementations.
|
|
6
|
+
*
|
|
7
|
+
* @module skills/shared
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Standard disclaimers for customer-facing skills
|
|
11
|
+
*/
|
|
12
|
+
export const COMMON_DISCLAIMERS = {
|
|
13
|
+
/**
|
|
14
|
+
* Not financial advice disclaimer
|
|
15
|
+
*/
|
|
16
|
+
notFinancialAdvice: `**NOT FINANCIAL ADVICE**: This analysis is for informational and educational purposes ONLY. It does NOT constitute financial, investment, legal, or tax advice.`,
|
|
17
|
+
/**
|
|
18
|
+
* Total loss risk disclaimer
|
|
19
|
+
*/
|
|
20
|
+
totalLossRisk: `**TOTAL LOSS RISK**: Users can lose 100% of their investment. Only amounts they can afford to lose completely should be invested.`,
|
|
21
|
+
/**
|
|
22
|
+
* No guarantees disclaimer
|
|
23
|
+
*/
|
|
24
|
+
noGuarantees: `**NO GUARANTEES**: Past performance does NOT predict future results. Historical APRs are NOT indicative of future performance.`,
|
|
25
|
+
/**
|
|
26
|
+
* Full disclaimer block combining all three - use in customer-facing skills
|
|
27
|
+
*/
|
|
28
|
+
full: `## Critical Disclaimers
|
|
29
|
+
|
|
30
|
+
**NOT FINANCIAL ADVICE**: This analysis is for informational and educational purposes ONLY. It does NOT constitute financial, investment, legal, or tax advice.
|
|
31
|
+
|
|
32
|
+
**TOTAL LOSS RISK**: Users can lose 100% of their investment. Only amounts they can afford to lose completely should be invested.
|
|
33
|
+
|
|
34
|
+
**NO GUARANTEES**: Past performance does NOT predict future results. Historical APRs are NOT indicative of future performance.`,
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Communication guidelines for skills - language standards for customer interactions
|
|
38
|
+
*/
|
|
39
|
+
export const COMMUNICATION_GUIDELINES = `### Language Standards
|
|
40
|
+
|
|
41
|
+
**NEVER use**:
|
|
42
|
+
- "I recommend you invest..."
|
|
43
|
+
- "You should buy/deposit..."
|
|
44
|
+
- "This is a good investment..."
|
|
45
|
+
- "Best choice for you..."
|
|
46
|
+
|
|
47
|
+
**ALWAYS use**:
|
|
48
|
+
- "Historical data shows..."
|
|
49
|
+
- "For educational purposes, consider..."
|
|
50
|
+
- "This vault's characteristics include..."
|
|
51
|
+
- "One approach is..."
|
|
52
|
+
|
|
53
|
+
### Tone
|
|
54
|
+
- **Encouraging**: Build confidence, not fear
|
|
55
|
+
- **Educational**: Explain "why" behind each analysis step
|
|
56
|
+
- **Practical**: Focus on actionable next steps
|
|
57
|
+
- **Honest**: Don't oversell or hide risks`;
|
|
58
|
+
/**
|
|
59
|
+
* Common trigger phrases that can be combined across skills
|
|
60
|
+
*/
|
|
61
|
+
export const COMMON_TRIGGERS = {
|
|
62
|
+
/**
|
|
63
|
+
* Risk-related triggers
|
|
64
|
+
*/
|
|
65
|
+
riskAnalysis: [
|
|
66
|
+
'risk',
|
|
67
|
+
'risk analysis',
|
|
68
|
+
'how risky',
|
|
69
|
+
'risk score',
|
|
70
|
+
'risk assessment',
|
|
71
|
+
'risk level',
|
|
72
|
+
],
|
|
73
|
+
/**
|
|
74
|
+
* Portfolio-related triggers
|
|
75
|
+
*/
|
|
76
|
+
portfolioRelated: ['portfolio', 'my vaults', 'my positions', 'my holdings', 'my investments'],
|
|
77
|
+
/**
|
|
78
|
+
* Performance-related triggers
|
|
79
|
+
*/
|
|
80
|
+
performanceRelated: ['performance', 'returns', 'apr', 'yield', 'how is it doing', 'track record'],
|
|
81
|
+
/**
|
|
82
|
+
* Support-related triggers
|
|
83
|
+
*/
|
|
84
|
+
supportRelated: ['help', 'issue', 'problem', 'not working', 'stuck', 'question'],
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Risk score visual scale - use in skills that display risk scores
|
|
88
|
+
*/
|
|
89
|
+
export const RISK_SCORE_SCALE = `## Risk Score Scale
|
|
90
|
+
\`\`\`
|
|
91
|
+
0 20 40 60 80 100
|
|
92
|
+
|-----|-----|-----|-----|-----|
|
|
93
|
+
Very Low Med High Very
|
|
94
|
+
Low High
|
|
95
|
+
\`\`\`
|
|
96
|
+
|
|
97
|
+
**Interpretation**:
|
|
98
|
+
- **0-20 (Very Low)**: Minimal risk factors identified
|
|
99
|
+
- **21-40 (Low)**: Conservative profile suitable
|
|
100
|
+
- **41-60 (Medium)**: Moderate risk, requires awareness
|
|
101
|
+
- **61-80 (High)**: Elevated risk, for experienced users
|
|
102
|
+
- **81-100 (Very High)**: Maximum risk exposure`;
|
|
103
|
+
/**
|
|
104
|
+
* Helper to combine trigger arrays without duplicates
|
|
105
|
+
*
|
|
106
|
+
* @param triggerArrays - Arrays of trigger strings to combine
|
|
107
|
+
* @returns Combined array with lowercase, deduplicated triggers
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* const triggers = combineTriggers(
|
|
112
|
+
* COMMON_TRIGGERS.riskAnalysis,
|
|
113
|
+
* ['deep risk', 'comprehensive risk']
|
|
114
|
+
* );
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
export function combineTriggers(...triggerArrays) {
|
|
118
|
+
const combined = new Set();
|
|
119
|
+
for (const arr of triggerArrays) {
|
|
120
|
+
for (const trigger of arr) {
|
|
121
|
+
combined.add(trigger.toLowerCase().trim());
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return Array.from(combined);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Estimate token count for content
|
|
128
|
+
* Uses 3.5 chars/token ratio (accurate for Lagoon's dense technical content)
|
|
129
|
+
*
|
|
130
|
+
* @param content - String content to estimate
|
|
131
|
+
* @returns Estimated token count
|
|
132
|
+
*/
|
|
133
|
+
export function estimateTokens(content) {
|
|
134
|
+
return Math.ceil(content.length / 3.5);
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/skills/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC;;OAEG;IACH,kBAAkB,EAAE,iKAAiK;IAErL;;OAEG;IACH,aAAa,EAAE,mIAAmI;IAElJ;;OAEG;IACH,YAAY,EAAE,gIAAgI;IAE9I;;OAEG;IACH,IAAI,EAAE;;;;;;+HAMuH;CACrH,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;2CAkBG,CAAC;AAE5C;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B;;OAEG;IACH,YAAY,EAAE;QACZ,MAAM;QACN,eAAe;QACf,WAAW;QACX,YAAY;QACZ,iBAAiB;QACjB,YAAY;KACb;IAED;;OAEG;IACH,gBAAgB,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,CAAC;IAE7F;;OAEG;IACH,kBAAkB,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,cAAc,CAAC;IAEjG;;OAEG;IACH,cAAc,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,CAAC;CACxE,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;gDAagB,CAAC;AAEjD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,eAAe,CAAC,GAAG,aAAyB;IAC1D,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;QAChC,KAAK,MAAM,OAAO,IAAI,GAAG,EAAE,CAAC;YAC1B,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;AACzC,CAAC"}
|