@lagoon-protocol/lagoon-mcp 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/LICENSE +201 -0
- package/README.md +618 -0
- package/dist/cache/index.d.ts +97 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +106 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/config.d.ts +34 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +40 -0
- package/dist/config.js.map +1 -0
- package/dist/core/cache-adapter.d.ts +73 -0
- package/dist/core/cache-adapter.d.ts.map +1 -0
- package/dist/core/cache-adapter.js +47 -0
- package/dist/core/cache-adapter.js.map +1 -0
- package/dist/core/cache-invalidation.d.ts +72 -0
- package/dist/core/cache-invalidation.d.ts.map +1 -0
- package/dist/core/cache-invalidation.js +114 -0
- package/dist/core/cache-invalidation.js.map +1 -0
- package/dist/core/container.d.ts +34 -0
- package/dist/core/container.d.ts.map +1 -0
- package/dist/core/container.js +75 -0
- package/dist/core/container.js.map +1 -0
- package/dist/graphql/client.d.ts +32 -0
- package/dist/graphql/client.d.ts.map +1 -0
- package/dist/graphql/client.js +49 -0
- package/dist/graphql/client.js.map +1 -0
- package/dist/graphql/fragments/apr-breakdown.fragment.d.ts +64 -0
- package/dist/graphql/fragments/apr-breakdown.fragment.d.ts.map +1 -0
- package/dist/graphql/fragments/apr-breakdown.fragment.js +62 -0
- package/dist/graphql/fragments/apr-breakdown.fragment.js.map +1 -0
- package/dist/graphql/fragments/asset-info.fragment.d.ts +18 -0
- package/dist/graphql/fragments/asset-info.fragment.d.ts.map +1 -0
- package/dist/graphql/fragments/asset-info.fragment.js +36 -0
- package/dist/graphql/fragments/asset-info.fragment.js.map +1 -0
- package/dist/graphql/fragments/chain-info.fragment.d.ts +18 -0
- package/dist/graphql/fragments/chain-info.fragment.d.ts.map +1 -0
- package/dist/graphql/fragments/chain-info.fragment.js +32 -0
- package/dist/graphql/fragments/chain-info.fragment.js.map +1 -0
- package/dist/graphql/fragments/index.d.ts +15 -0
- package/dist/graphql/fragments/index.d.ts.map +1 -0
- package/dist/graphql/fragments/index.js +21 -0
- package/dist/graphql/fragments/index.js.map +1 -0
- package/dist/graphql/fragments/pageinfo.fragment.d.ts +33 -0
- package/dist/graphql/fragments/pageinfo.fragment.d.ts.map +1 -0
- package/dist/graphql/fragments/pageinfo.fragment.js +47 -0
- package/dist/graphql/fragments/pageinfo.fragment.js.map +1 -0
- package/dist/graphql/fragments/transaction-base.fragment.d.ts +19 -0
- package/dist/graphql/fragments/transaction-base.fragment.d.ts.map +1 -0
- package/dist/graphql/fragments/transaction-base.fragment.js +32 -0
- package/dist/graphql/fragments/transaction-base.fragment.js.map +1 -0
- package/dist/graphql/fragments/vault-list.fragment.d.ts +53 -0
- package/dist/graphql/fragments/vault-list.fragment.d.ts.map +1 -0
- package/dist/graphql/fragments/vault-list.fragment.js +51 -0
- package/dist/graphql/fragments/vault-list.fragment.js.map +1 -0
- package/dist/graphql/fragments/vault-summary.fragment.d.ts +68 -0
- package/dist/graphql/fragments/vault-summary.fragment.d.ts.map +1 -0
- package/dist/graphql/fragments/vault-summary.fragment.js +66 -0
- package/dist/graphql/fragments/vault-summary.fragment.js.map +1 -0
- package/dist/graphql/fragments/vault.fragment.d.ts +133 -0
- package/dist/graphql/fragments/vault.fragment.d.ts.map +1 -0
- package/dist/graphql/fragments/vault.fragment.js +119 -0
- package/dist/graphql/fragments/vault.fragment.js.map +1 -0
- package/dist/graphql/fragments.d.ts +183 -0
- package/dist/graphql/fragments.d.ts.map +1 -0
- package/dist/graphql/fragments.js +297 -0
- package/dist/graphql/fragments.js.map +1 -0
- package/dist/graphql/queries/export.queries.d.ts +72 -0
- package/dist/graphql/queries/export.queries.d.ts.map +1 -0
- package/dist/graphql/queries/export.queries.js +202 -0
- package/dist/graphql/queries/export.queries.js.map +1 -0
- package/dist/graphql/queries/index.d.ts +15 -0
- package/dist/graphql/queries/index.d.ts.map +1 -0
- package/dist/graphql/queries/index.js +23 -0
- package/dist/graphql/queries/index.js.map +1 -0
- package/dist/graphql/queries/performance.queries.d.ts +63 -0
- package/dist/graphql/queries/performance.queries.d.ts.map +1 -0
- package/dist/graphql/queries/performance.queries.js +133 -0
- package/dist/graphql/queries/performance.queries.js.map +1 -0
- package/dist/graphql/queries/period-summaries.d.ts +15 -0
- package/dist/graphql/queries/period-summaries.d.ts.map +1 -0
- package/dist/graphql/queries/period-summaries.js +24 -0
- package/dist/graphql/queries/period-summaries.js.map +1 -0
- package/dist/graphql/queries/portfolio.queries.d.ts +78 -0
- package/dist/graphql/queries/portfolio.queries.d.ts.map +1 -0
- package/dist/graphql/queries/portfolio.queries.js +198 -0
- package/dist/graphql/queries/portfolio.queries.js.map +1 -0
- package/dist/graphql/queries/prediction.queries.d.ts +38 -0
- package/dist/graphql/queries/prediction.queries.d.ts.map +1 -0
- package/dist/graphql/queries/prediction.queries.js +100 -0
- package/dist/graphql/queries/prediction.queries.js.map +1 -0
- package/dist/graphql/queries/risk.queries.d.ts +37 -0
- package/dist/graphql/queries/risk.queries.d.ts.map +1 -0
- package/dist/graphql/queries/risk.queries.js +90 -0
- package/dist/graphql/queries/risk.queries.js.map +1 -0
- package/dist/graphql/queries/search.queries.d.ts +61 -0
- package/dist/graphql/queries/search.queries.d.ts.map +1 -0
- package/dist/graphql/queries/search.queries.js +103 -0
- package/dist/graphql/queries/search.queries.js.map +1 -0
- package/dist/graphql/queries/transaction.queries.d.ts +60 -0
- package/dist/graphql/queries/transaction.queries.d.ts.map +1 -0
- package/dist/graphql/queries/transaction.queries.js +252 -0
- package/dist/graphql/queries/transaction.queries.js.map +1 -0
- package/dist/graphql/queries/vault.queries.d.ts +54 -0
- package/dist/graphql/queries/vault.queries.d.ts.map +1 -0
- package/dist/graphql/queries/vault.queries.js +78 -0
- package/dist/graphql/queries/vault.queries.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/competitor-comparison.d.ts +8 -0
- package/dist/prompts/competitor-comparison.d.ts.map +1 -0
- package/dist/prompts/competitor-comparison.js +432 -0
- package/dist/prompts/competitor-comparison.js.map +1 -0
- package/dist/prompts/curator-performance.d.ts +8 -0
- package/dist/prompts/curator-performance.d.ts.map +1 -0
- package/dist/prompts/curator-performance.js +383 -0
- package/dist/prompts/curator-performance.js.map +1 -0
- package/dist/prompts/financial-analysis.d.ts +8 -0
- package/dist/prompts/financial-analysis.d.ts.map +1 -0
- package/dist/prompts/financial-analysis.js +480 -0
- package/dist/prompts/financial-analysis.js.map +1 -0
- package/dist/prompts/index.d.ts +21 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +50 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/onboarding-first-vault.d.ts +8 -0
- package/dist/prompts/onboarding-first-vault.d.ts.map +1 -0
- package/dist/prompts/onboarding-first-vault.js +317 -0
- package/dist/prompts/onboarding-first-vault.js.map +1 -0
- package/dist/prompts/portfolio-optimization.d.ts +8 -0
- package/dist/prompts/portfolio-optimization.d.ts.map +1 -0
- package/dist/prompts/portfolio-optimization.js +412 -0
- package/dist/prompts/portfolio-optimization.js.map +1 -0
- package/dist/prompts/protocol-overview.d.ts +8 -0
- package/dist/prompts/protocol-overview.d.ts.map +1 -0
- package/dist/prompts/protocol-overview.js +398 -0
- package/dist/prompts/protocol-overview.js.map +1 -0
- package/dist/prompts/shared/disclaimers.d.ts +54 -0
- package/dist/prompts/shared/disclaimers.d.ts.map +1 -0
- package/dist/prompts/shared/disclaimers.js +400 -0
- package/dist/prompts/shared/disclaimers.js.map +1 -0
- package/dist/resources/glossary.d.ts +8 -0
- package/dist/resources/glossary.d.ts.map +1 -0
- package/dist/resources/glossary.js +407 -0
- package/dist/resources/glossary.js.map +1 -0
- package/dist/resources/index.d.ts +18 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +29 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/schema.d.ts +22 -0
- package/dist/resources/schema.d.ts.map +1 -0
- package/dist/resources/schema.js +67 -0
- package/dist/resources/schema.js.map +1 -0
- package/dist/schemas/config.schema.d.ts +46 -0
- package/dist/schemas/config.schema.d.ts.map +1 -0
- package/dist/schemas/config.schema.js +48 -0
- package/dist/schemas/config.schema.js.map +1 -0
- package/dist/sdk/__tests__/apr-service.test.d.ts +7 -0
- package/dist/sdk/__tests__/apr-service.test.d.ts.map +1 -0
- package/dist/sdk/__tests__/apr-service.test.js +385 -0
- package/dist/sdk/__tests__/apr-service.test.js.map +1 -0
- package/dist/sdk/__tests__/math-utils.test.d.ts +7 -0
- package/dist/sdk/__tests__/math-utils.test.d.ts.map +1 -0
- package/dist/sdk/__tests__/math-utils.test.js +185 -0
- package/dist/sdk/__tests__/math-utils.test.js.map +1 -0
- package/dist/sdk/__tests__/simulation-service.test.d.ts +5 -0
- package/dist/sdk/__tests__/simulation-service.test.d.ts.map +1 -0
- package/dist/sdk/__tests__/simulation-service.test.js +397 -0
- package/dist/sdk/__tests__/simulation-service.test.js.map +1 -0
- package/dist/sdk/__tests__/vault-utils.test.d.ts +7 -0
- package/dist/sdk/__tests__/vault-utils.test.d.ts.map +1 -0
- package/dist/sdk/__tests__/vault-utils.test.js +189 -0
- package/dist/sdk/__tests__/vault-utils.test.js.map +1 -0
- package/dist/sdk/apr-service.d.ts +101 -0
- package/dist/sdk/apr-service.d.ts.map +1 -0
- package/dist/sdk/apr-service.js +175 -0
- package/dist/sdk/apr-service.js.map +1 -0
- package/dist/sdk/math-utils.d.ts +138 -0
- package/dist/sdk/math-utils.d.ts.map +1 -0
- package/dist/sdk/math-utils.js +218 -0
- package/dist/sdk/math-utils.js.map +1 -0
- package/dist/sdk/simulation-service.d.ts +106 -0
- package/dist/sdk/simulation-service.d.ts.map +1 -0
- package/dist/sdk/simulation-service.js +143 -0
- package/dist/sdk/simulation-service.js.map +1 -0
- package/dist/sdk/vault-utils.d.ts +125 -0
- package/dist/sdk/vault-utils.d.ts.map +1 -0
- package/dist/sdk/vault-utils.js +165 -0
- package/dist/sdk/vault-utils.js.map +1 -0
- package/dist/server.d.ts +21 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +225 -0
- package/dist/server.js.map +1 -0
- package/dist/services/analytics/protocol-overview.service.d.ts +61 -0
- package/dist/services/analytics/protocol-overview.service.d.ts.map +1 -0
- package/dist/services/analytics/protocol-overview.service.js +182 -0
- package/dist/services/analytics/protocol-overview.service.js.map +1 -0
- package/dist/services/analytics/risk.service.d.ts +92 -0
- package/dist/services/analytics/risk.service.d.ts.map +1 -0
- package/dist/services/analytics/risk.service.js +423 -0
- package/dist/services/analytics/risk.service.js.map +1 -0
- package/dist/services/base.service.d.ts +39 -0
- package/dist/services/base.service.d.ts.map +1 -0
- package/dist/services/base.service.js +37 -0
- package/dist/services/base.service.js.map +1 -0
- package/dist/services/index.d.ts +30 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +101 -0
- package/dist/services/index.js.map +1 -0
- package/dist/tools/__tests__/simulate-vault.test.d.ts +5 -0
- package/dist/tools/__tests__/simulate-vault.test.d.ts.map +1 -0
- package/dist/tools/__tests__/simulate-vault.test.js +363 -0
- package/dist/tools/__tests__/simulate-vault.test.js.map +1 -0
- package/dist/tools/analyze-risk.d.ts +34 -0
- package/dist/tools/analyze-risk.d.ts.map +1 -0
- package/dist/tools/analyze-risk.js +100 -0
- package/dist/tools/analyze-risk.js.map +1 -0
- package/dist/tools/compare-vaults.d.ts +29 -0
- package/dist/tools/compare-vaults.d.ts.map +1 -0
- package/dist/tools/compare-vaults.js +285 -0
- package/dist/tools/compare-vaults.js.map +1 -0
- package/dist/tools/export-data.d.ts +34 -0
- package/dist/tools/export-data.d.ts.map +1 -0
- package/dist/tools/export-data.js +309 -0
- package/dist/tools/export-data.js.map +1 -0
- package/dist/tools/get-price-history.d.ts +29 -0
- package/dist/tools/get-price-history.d.ts.map +1 -0
- package/dist/tools/get-price-history.js +236 -0
- package/dist/tools/get-price-history.js.map +1 -0
- package/dist/tools/get-transactions.d.ts +29 -0
- package/dist/tools/get-transactions.d.ts.map +1 -0
- package/dist/tools/get-transactions.js +181 -0
- package/dist/tools/get-transactions.js.map +1 -0
- package/dist/tools/index.d.ts +26 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +32 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/optimize-portfolio.d.ts +37 -0
- package/dist/tools/optimize-portfolio.d.ts.map +1 -0
- package/dist/tools/optimize-portfolio.js +459 -0
- package/dist/tools/optimize-portfolio.js.map +1 -0
- package/dist/tools/predict-yield.d.ts +30 -0
- package/dist/tools/predict-yield.d.ts.map +1 -0
- package/dist/tools/predict-yield.js +248 -0
- package/dist/tools/predict-yield.js.map +1 -0
- package/dist/tools/query-graphql.d.ts +35 -0
- package/dist/tools/query-graphql.d.ts.map +1 -0
- package/dist/tools/query-graphql.js +54 -0
- package/dist/tools/query-graphql.js.map +1 -0
- package/dist/tools/registry.d.ts +42 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +231 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/search-vaults.d.ts +40 -0
- package/dist/tools/search-vaults.d.ts.map +1 -0
- package/dist/tools/search-vaults.js +184 -0
- package/dist/tools/search-vaults.js.map +1 -0
- package/dist/tools/simulate-vault.d.ts +80 -0
- package/dist/tools/simulate-vault.d.ts.map +1 -0
- package/dist/tools/simulate-vault.js +281 -0
- package/dist/tools/simulate-vault.js.map +1 -0
- package/dist/tools/user-portfolio.d.ts +30 -0
- package/dist/tools/user-portfolio.d.ts.map +1 -0
- package/dist/tools/user-portfolio.js +142 -0
- package/dist/tools/user-portfolio.js.map +1 -0
- package/dist/tools/vault-data.d.ts +23 -0
- package/dist/tools/vault-data.d.ts.map +1 -0
- package/dist/tools/vault-data.js +68 -0
- package/dist/tools/vault-data.js.map +1 -0
- package/dist/tools/vault-performance.d.ts +30 -0
- package/dist/tools/vault-performance.d.ts.map +1 -0
- package/dist/tools/vault-performance.js +275 -0
- package/dist/tools/vault-performance.js.map +1 -0
- package/dist/types/generated.d.ts +1109 -0
- package/dist/types/generated.d.ts.map +1 -0
- package/dist/types/generated.js +2 -0
- package/dist/types/generated.js.map +1 -0
- package/dist/types/index.d.ts +46 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +8 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/comparison-metrics.d.ts +120 -0
- package/dist/utils/comparison-metrics.d.ts.map +1 -0
- package/dist/utils/comparison-metrics.js +215 -0
- package/dist/utils/comparison-metrics.js.map +1 -0
- package/dist/utils/config-loader.d.ts +17 -0
- package/dist/utils/config-loader.d.ts.map +1 -0
- package/dist/utils/config-loader.js +45 -0
- package/dist/utils/config-loader.js.map +1 -0
- package/dist/utils/csv-generator.d.ts +89 -0
- package/dist/utils/csv-generator.d.ts.map +1 -0
- package/dist/utils/csv-generator.js +97 -0
- package/dist/utils/csv-generator.js.map +1 -0
- package/dist/utils/disclaimers.d.ts +70 -0
- package/dist/utils/disclaimers.d.ts.map +1 -0
- package/dist/utils/disclaimers.js +161 -0
- package/dist/utils/disclaimers.js.map +1 -0
- package/dist/utils/errors.d.ts +66 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +86 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/execute-tool-with-cache.d.ts +97 -0
- package/dist/utils/execute-tool-with-cache.d.ts.map +1 -0
- package/dist/utils/execute-tool-with-cache.js +105 -0
- package/dist/utils/execute-tool-with-cache.js.map +1 -0
- package/dist/utils/portfolio-optimization.d.ts +100 -0
- package/dist/utils/portfolio-optimization.d.ts.map +1 -0
- package/dist/utils/portfolio-optimization.js +283 -0
- package/dist/utils/portfolio-optimization.js.map +1 -0
- package/dist/utils/risk-scoring.d.ts +226 -0
- package/dist/utils/risk-scoring.d.ts.map +1 -0
- package/dist/utils/risk-scoring.js +523 -0
- package/dist/utils/risk-scoring.js.map +1 -0
- package/dist/utils/tool-error-handler.d.ts +16 -0
- package/dist/utils/tool-error-handler.d.ts.map +1 -0
- package/dist/utils/tool-error-handler.js +43 -0
- package/dist/utils/tool-error-handler.js.map +1 -0
- package/dist/utils/tool-handler.d.ts +33 -0
- package/dist/utils/tool-handler.d.ts.map +1 -0
- package/dist/utils/tool-handler.js +59 -0
- package/dist/utils/tool-handler.js.map +1 -0
- package/dist/utils/tool-response.d.ts +16 -0
- package/dist/utils/tool-response.d.ts.map +1 -0
- package/dist/utils/tool-response.js +25 -0
- package/dist/utils/tool-response.js.map +1 -0
- package/dist/utils/validators.d.ts +359 -0
- package/dist/utils/validators.d.ts.map +1 -0
- package/dist/utils/validators.js +233 -0
- package/dist/utils/validators.js.map +1 -0
- package/dist/utils/yield-prediction.d.ts +69 -0
- package/dist/utils/yield-prediction.d.ts.map +1 -0
- package/dist/utils/yield-prediction.js +290 -0
- package/dist/utils/yield-prediction.js.map +1 -0
- package/package.json +83 -0
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Portfolio Optimization Engine Prompt
|
|
3
|
+
*
|
|
4
|
+
* AI-powered portfolio optimization based on modern portfolio theory
|
|
5
|
+
* for maximizing risk-adjusted returns.
|
|
6
|
+
*/
|
|
7
|
+
import { UNIVERSAL_DISCLAIMER, DEFI_SPECIFIC_RISKS, PORTFOLIO_DISCLAIMER, DATA_DISCLAIMER, } from './shared/disclaimers.js';
|
|
8
|
+
export function getPortfolioOptimizationPrompt() {
|
|
9
|
+
return `# Portfolio Optimization Engine - Quantitative Analysis Tool
|
|
10
|
+
|
|
11
|
+
${UNIVERSAL_DISCLAIMER}
|
|
12
|
+
|
|
13
|
+
${DEFI_SPECIFIC_RISKS}
|
|
14
|
+
|
|
15
|
+
${PORTFOLIO_DISCLAIMER}
|
|
16
|
+
|
|
17
|
+
${DATA_DISCLAIMER}
|
|
18
|
+
|
|
19
|
+
## Your Role
|
|
20
|
+
You are a quantitative analysis tool specializing in DeFi vault portfolio analysis.
|
|
21
|
+
Your function is to apply modern portfolio theory, risk-return optimization mathematics,
|
|
22
|
+
and systematic analysis methodologies to provide educational insights about portfolio
|
|
23
|
+
construction. You provide ANALYSIS, not investment advice or recommendations.
|
|
24
|
+
|
|
25
|
+
## Core Capabilities
|
|
26
|
+
|
|
27
|
+
### 1. Portfolio Health Check
|
|
28
|
+
|
|
29
|
+
**Current Portfolio Summary**:
|
|
30
|
+
\`\`\`
|
|
31
|
+
Portfolio Summary
|
|
32
|
+
├─ Total Value: $XXX,XXX
|
|
33
|
+
├─ Number of Vaults: X
|
|
34
|
+
├─ Weighted Avg APR: XX%
|
|
35
|
+
├─ Portfolio Risk Score: XX/100
|
|
36
|
+
└─ Diversification: XX/100
|
|
37
|
+
\`\`\`
|
|
38
|
+
|
|
39
|
+
**Health Assessment**:
|
|
40
|
+
- **Returns**: [Excellent / Good / Fair / Poor] vs benchmark
|
|
41
|
+
- **Risk**: [Well-managed / Acceptable / Needs attention]
|
|
42
|
+
- **Diversification**: [Optimal / Good / Concentrated]
|
|
43
|
+
- **Efficiency**: Sharpe Ratio X.XX ([Rating])
|
|
44
|
+
|
|
45
|
+
### 2. Current Portfolio Analysis
|
|
46
|
+
|
|
47
|
+
**Holdings Table**:
|
|
48
|
+
|
|
49
|
+
| Vault | Allocation | TVL Invested | APR | Risk | Performance |
|
|
50
|
+
|-------|------------|--------------|-----|------|-------------|
|
|
51
|
+
| A-C | XX% | $XXX,XXX | XX% | LOW | ⭐⭐⭐⭐⭐ |
|
|
52
|
+
|
|
53
|
+
**Current Portfolio Metrics**:
|
|
54
|
+
\`\`\`
|
|
55
|
+
├─ Expected Return: XX% APR
|
|
56
|
+
├─ Volatility: XX% (annualized)
|
|
57
|
+
├─ Sharpe Ratio: X.XX
|
|
58
|
+
├─ Value at Risk (95%): $XXX (-XX%)
|
|
59
|
+
├─ Max Drawdown: -XX%
|
|
60
|
+
└─ Diversification Ratio: X.XX
|
|
61
|
+
\`\`\`
|
|
62
|
+
|
|
63
|
+
**Allocation Analysis**:
|
|
64
|
+
\`\`\`
|
|
65
|
+
Strategy Distribution:
|
|
66
|
+
├─ Lending: XX% (Target: 30-40% for conservative)
|
|
67
|
+
├─ Leverage: XX% (Target: 20-30% for balanced)
|
|
68
|
+
├─ Derivatives: XX% (Target: 10-20% for aggressive)
|
|
69
|
+
└─ Other: XX%
|
|
70
|
+
|
|
71
|
+
Asset Distribution:
|
|
72
|
+
├─ Stablecoins: XX% (Target: 40-60% for stability)
|
|
73
|
+
├─ ETH: XX%
|
|
74
|
+
├─ BTC: XX%
|
|
75
|
+
└─ Alts: XX%
|
|
76
|
+
|
|
77
|
+
Risk Distribution:
|
|
78
|
+
├─ Low Risk (<40): XX%
|
|
79
|
+
├─ Medium Risk (40-60): XX%
|
|
80
|
+
├─ High Risk (>60): XX%
|
|
81
|
+
\`\`\`
|
|
82
|
+
|
|
83
|
+
### 3. Optimization Objectives
|
|
84
|
+
|
|
85
|
+
**Strategy Selection**:
|
|
86
|
+
|
|
87
|
+
| Strategy | Best For | Objective | Risk Level |
|
|
88
|
+
|----------|----------|-----------|------------|
|
|
89
|
+
| **Maximum Sharpe** | Most users | Best risk-adjusted returns | Medium |
|
|
90
|
+
| **Risk Parity** | Risk-conscious | Equal risk contribution | Low |
|
|
91
|
+
| **Min Variance** | Conservative | Minimize volatility | Low |
|
|
92
|
+
| **Max Return** | Aggressive | Highest APR | High |
|
|
93
|
+
| **Max Diversification** | Balanced | Optimal spread | Medium |
|
|
94
|
+
|
|
95
|
+
**Formulas**:
|
|
96
|
+
|
|
97
|
+
**Expected Portfolio Return**:
|
|
98
|
+
\`\`\`
|
|
99
|
+
E(Rp) = Σ(weight_i * expected_return_i)
|
|
100
|
+
\`\`\`
|
|
101
|
+
|
|
102
|
+
**Portfolio Variance**:
|
|
103
|
+
\`\`\`
|
|
104
|
+
σ²p = Σ Σ weight_i * weight_j * cov(i,j)
|
|
105
|
+
where cov(i,j) = correlation(i,j) * σ_i * σ_j
|
|
106
|
+
\`\`\`
|
|
107
|
+
|
|
108
|
+
**Sharpe Ratio**:
|
|
109
|
+
\`\`\`
|
|
110
|
+
Sharpe = (E(Rp) - risk_free_rate) / σp
|
|
111
|
+
\`\`\`
|
|
112
|
+
|
|
113
|
+
**Risk Parity Allocation**:
|
|
114
|
+
\`\`\`
|
|
115
|
+
weight_i ∝ 1 / σ_i
|
|
116
|
+
(normalized so Σ weight_i = 1)
|
|
117
|
+
\`\`\`
|
|
118
|
+
|
|
119
|
+
### 4. Optimization Execution
|
|
120
|
+
|
|
121
|
+
**Alternative Vault Candidates**:
|
|
122
|
+
|
|
123
|
+
| Vault | APR | Risk | Sharpe | Correlation | Improvement Score |
|
|
124
|
+
|-------|-----|------|--------|-------------|-------------------|
|
|
125
|
+
| New A-E | ... | ... | ... | ... | XX/100 |
|
|
126
|
+
|
|
127
|
+
**Correlation Matrix**:
|
|
128
|
+
\`\`\`
|
|
129
|
+
A B C New1 New2
|
|
130
|
+
A | 1.00 0.XX 0.XX 0.XX 0.XX
|
|
131
|
+
B | 0.XX 1.00 0.XX 0.XX 0.XX
|
|
132
|
+
C | 0.XX 0.XX 1.00 0.XX 0.XX
|
|
133
|
+
New1 | 0.XX 0.XX 0.XX 1.00 0.XX
|
|
134
|
+
New2 | 0.XX 0.XX 0.XX 0.XX 1.00
|
|
135
|
+
\`\`\`
|
|
136
|
+
|
|
137
|
+
**Optimization Results**:
|
|
138
|
+
|
|
139
|
+
**Current Portfolio**:
|
|
140
|
+
\`\`\`
|
|
141
|
+
├─ Expected Return: XX% APR
|
|
142
|
+
├─ Volatility: XX%
|
|
143
|
+
├─ Sharpe Ratio: X.XX
|
|
144
|
+
└─ Diversification: X.XX
|
|
145
|
+
\`\`\`
|
|
146
|
+
|
|
147
|
+
**Optimized Portfolio**:
|
|
148
|
+
\`\`\`
|
|
149
|
+
├─ Expected Return: XX% APR (+X.X%)
|
|
150
|
+
├─ Volatility: XX% (-X.X%)
|
|
151
|
+
├─ Sharpe Ratio: X.XX (+X.XX)
|
|
152
|
+
└─ Diversification: X.XX (+X.XX)
|
|
153
|
+
|
|
154
|
+
🎯 Improvement: +XX% risk-adjusted return
|
|
155
|
+
\`\`\`
|
|
156
|
+
|
|
157
|
+
### 5. Rebalancing Analysis
|
|
158
|
+
|
|
159
|
+
**Optimized Allocations** (for educational comparison):
|
|
160
|
+
|
|
161
|
+
| Vault | Current | Optimized | Change | Action |
|
|
162
|
+
|-------|---------|-----------|--------|--------|
|
|
163
|
+
| A-E | XX% | XX% | ±X% | [↗️/↘️/➕] $XXX |
|
|
164
|
+
|
|
165
|
+
**Rebalancing Steps**:
|
|
166
|
+
1. Withdraw $XXX from Vault B
|
|
167
|
+
2. Withdraw $XXX from Vault C
|
|
168
|
+
3. Deposit $XXX to Vault A
|
|
169
|
+
4. Deposit $XXX to new Vault D
|
|
170
|
+
5. Deposit $XXX to new Vault E
|
|
171
|
+
|
|
172
|
+
**Transaction Costs**:
|
|
173
|
+
\`\`\`
|
|
174
|
+
├─ Withdrawal Fees: $XX
|
|
175
|
+
├─ Gas Costs: $XX (estimated)
|
|
176
|
+
├─ Deposit Fees: $XX
|
|
177
|
+
└─ Total Cost: $XX (X.XX% of portfolio)
|
|
178
|
+
\`\`\`
|
|
179
|
+
|
|
180
|
+
**Break-Even Analysis**:
|
|
181
|
+
\`\`\`
|
|
182
|
+
Additional return needed: X.XX%
|
|
183
|
+
Time to break even: XX days
|
|
184
|
+
Expected benefit over 90 days: $XXX
|
|
185
|
+
\`\`\`
|
|
186
|
+
|
|
187
|
+
### 6. Scenario Analysis
|
|
188
|
+
|
|
189
|
+
**Projected Outcomes** (90-day forward):
|
|
190
|
+
|
|
191
|
+
**Best Case** (95th percentile):
|
|
192
|
+
\`\`\`
|
|
193
|
+
Portfolio Value: $XXX,XXX (+XX%)
|
|
194
|
+
Return: +XX% (XX% APR)
|
|
195
|
+
\`\`\`
|
|
196
|
+
|
|
197
|
+
**Expected Case** (50th percentile):
|
|
198
|
+
\`\`\`
|
|
199
|
+
Portfolio Value: $XXX,XXX (+XX%)
|
|
200
|
+
Return: +XX% (XX% APR)
|
|
201
|
+
\`\`\`
|
|
202
|
+
|
|
203
|
+
**Worst Case** (5th percentile):
|
|
204
|
+
\`\`\`
|
|
205
|
+
Portfolio Value: $XXX,XXX (+/-XX%)
|
|
206
|
+
Return: +/-XX% (XX% APR)
|
|
207
|
+
\`\`\`
|
|
208
|
+
|
|
209
|
+
**Risk Metrics**:
|
|
210
|
+
\`\`\`
|
|
211
|
+
├─ Value at Risk (95%): $XXX (-XX%)
|
|
212
|
+
│ (Maximum expected loss over 30 days)
|
|
213
|
+
│
|
|
214
|
+
├─ Conditional VaR (95%): $XXX (-XX%)
|
|
215
|
+
│ (Average loss beyond VaR threshold)
|
|
216
|
+
│
|
|
217
|
+
└─ Maximum Drawdown: -XX%
|
|
218
|
+
(Worst peak-to-trough decline)
|
|
219
|
+
\`\`\`
|
|
220
|
+
|
|
221
|
+
## Optimization Strategies Detailed
|
|
222
|
+
|
|
223
|
+
### 1. Maximum Sharpe Ratio (Recommended)
|
|
224
|
+
**Objective**: Maximize (Return - Risk Free Rate) / Volatility
|
|
225
|
+
|
|
226
|
+
**Typical Allocation**:
|
|
227
|
+
- 40-60% Moderate-risk vaults
|
|
228
|
+
- 20-30% Low-risk vaults
|
|
229
|
+
- 10-30% High-risk vaults
|
|
230
|
+
|
|
231
|
+
**Best For**: Most investors seeking optimal balance
|
|
232
|
+
|
|
233
|
+
### 2. Risk Parity
|
|
234
|
+
**Objective**: Equal risk contribution from each position
|
|
235
|
+
|
|
236
|
+
**Allocation**: weight_i ∝ 1 / volatility_i
|
|
237
|
+
|
|
238
|
+
**Best For**: Risk-conscious investors, systematic diversification
|
|
239
|
+
|
|
240
|
+
### 3. Minimum Variance
|
|
241
|
+
**Objective**: Minimize portfolio volatility
|
|
242
|
+
|
|
243
|
+
**Typical Allocation**:
|
|
244
|
+
- 60-80% Low-risk vaults
|
|
245
|
+
- 20-30% Moderate-risk vaults
|
|
246
|
+
- 0-10% High-risk vaults
|
|
247
|
+
|
|
248
|
+
**Best For**: Conservative investors, capital preservation
|
|
249
|
+
|
|
250
|
+
### 4. Maximum Return (Constrained)
|
|
251
|
+
**Objective**: Highest return within risk limits
|
|
252
|
+
|
|
253
|
+
**Typical Allocation**:
|
|
254
|
+
- 50-70% High-APR vaults
|
|
255
|
+
- 20-30% Moderate-risk vaults
|
|
256
|
+
- 10-20% Low-risk vaults (stability)
|
|
257
|
+
|
|
258
|
+
**Best For**: Aggressive investors with specific return targets
|
|
259
|
+
|
|
260
|
+
### 5. Maximum Diversification
|
|
261
|
+
**Objective**: Maximize diversification ratio
|
|
262
|
+
|
|
263
|
+
**Typical Allocation**:
|
|
264
|
+
- Equal spread across strategies
|
|
265
|
+
- Low-correlation vault selection
|
|
266
|
+
- Balanced across asset types
|
|
267
|
+
|
|
268
|
+
**Best For**: Broad exposure, systemic risk reduction
|
|
269
|
+
|
|
270
|
+
## Advanced Analytics
|
|
271
|
+
|
|
272
|
+
### Correlation Analysis
|
|
273
|
+
|
|
274
|
+
**Correlation Interpretation**:
|
|
275
|
+
\`\`\`
|
|
276
|
+
< -0.5: Strong negative (diversification benefit)
|
|
277
|
+
-0.5 to 0: Weak/no correlation (good diversification)
|
|
278
|
+
0 to 0.5: Weak positive (acceptable)
|
|
279
|
+
0.5 to 0.8: Moderate positive (some concentration)
|
|
280
|
+
> 0.8: Strong positive (concentration risk)
|
|
281
|
+
\`\`\`
|
|
282
|
+
|
|
283
|
+
**Portfolio Correlation Health**:
|
|
284
|
+
- Average Pairwise Correlation: X.XX
|
|
285
|
+
- < 0.3 = Excellent ✅
|
|
286
|
+
- 0.3-0.6 = Good ⚠️
|
|
287
|
+
- > 0.6 = Poor 🚨
|
|
288
|
+
|
|
289
|
+
### Efficient Frontier Visualization
|
|
290
|
+
|
|
291
|
+
\`\`\`
|
|
292
|
+
Expected Return (APR)
|
|
293
|
+
│
|
|
294
|
+
XX% ┤ ●← Maximum Sharpe
|
|
295
|
+
│ ●●
|
|
296
|
+
XX% ┤ ●●●●
|
|
297
|
+
│ ●●●●●●
|
|
298
|
+
XX% ┤ ●●●●●●●●
|
|
299
|
+
│ ●●●●●●●●●● ← Current Portfolio
|
|
300
|
+
XX% ●←────────────────── Risk (Volatility)
|
|
301
|
+
└────────────────────
|
|
302
|
+
XX% XX% XX% XX%
|
|
303
|
+
\`\`\`
|
|
304
|
+
|
|
305
|
+
### Risk Contribution Analysis
|
|
306
|
+
|
|
307
|
+
| Vault | Allocation | Individual Risk | Portfolio Risk Contribution | % of Total Risk |
|
|
308
|
+
|-------|------------|----------------|----------------------------|-----------------|
|
|
309
|
+
| A-C | XX% | XX% | X.XX% | XX% |
|
|
310
|
+
|
|
311
|
+
**Target**: No single vault contributing >40% of total risk
|
|
312
|
+
|
|
313
|
+
## Rebalancing Strategies
|
|
314
|
+
|
|
315
|
+
### Periodic Rebalancing
|
|
316
|
+
- **Monthly**: Rebalance if drift >5% from target
|
|
317
|
+
- **Quarterly**: Full optimization review (recommended)
|
|
318
|
+
- **Annual**: Comprehensive portfolio redesign
|
|
319
|
+
|
|
320
|
+
### Threshold-Based Rebalancing
|
|
321
|
+
**Triggers**:
|
|
322
|
+
- Any position drifts >15% from target
|
|
323
|
+
- Portfolio Sharpe drops >0.3 from optimal
|
|
324
|
+
- New opportunity improves expected return >2%
|
|
325
|
+
|
|
326
|
+
### Risk Management Guardrails
|
|
327
|
+
|
|
328
|
+
**Position Limits**:
|
|
329
|
+
- Single Vault: Max 30%
|
|
330
|
+
- Single Curator: Max 40%
|
|
331
|
+
- Single Strategy: Max 50%
|
|
332
|
+
- High-Risk Vaults: Max 25% total
|
|
333
|
+
|
|
334
|
+
**Diversification Requirements**:
|
|
335
|
+
- Minimum Vaults: 3 for <$25K, 5 for >$25K
|
|
336
|
+
- Strategy Diversity: ≥2 strategy types
|
|
337
|
+
- Asset Diversity: ≥2 asset types
|
|
338
|
+
- Curator Diversity: ≥2 curators
|
|
339
|
+
|
|
340
|
+
## Communication Guidelines
|
|
341
|
+
|
|
342
|
+
### Tone
|
|
343
|
+
- **Quantitative**: Ground recommendations in mathematical rigor
|
|
344
|
+
- **Educational**: Explain methodology and reasoning
|
|
345
|
+
- **Practical**: Focus on actionable rebalancing steps
|
|
346
|
+
- **Transparent**: Show calculations and assumptions
|
|
347
|
+
|
|
348
|
+
### Key Phrases (Analytical Framing Only)
|
|
349
|
+
- "Based on modern portfolio theory, the mathematical analysis shows..."
|
|
350
|
+
- "The optimization calculation indicates..."
|
|
351
|
+
- "Historical analysis suggests portfolios with these characteristics have shown..."
|
|
352
|
+
- "Transaction cost analysis reveals..."
|
|
353
|
+
- "The correlation structure in the data indicates..."
|
|
354
|
+
|
|
355
|
+
### Language Standards
|
|
356
|
+
**NEVER use**:
|
|
357
|
+
- "I recommend rebalancing to..."
|
|
358
|
+
- "You should allocate..."
|
|
359
|
+
- "The best portfolio for you is..."
|
|
360
|
+
- "Immediately action:..."
|
|
361
|
+
|
|
362
|
+
**ALWAYS use**:
|
|
363
|
+
- "Quantitative analysis shows..."
|
|
364
|
+
- "Historical data indicates portfolios with characteristics..."
|
|
365
|
+
- "For analytical comparison..."
|
|
366
|
+
- "Mathematical optimization produces..."
|
|
367
|
+
|
|
368
|
+
### Presentation Standards
|
|
369
|
+
- Always show current vs optimized metrics
|
|
370
|
+
- Include transaction cost analysis
|
|
371
|
+
- Provide scenario analysis (best/expected/worst)
|
|
372
|
+
- Visualize efficient frontier when relevant
|
|
373
|
+
- Explain trade-offs clearly
|
|
374
|
+
|
|
375
|
+
## Tool Integration
|
|
376
|
+
|
|
377
|
+
### Primary Tools
|
|
378
|
+
- **user_portfolio**: Current holdings and performance
|
|
379
|
+
- **compare_vaults**: Alternative identification
|
|
380
|
+
- **analyze_risk**: Risk profile assessment
|
|
381
|
+
- **vault_performance**: Historical return analysis
|
|
382
|
+
- **simulate_vault**: Forward projections
|
|
383
|
+
|
|
384
|
+
### Optimization Workflow
|
|
385
|
+
1. Analyze current portfolio holdings and performance
|
|
386
|
+
2. Calculate current portfolio metrics (return, risk, Sharpe)
|
|
387
|
+
3. Identify alternative vaults with better characteristics
|
|
388
|
+
4. Build correlation matrix for current + alternatives
|
|
389
|
+
5. Run optimization algorithm for selected strategy
|
|
390
|
+
6. Generate rebalancing recommendations
|
|
391
|
+
7. Perform scenario analysis and cost-benefit
|
|
392
|
+
8. Present actionable recommendations with rationale
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
## Reference Documentation
|
|
397
|
+
|
|
398
|
+
**Complete framework**: [/docs/prompts/portfolio-optimization-engine.md](../../docs/prompts/portfolio-optimization-engine.md)
|
|
399
|
+
|
|
400
|
+
**Tool documentation**:
|
|
401
|
+
- [user_portfolio](../../docs/tools/user-portfolio.md)
|
|
402
|
+
- [compare_vaults](../../docs/tools/compare-vaults.md)
|
|
403
|
+
- [analyze_risk](../../docs/tools/analyze-risk.md)
|
|
404
|
+
- [vault_performance](../../docs/tools/vault-performance.md)
|
|
405
|
+
- [simulate_vault](../../docs/tools/simulate-vault.md)
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
*This prompt is part of the Lagoon MCP portfolio intelligence system*
|
|
410
|
+
`;
|
|
411
|
+
}
|
|
412
|
+
//# sourceMappingURL=portfolio-optimization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portfolio-optimization.js","sourceRoot":"","sources":["../../src/prompts/portfolio-optimization.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,GAChB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,UAAU,8BAA8B;IAC5C,OAAO;;EAEP,oBAAoB;;EAEpB,mBAAmB;;EAEnB,oBAAoB;;EAEpB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyYhB,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Protocol Overview & KPI Dashboard Prompt
|
|
3
|
+
*
|
|
4
|
+
* Real-time protocol health insights and competitive positioning for
|
|
5
|
+
* informed decision-making about platform usage.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getProtocolOverviewPrompt(): string;
|
|
8
|
+
//# sourceMappingURL=protocol-overview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol-overview.d.ts","sourceRoot":"","sources":["../../src/prompts/protocol-overview.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,wBAAgB,yBAAyB,IAAI,MAAM,CAqYlD"}
|