@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.
Files changed (335) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +618 -0
  3. package/dist/cache/index.d.ts +97 -0
  4. package/dist/cache/index.d.ts.map +1 -0
  5. package/dist/cache/index.js +106 -0
  6. package/dist/cache/index.js.map +1 -0
  7. package/dist/config.d.ts +34 -0
  8. package/dist/config.d.ts.map +1 -0
  9. package/dist/config.js +40 -0
  10. package/dist/config.js.map +1 -0
  11. package/dist/core/cache-adapter.d.ts +73 -0
  12. package/dist/core/cache-adapter.d.ts.map +1 -0
  13. package/dist/core/cache-adapter.js +47 -0
  14. package/dist/core/cache-adapter.js.map +1 -0
  15. package/dist/core/cache-invalidation.d.ts +72 -0
  16. package/dist/core/cache-invalidation.d.ts.map +1 -0
  17. package/dist/core/cache-invalidation.js +114 -0
  18. package/dist/core/cache-invalidation.js.map +1 -0
  19. package/dist/core/container.d.ts +34 -0
  20. package/dist/core/container.d.ts.map +1 -0
  21. package/dist/core/container.js +75 -0
  22. package/dist/core/container.js.map +1 -0
  23. package/dist/graphql/client.d.ts +32 -0
  24. package/dist/graphql/client.d.ts.map +1 -0
  25. package/dist/graphql/client.js +49 -0
  26. package/dist/graphql/client.js.map +1 -0
  27. package/dist/graphql/fragments/apr-breakdown.fragment.d.ts +64 -0
  28. package/dist/graphql/fragments/apr-breakdown.fragment.d.ts.map +1 -0
  29. package/dist/graphql/fragments/apr-breakdown.fragment.js +62 -0
  30. package/dist/graphql/fragments/apr-breakdown.fragment.js.map +1 -0
  31. package/dist/graphql/fragments/asset-info.fragment.d.ts +18 -0
  32. package/dist/graphql/fragments/asset-info.fragment.d.ts.map +1 -0
  33. package/dist/graphql/fragments/asset-info.fragment.js +36 -0
  34. package/dist/graphql/fragments/asset-info.fragment.js.map +1 -0
  35. package/dist/graphql/fragments/chain-info.fragment.d.ts +18 -0
  36. package/dist/graphql/fragments/chain-info.fragment.d.ts.map +1 -0
  37. package/dist/graphql/fragments/chain-info.fragment.js +32 -0
  38. package/dist/graphql/fragments/chain-info.fragment.js.map +1 -0
  39. package/dist/graphql/fragments/index.d.ts +15 -0
  40. package/dist/graphql/fragments/index.d.ts.map +1 -0
  41. package/dist/graphql/fragments/index.js +21 -0
  42. package/dist/graphql/fragments/index.js.map +1 -0
  43. package/dist/graphql/fragments/pageinfo.fragment.d.ts +33 -0
  44. package/dist/graphql/fragments/pageinfo.fragment.d.ts.map +1 -0
  45. package/dist/graphql/fragments/pageinfo.fragment.js +47 -0
  46. package/dist/graphql/fragments/pageinfo.fragment.js.map +1 -0
  47. package/dist/graphql/fragments/transaction-base.fragment.d.ts +19 -0
  48. package/dist/graphql/fragments/transaction-base.fragment.d.ts.map +1 -0
  49. package/dist/graphql/fragments/transaction-base.fragment.js +32 -0
  50. package/dist/graphql/fragments/transaction-base.fragment.js.map +1 -0
  51. package/dist/graphql/fragments/vault-list.fragment.d.ts +53 -0
  52. package/dist/graphql/fragments/vault-list.fragment.d.ts.map +1 -0
  53. package/dist/graphql/fragments/vault-list.fragment.js +51 -0
  54. package/dist/graphql/fragments/vault-list.fragment.js.map +1 -0
  55. package/dist/graphql/fragments/vault-summary.fragment.d.ts +68 -0
  56. package/dist/graphql/fragments/vault-summary.fragment.d.ts.map +1 -0
  57. package/dist/graphql/fragments/vault-summary.fragment.js +66 -0
  58. package/dist/graphql/fragments/vault-summary.fragment.js.map +1 -0
  59. package/dist/graphql/fragments/vault.fragment.d.ts +133 -0
  60. package/dist/graphql/fragments/vault.fragment.d.ts.map +1 -0
  61. package/dist/graphql/fragments/vault.fragment.js +119 -0
  62. package/dist/graphql/fragments/vault.fragment.js.map +1 -0
  63. package/dist/graphql/fragments.d.ts +183 -0
  64. package/dist/graphql/fragments.d.ts.map +1 -0
  65. package/dist/graphql/fragments.js +297 -0
  66. package/dist/graphql/fragments.js.map +1 -0
  67. package/dist/graphql/queries/export.queries.d.ts +72 -0
  68. package/dist/graphql/queries/export.queries.d.ts.map +1 -0
  69. package/dist/graphql/queries/export.queries.js +202 -0
  70. package/dist/graphql/queries/export.queries.js.map +1 -0
  71. package/dist/graphql/queries/index.d.ts +15 -0
  72. package/dist/graphql/queries/index.d.ts.map +1 -0
  73. package/dist/graphql/queries/index.js +23 -0
  74. package/dist/graphql/queries/index.js.map +1 -0
  75. package/dist/graphql/queries/performance.queries.d.ts +63 -0
  76. package/dist/graphql/queries/performance.queries.d.ts.map +1 -0
  77. package/dist/graphql/queries/performance.queries.js +133 -0
  78. package/dist/graphql/queries/performance.queries.js.map +1 -0
  79. package/dist/graphql/queries/period-summaries.d.ts +15 -0
  80. package/dist/graphql/queries/period-summaries.d.ts.map +1 -0
  81. package/dist/graphql/queries/period-summaries.js +24 -0
  82. package/dist/graphql/queries/period-summaries.js.map +1 -0
  83. package/dist/graphql/queries/portfolio.queries.d.ts +78 -0
  84. package/dist/graphql/queries/portfolio.queries.d.ts.map +1 -0
  85. package/dist/graphql/queries/portfolio.queries.js +198 -0
  86. package/dist/graphql/queries/portfolio.queries.js.map +1 -0
  87. package/dist/graphql/queries/prediction.queries.d.ts +38 -0
  88. package/dist/graphql/queries/prediction.queries.d.ts.map +1 -0
  89. package/dist/graphql/queries/prediction.queries.js +100 -0
  90. package/dist/graphql/queries/prediction.queries.js.map +1 -0
  91. package/dist/graphql/queries/risk.queries.d.ts +37 -0
  92. package/dist/graphql/queries/risk.queries.d.ts.map +1 -0
  93. package/dist/graphql/queries/risk.queries.js +90 -0
  94. package/dist/graphql/queries/risk.queries.js.map +1 -0
  95. package/dist/graphql/queries/search.queries.d.ts +61 -0
  96. package/dist/graphql/queries/search.queries.d.ts.map +1 -0
  97. package/dist/graphql/queries/search.queries.js +103 -0
  98. package/dist/graphql/queries/search.queries.js.map +1 -0
  99. package/dist/graphql/queries/transaction.queries.d.ts +60 -0
  100. package/dist/graphql/queries/transaction.queries.d.ts.map +1 -0
  101. package/dist/graphql/queries/transaction.queries.js +252 -0
  102. package/dist/graphql/queries/transaction.queries.js.map +1 -0
  103. package/dist/graphql/queries/vault.queries.d.ts +54 -0
  104. package/dist/graphql/queries/vault.queries.d.ts.map +1 -0
  105. package/dist/graphql/queries/vault.queries.js +78 -0
  106. package/dist/graphql/queries/vault.queries.js.map +1 -0
  107. package/dist/index.d.ts +12 -0
  108. package/dist/index.d.ts.map +1 -0
  109. package/dist/index.js +32 -0
  110. package/dist/index.js.map +1 -0
  111. package/dist/prompts/competitor-comparison.d.ts +8 -0
  112. package/dist/prompts/competitor-comparison.d.ts.map +1 -0
  113. package/dist/prompts/competitor-comparison.js +432 -0
  114. package/dist/prompts/competitor-comparison.js.map +1 -0
  115. package/dist/prompts/curator-performance.d.ts +8 -0
  116. package/dist/prompts/curator-performance.d.ts.map +1 -0
  117. package/dist/prompts/curator-performance.js +383 -0
  118. package/dist/prompts/curator-performance.js.map +1 -0
  119. package/dist/prompts/financial-analysis.d.ts +8 -0
  120. package/dist/prompts/financial-analysis.d.ts.map +1 -0
  121. package/dist/prompts/financial-analysis.js +480 -0
  122. package/dist/prompts/financial-analysis.js.map +1 -0
  123. package/dist/prompts/index.d.ts +21 -0
  124. package/dist/prompts/index.d.ts.map +1 -0
  125. package/dist/prompts/index.js +50 -0
  126. package/dist/prompts/index.js.map +1 -0
  127. package/dist/prompts/onboarding-first-vault.d.ts +8 -0
  128. package/dist/prompts/onboarding-first-vault.d.ts.map +1 -0
  129. package/dist/prompts/onboarding-first-vault.js +317 -0
  130. package/dist/prompts/onboarding-first-vault.js.map +1 -0
  131. package/dist/prompts/portfolio-optimization.d.ts +8 -0
  132. package/dist/prompts/portfolio-optimization.d.ts.map +1 -0
  133. package/dist/prompts/portfolio-optimization.js +412 -0
  134. package/dist/prompts/portfolio-optimization.js.map +1 -0
  135. package/dist/prompts/protocol-overview.d.ts +8 -0
  136. package/dist/prompts/protocol-overview.d.ts.map +1 -0
  137. package/dist/prompts/protocol-overview.js +398 -0
  138. package/dist/prompts/protocol-overview.js.map +1 -0
  139. package/dist/prompts/shared/disclaimers.d.ts +54 -0
  140. package/dist/prompts/shared/disclaimers.d.ts.map +1 -0
  141. package/dist/prompts/shared/disclaimers.js +400 -0
  142. package/dist/prompts/shared/disclaimers.js.map +1 -0
  143. package/dist/resources/glossary.d.ts +8 -0
  144. package/dist/resources/glossary.d.ts.map +1 -0
  145. package/dist/resources/glossary.js +407 -0
  146. package/dist/resources/glossary.js.map +1 -0
  147. package/dist/resources/index.d.ts +18 -0
  148. package/dist/resources/index.d.ts.map +1 -0
  149. package/dist/resources/index.js +29 -0
  150. package/dist/resources/index.js.map +1 -0
  151. package/dist/resources/schema.d.ts +22 -0
  152. package/dist/resources/schema.d.ts.map +1 -0
  153. package/dist/resources/schema.js +67 -0
  154. package/dist/resources/schema.js.map +1 -0
  155. package/dist/schemas/config.schema.d.ts +46 -0
  156. package/dist/schemas/config.schema.d.ts.map +1 -0
  157. package/dist/schemas/config.schema.js +48 -0
  158. package/dist/schemas/config.schema.js.map +1 -0
  159. package/dist/sdk/__tests__/apr-service.test.d.ts +7 -0
  160. package/dist/sdk/__tests__/apr-service.test.d.ts.map +1 -0
  161. package/dist/sdk/__tests__/apr-service.test.js +385 -0
  162. package/dist/sdk/__tests__/apr-service.test.js.map +1 -0
  163. package/dist/sdk/__tests__/math-utils.test.d.ts +7 -0
  164. package/dist/sdk/__tests__/math-utils.test.d.ts.map +1 -0
  165. package/dist/sdk/__tests__/math-utils.test.js +185 -0
  166. package/dist/sdk/__tests__/math-utils.test.js.map +1 -0
  167. package/dist/sdk/__tests__/simulation-service.test.d.ts +5 -0
  168. package/dist/sdk/__tests__/simulation-service.test.d.ts.map +1 -0
  169. package/dist/sdk/__tests__/simulation-service.test.js +397 -0
  170. package/dist/sdk/__tests__/simulation-service.test.js.map +1 -0
  171. package/dist/sdk/__tests__/vault-utils.test.d.ts +7 -0
  172. package/dist/sdk/__tests__/vault-utils.test.d.ts.map +1 -0
  173. package/dist/sdk/__tests__/vault-utils.test.js +189 -0
  174. package/dist/sdk/__tests__/vault-utils.test.js.map +1 -0
  175. package/dist/sdk/apr-service.d.ts +101 -0
  176. package/dist/sdk/apr-service.d.ts.map +1 -0
  177. package/dist/sdk/apr-service.js +175 -0
  178. package/dist/sdk/apr-service.js.map +1 -0
  179. package/dist/sdk/math-utils.d.ts +138 -0
  180. package/dist/sdk/math-utils.d.ts.map +1 -0
  181. package/dist/sdk/math-utils.js +218 -0
  182. package/dist/sdk/math-utils.js.map +1 -0
  183. package/dist/sdk/simulation-service.d.ts +106 -0
  184. package/dist/sdk/simulation-service.d.ts.map +1 -0
  185. package/dist/sdk/simulation-service.js +143 -0
  186. package/dist/sdk/simulation-service.js.map +1 -0
  187. package/dist/sdk/vault-utils.d.ts +125 -0
  188. package/dist/sdk/vault-utils.d.ts.map +1 -0
  189. package/dist/sdk/vault-utils.js +165 -0
  190. package/dist/sdk/vault-utils.js.map +1 -0
  191. package/dist/server.d.ts +21 -0
  192. package/dist/server.d.ts.map +1 -0
  193. package/dist/server.js +225 -0
  194. package/dist/server.js.map +1 -0
  195. package/dist/services/analytics/protocol-overview.service.d.ts +61 -0
  196. package/dist/services/analytics/protocol-overview.service.d.ts.map +1 -0
  197. package/dist/services/analytics/protocol-overview.service.js +182 -0
  198. package/dist/services/analytics/protocol-overview.service.js.map +1 -0
  199. package/dist/services/analytics/risk.service.d.ts +92 -0
  200. package/dist/services/analytics/risk.service.d.ts.map +1 -0
  201. package/dist/services/analytics/risk.service.js +423 -0
  202. package/dist/services/analytics/risk.service.js.map +1 -0
  203. package/dist/services/base.service.d.ts +39 -0
  204. package/dist/services/base.service.d.ts.map +1 -0
  205. package/dist/services/base.service.js +37 -0
  206. package/dist/services/base.service.js.map +1 -0
  207. package/dist/services/index.d.ts +30 -0
  208. package/dist/services/index.d.ts.map +1 -0
  209. package/dist/services/index.js +101 -0
  210. package/dist/services/index.js.map +1 -0
  211. package/dist/tools/__tests__/simulate-vault.test.d.ts +5 -0
  212. package/dist/tools/__tests__/simulate-vault.test.d.ts.map +1 -0
  213. package/dist/tools/__tests__/simulate-vault.test.js +363 -0
  214. package/dist/tools/__tests__/simulate-vault.test.js.map +1 -0
  215. package/dist/tools/analyze-risk.d.ts +34 -0
  216. package/dist/tools/analyze-risk.d.ts.map +1 -0
  217. package/dist/tools/analyze-risk.js +100 -0
  218. package/dist/tools/analyze-risk.js.map +1 -0
  219. package/dist/tools/compare-vaults.d.ts +29 -0
  220. package/dist/tools/compare-vaults.d.ts.map +1 -0
  221. package/dist/tools/compare-vaults.js +285 -0
  222. package/dist/tools/compare-vaults.js.map +1 -0
  223. package/dist/tools/export-data.d.ts +34 -0
  224. package/dist/tools/export-data.d.ts.map +1 -0
  225. package/dist/tools/export-data.js +309 -0
  226. package/dist/tools/export-data.js.map +1 -0
  227. package/dist/tools/get-price-history.d.ts +29 -0
  228. package/dist/tools/get-price-history.d.ts.map +1 -0
  229. package/dist/tools/get-price-history.js +236 -0
  230. package/dist/tools/get-price-history.js.map +1 -0
  231. package/dist/tools/get-transactions.d.ts +29 -0
  232. package/dist/tools/get-transactions.d.ts.map +1 -0
  233. package/dist/tools/get-transactions.js +181 -0
  234. package/dist/tools/get-transactions.js.map +1 -0
  235. package/dist/tools/index.d.ts +26 -0
  236. package/dist/tools/index.d.ts.map +1 -0
  237. package/dist/tools/index.js +32 -0
  238. package/dist/tools/index.js.map +1 -0
  239. package/dist/tools/optimize-portfolio.d.ts +37 -0
  240. package/dist/tools/optimize-portfolio.d.ts.map +1 -0
  241. package/dist/tools/optimize-portfolio.js +459 -0
  242. package/dist/tools/optimize-portfolio.js.map +1 -0
  243. package/dist/tools/predict-yield.d.ts +30 -0
  244. package/dist/tools/predict-yield.d.ts.map +1 -0
  245. package/dist/tools/predict-yield.js +248 -0
  246. package/dist/tools/predict-yield.js.map +1 -0
  247. package/dist/tools/query-graphql.d.ts +35 -0
  248. package/dist/tools/query-graphql.d.ts.map +1 -0
  249. package/dist/tools/query-graphql.js +54 -0
  250. package/dist/tools/query-graphql.js.map +1 -0
  251. package/dist/tools/registry.d.ts +42 -0
  252. package/dist/tools/registry.d.ts.map +1 -0
  253. package/dist/tools/registry.js +231 -0
  254. package/dist/tools/registry.js.map +1 -0
  255. package/dist/tools/search-vaults.d.ts +40 -0
  256. package/dist/tools/search-vaults.d.ts.map +1 -0
  257. package/dist/tools/search-vaults.js +184 -0
  258. package/dist/tools/search-vaults.js.map +1 -0
  259. package/dist/tools/simulate-vault.d.ts +80 -0
  260. package/dist/tools/simulate-vault.d.ts.map +1 -0
  261. package/dist/tools/simulate-vault.js +281 -0
  262. package/dist/tools/simulate-vault.js.map +1 -0
  263. package/dist/tools/user-portfolio.d.ts +30 -0
  264. package/dist/tools/user-portfolio.d.ts.map +1 -0
  265. package/dist/tools/user-portfolio.js +142 -0
  266. package/dist/tools/user-portfolio.js.map +1 -0
  267. package/dist/tools/vault-data.d.ts +23 -0
  268. package/dist/tools/vault-data.d.ts.map +1 -0
  269. package/dist/tools/vault-data.js +68 -0
  270. package/dist/tools/vault-data.js.map +1 -0
  271. package/dist/tools/vault-performance.d.ts +30 -0
  272. package/dist/tools/vault-performance.d.ts.map +1 -0
  273. package/dist/tools/vault-performance.js +275 -0
  274. package/dist/tools/vault-performance.js.map +1 -0
  275. package/dist/types/generated.d.ts +1109 -0
  276. package/dist/types/generated.d.ts.map +1 -0
  277. package/dist/types/generated.js +2 -0
  278. package/dist/types/generated.js.map +1 -0
  279. package/dist/types/index.d.ts +46 -0
  280. package/dist/types/index.d.ts.map +1 -0
  281. package/dist/types/index.js +8 -0
  282. package/dist/types/index.js.map +1 -0
  283. package/dist/utils/comparison-metrics.d.ts +120 -0
  284. package/dist/utils/comparison-metrics.d.ts.map +1 -0
  285. package/dist/utils/comparison-metrics.js +215 -0
  286. package/dist/utils/comparison-metrics.js.map +1 -0
  287. package/dist/utils/config-loader.d.ts +17 -0
  288. package/dist/utils/config-loader.d.ts.map +1 -0
  289. package/dist/utils/config-loader.js +45 -0
  290. package/dist/utils/config-loader.js.map +1 -0
  291. package/dist/utils/csv-generator.d.ts +89 -0
  292. package/dist/utils/csv-generator.d.ts.map +1 -0
  293. package/dist/utils/csv-generator.js +97 -0
  294. package/dist/utils/csv-generator.js.map +1 -0
  295. package/dist/utils/disclaimers.d.ts +70 -0
  296. package/dist/utils/disclaimers.d.ts.map +1 -0
  297. package/dist/utils/disclaimers.js +161 -0
  298. package/dist/utils/disclaimers.js.map +1 -0
  299. package/dist/utils/errors.d.ts +66 -0
  300. package/dist/utils/errors.d.ts.map +1 -0
  301. package/dist/utils/errors.js +86 -0
  302. package/dist/utils/errors.js.map +1 -0
  303. package/dist/utils/execute-tool-with-cache.d.ts +97 -0
  304. package/dist/utils/execute-tool-with-cache.d.ts.map +1 -0
  305. package/dist/utils/execute-tool-with-cache.js +105 -0
  306. package/dist/utils/execute-tool-with-cache.js.map +1 -0
  307. package/dist/utils/portfolio-optimization.d.ts +100 -0
  308. package/dist/utils/portfolio-optimization.d.ts.map +1 -0
  309. package/dist/utils/portfolio-optimization.js +283 -0
  310. package/dist/utils/portfolio-optimization.js.map +1 -0
  311. package/dist/utils/risk-scoring.d.ts +226 -0
  312. package/dist/utils/risk-scoring.d.ts.map +1 -0
  313. package/dist/utils/risk-scoring.js +523 -0
  314. package/dist/utils/risk-scoring.js.map +1 -0
  315. package/dist/utils/tool-error-handler.d.ts +16 -0
  316. package/dist/utils/tool-error-handler.d.ts.map +1 -0
  317. package/dist/utils/tool-error-handler.js +43 -0
  318. package/dist/utils/tool-error-handler.js.map +1 -0
  319. package/dist/utils/tool-handler.d.ts +33 -0
  320. package/dist/utils/tool-handler.d.ts.map +1 -0
  321. package/dist/utils/tool-handler.js +59 -0
  322. package/dist/utils/tool-handler.js.map +1 -0
  323. package/dist/utils/tool-response.d.ts +16 -0
  324. package/dist/utils/tool-response.d.ts.map +1 -0
  325. package/dist/utils/tool-response.js +25 -0
  326. package/dist/utils/tool-response.js.map +1 -0
  327. package/dist/utils/validators.d.ts +359 -0
  328. package/dist/utils/validators.d.ts.map +1 -0
  329. package/dist/utils/validators.js +233 -0
  330. package/dist/utils/validators.js.map +1 -0
  331. package/dist/utils/yield-prediction.d.ts +69 -0
  332. package/dist/utils/yield-prediction.d.ts.map +1 -0
  333. package/dist/utils/yield-prediction.js +290 -0
  334. package/dist/utils/yield-prediction.js.map +1 -0
  335. 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"}