@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,407 @@
1
+ /**
2
+ * DeFi Glossary Resource
3
+ *
4
+ * Comprehensive terminology guide for Lagoon DeFi Protocol.
5
+ * Explains vault concepts, financial metrics, and transaction types.
6
+ */
7
+ export function getDefiGlossary() {
8
+ return `# Lagoon DeFi Protocol - Glossary
9
+
10
+ ## Core Vault Concepts
11
+
12
+ ### Vault
13
+ A DeFi vault is an automated investment strategy that manages user deposits to generate yield. In Lagoon, vaults are ERC-4626 compliant smart contracts that accept deposits of a specific asset and issue shares representing ownership.
14
+
15
+ **Key Properties:**
16
+ - **Address**: Unique Ethereum address identifying the vault contract
17
+ - **Symbol**: Short identifier (e.g., "LAG-USDC-ETH")
18
+ - **Asset**: The underlying ERC-20 token accepted for deposits
19
+ - **Total Assets**: Combined value of all deposited assets (in asset units)
20
+ - **Total Supply**: Total shares issued to depositors
21
+ - **Price Per Share (PPS)**: Vault share value = totalAssets / totalSupply
22
+
23
+ ### Shares
24
+ Vault shares represent proportional ownership of the vault's assets. When users deposit, they receive shares. When they withdraw, they burn shares to receive assets.
25
+
26
+ **Share Mechanics:**
27
+ - Shares are minted on deposit at current PPS
28
+ - Shares are burned on withdrawal at current PPS
29
+ - Share value increases as vault generates yield
30
+ - Shares are transferable ERC-20 tokens
31
+
32
+ ### Asset
33
+ The underlying ERC-20 token that the vault accepts for deposits (e.g., USDC, WETH, DAI).
34
+
35
+ **Asset Properties:**
36
+ - Decimals: Precision (e.g., USDC = 6, WETH = 18)
37
+ - Price USD: Current USD value per token unit
38
+ - Symbol: Token ticker (e.g., "USDC", "WETH")
39
+
40
+ ---
41
+
42
+ ## Financial Metrics
43
+
44
+ ### Total Value Locked (TVL)
45
+ The total USD value of all assets deposited in the vault. Critical metric for vault size and adoption.
46
+
47
+ **Calculation:** \`TVL = totalAssets * assetPriceUsd\`
48
+
49
+ **Interpretation:**
50
+ - TVL > $10M: Large, established vault
51
+ - TVL $1M-$10M: Medium-sized vault
52
+ - TVL < $1M: Small or new vault
53
+
54
+ ### Annual Percentage Rate (APR)
55
+ The annualized rate of return for vault deposits. Lagoon provides multiple APR metrics:
56
+
57
+ **Types:**
58
+ - **Gross APR**: Total yield before fees
59
+ - **Net APR**: Yield after management and performance fees
60
+ - **Linear Net APR**: Simple annualized return
61
+ - **Live APR**: Current real-time APR estimate
62
+
63
+ **Time Periods:**
64
+ - **Inception APR**: Since vault launch
65
+ - **Yearly APR**: Last 365 days
66
+ - **Monthly APR**: Last 30 days
67
+ - **Weekly APR**: Last 7 days
68
+
69
+ ### Price Per Share (PPS)
70
+ The value of one vault share in terms of underlying assets.
71
+
72
+ **Calculation:** \`PPS = totalAssets / totalSupply\`
73
+
74
+ **Growth:** PPS increases as vault generates yield. A rising PPS indicates profitable strategy.
75
+
76
+ **Example:**
77
+ - Initial PPS: 1.0 (1 share = 1 asset)
78
+ - After 1 year at 10% APR: 1.1 (1 share = 1.1 assets)
79
+ - Depositor's gain: 10% return
80
+
81
+ ### Capacity
82
+ Maximum assets the vault can accept. Some vaults have capacity limits due to strategy constraints.
83
+
84
+ **Properties:**
85
+ - **Max Capacity**: Hard limit on total deposits
86
+ - **Utilization**: Current deposits / max capacity
87
+ - **Remaining Capacity**: Available deposit space
88
+
89
+ **Risk Indicator:**
90
+ - Utilization > 90%: High risk of deposit reversion
91
+ - Utilization 70-90%: Approaching capacity
92
+ - Utilization < 70%: Ample room for deposits
93
+
94
+ ---
95
+
96
+ ## Vault States and Operations
97
+
98
+ ### Vault States
99
+ Vaults transition through different operational states:
100
+
101
+ **State Values:**
102
+ - **OPEN**: Normal operation, accepting deposits/withdrawals
103
+ - **CLOSING**: Last call for deposits, preparing to close
104
+ - **CLOSED**: No new deposits, only withdrawals allowed
105
+
106
+ ### Settlement Process
107
+ Lagoon uses an asynchronous and synchronous settlement system for deposits and withdrawals:
108
+
109
+ **Synchronous Deposit Flow:**
110
+ 1. User requests deposit
111
+ 2. Vault processes deposit immediately
112
+ 3. Shares minted and distributed to users
113
+
114
+ **Asynchronous Deposit Flow:**
115
+ 1. User requests deposit → assets locked in pending state
116
+ 2. Vault processes batch during settlement window
117
+ 3. Shares minted and distributed to users
118
+
119
+ **Asynchronous Withdrawal Flow:**
120
+ 1. User requests redemption → shares locked in pending state
121
+ 2. Vault liquidates positions during settlement
122
+ 3. Assets returned to users
123
+
124
+ **Key Fields:**
125
+ - **Pending Settlement**: Assets/shares awaiting batch processing
126
+ - **Average Settlement**: Typical time for settlement (hours)
127
+ - **Safe Asset Balance**: Immediately available liquidity
128
+
129
+ ---
130
+
131
+ ## Transaction Types
132
+
133
+ ### TotalAssetsUpdated
134
+ Records changes to vault's total asset value. Most frequent transaction type.
135
+
136
+ **Use Cases:**
137
+ - Performance tracking over time
138
+ - TVL history and trend analysis
139
+ - Price per share calculations
140
+
141
+ **Data Fields:**
142
+ - totalAssets: New total assets (BigInt)
143
+ - totalAssetsUsd: New TVL in USD
144
+ - timestamp: When update occurred
145
+
146
+ ### PeriodSummary
147
+ Aggregated vault metrics for a specific time period (typically daily).
148
+
149
+ **Use Cases:**
150
+ - Volume analysis (deposits + withdrawals)
151
+ - Daily TVL snapshots
152
+ - Activity level tracking
153
+
154
+ **Data Fields:**
155
+ - tvl: Total value locked at period end
156
+ - deposits: Total deposited during period (BigInt)
157
+ - withdrawals: Total withdrawn during period (BigInt)
158
+
159
+ ### DepositRequest
160
+ User initiates a deposit into the vault.
161
+
162
+ **Data Fields:**
163
+ - sender: User address
164
+ - amount: Assets to deposit (BigInt)
165
+ - shares: Expected shares to receive
166
+
167
+ ### SettleDeposit
168
+ Vault processes pending deposits and mints shares.
169
+
170
+ **Data Fields:**
171
+ - assetsDeposited: Assets added to vault (BigInt)
172
+ - sharesMinted: Shares issued to depositors
173
+
174
+ ### RedeemRequest
175
+ User initiates a withdrawal from the vault.
176
+
177
+ **Data Fields:**
178
+ - redeemer: User address
179
+ - shares: Shares to burn (BigInt)
180
+ - assets: Expected assets to receive
181
+
182
+ ### SettleRedeem
183
+ Vault processes pending withdrawals and returns assets.
184
+
185
+ **Data Fields:**
186
+ - sharesRedeemed: Shares burned (BigInt)
187
+ - assetsWithdrawn: Assets returned to users
188
+
189
+ ### StateUpdated
190
+ Vault state transition (OPEN ↔ CLOSING ↔ CLOSED).
191
+
192
+ **Data Fields:**
193
+ - oldState: Previous state
194
+ - newState: New state
195
+ - reason: Why state changed
196
+
197
+ ### RatesUpdated
198
+ Changes to vault fee rates.
199
+
200
+ **Data Fields:**
201
+ - managementFee: New management fee (%)
202
+ - performanceFee: New performance fee (%)
203
+
204
+ ---
205
+
206
+ ## Fees and Revenue
207
+
208
+ ### Management Fee
209
+ Annual fee charged on total assets under management, regardless of performance.
210
+
211
+ **Typical Range:** 0% - 2% annually
212
+
213
+ **Example:** 2% management fee = 2% of TVL charged per year
214
+
215
+ ### Performance Fee
216
+ Fee charged on profits generated by the vault strategy.
217
+
218
+ **Typical Range:** 0% - 20% of profits
219
+
220
+ **Example:** 10% performance fee = 10% of gains goes to vault manager
221
+
222
+ **Calculation:**
223
+ - Vault generates 15% return
224
+ - 10% performance fee applied
225
+ - User receives: 15% * 0.9 = 13.5% net return
226
+ - Manager receives: 15% * 0.1 = 1.5% of profit
227
+
228
+ ### High Water Mark
229
+ Ensures performance fees are only charged on new profits, not recovery of previous losses.
230
+
231
+ **Mechanism:**
232
+ - Tracks highest PPS achieved
233
+ - Performance fees only apply to gains above high water mark
234
+ - Prevents double-charging on volatile performance
235
+
236
+ ---
237
+
238
+ ## Roles and Governance
239
+
240
+ ### Curator
241
+ Entity that designs and manages the vault strategy. Curators are responsible for:
242
+ - Strategy selection and optimization
243
+ - Risk management and monitoring
244
+ - Performance reporting
245
+ - Fee collection
246
+
247
+ **Multiple Curators:** Some vaults have multiple curators collaborating on strategy.
248
+
249
+ ### Integrator
250
+ Platform or protocol that integrates the Lagoon vault into their UI/UX.
251
+
252
+ **Benefits:**
253
+ - Custom branding and user experience
254
+ - Integration fees or revenue sharing
255
+ - Whitelabel vault access
256
+
257
+ ### Roles (Smart Contract)
258
+ **Owner:** Administrative control over vault settings
259
+ **Valuation Manager:** Updates vault valuations and pricing
260
+ **Whitelist Manager:** Controls deposit access permissions
261
+ **Safe:** Multisig wallet holding vault assets
262
+ **Fee Receiver:** Receives management and performance fees
263
+
264
+ ---
265
+
266
+ ## DeFi Integrations
267
+
268
+ Vaults may integrate with external DeFi protocols for yield generation:
269
+
270
+ **Common Integrations:**
271
+ - **DEX (Decentralized Exchange)**: Uniswap, Curve, Balancer for liquidity provision
272
+ - **Lending Protocols**: Aave, Compound for supply-side yield
273
+ - **Staking**: Native token staking for rewards
274
+ - **Derivatives**: Options, perpetuals for hedged strategies
275
+
276
+ **Integration Properties:**
277
+ - Name: Protocol name (e.g., "Uniswap V3")
278
+ - Type: Category (DEX, Lending, Staking, etc.)
279
+ - Description: Strategy details
280
+ - Link: Protocol URL
281
+
282
+ ---
283
+
284
+ ## Yield Components
285
+
286
+ ### Native Yields
287
+ Base yield from underlying protocol (e.g., Uniswap trading fees, Aave lending interest).
288
+
289
+ **Properties:**
290
+ - APR: Current annualized rate
291
+ - Description: Source of yield
292
+ - Start/End Timestamp: Yield period
293
+ - Logo: Protocol branding
294
+
295
+ ### Incentives
296
+ Additional yield from protocol token emissions or rewards programs.
297
+
298
+ **Properties:**
299
+ - APR: Incentive rate
300
+ - Incentive Rate: Tokens distributed per unit time
301
+ - Reference Token: Reward token (e.g., UNI, COMP)
302
+ - End Timestamp: When incentives expire
303
+
304
+ ### Airdrops
305
+ One-time token distributions to vault participants.
306
+
307
+ **Properties:**
308
+ - APR: Annualized value of airdrop
309
+ - Distribution Timestamp: When distributed
310
+ - Multiplier: Boost factor for early participants
311
+ - PPS Increase: Impact on share value
312
+
313
+ ---
314
+
315
+ ## Risk Metrics
316
+
317
+ ### Concentration Risk
318
+ Percentage of portfolio in single vault or asset.
319
+
320
+ **Risk Levels:**
321
+ - <20%: Low concentration, well-diversified
322
+ - 20-30%: Moderate concentration
323
+ - >30%: High concentration risk
324
+
325
+ ### Chain Risk
326
+ Exposure to specific blockchain networks.
327
+
328
+ **Considerations:**
329
+ - Multi-chain diversification reduces risk
330
+ - Consider chain security, decentralization
331
+ - Bridge risks for cross-chain strategies
332
+
333
+ ### Curator Track Record
334
+ Historical performance and reliability of vault curator.
335
+
336
+ **Evaluation Criteria:**
337
+ - Past vault performance
338
+ - Strategy consistency
339
+ - Risk management history
340
+ - Transparency and communication
341
+
342
+ ---
343
+
344
+ ## Common Calculations
345
+
346
+ ### Deposit Calculation
347
+ **Shares Received** = depositAmount / pricePerShare
348
+
349
+ **Example:**
350
+ - Deposit: 1000 USDC
351
+ - Current PPS: 1.05
352
+ - Shares Received: 1000 / 1.05 = 952.38 shares
353
+
354
+ ### Withdrawal Calculation
355
+ **Assets Received** = sharesRedeemed * pricePerShare
356
+
357
+ **Example:**
358
+ - Redeem: 1000 shares
359
+ - Current PPS: 1.10
360
+ - Assets Received: 1000 * 1.10 = 1100 USDC
361
+
362
+ ### Return Calculation
363
+ **Percent Return** = ((currentPPS / depositPPS) - 1) * 100
364
+
365
+ **Example:**
366
+ - Deposit PPS: 1.00
367
+ - Current PPS: 1.15
368
+ - Return: ((1.15 / 1.00) - 1) * 100 = 15%
369
+
370
+ ### TVL Change
371
+ **Percent Change** = ((endTVL / startTVL) - 1) * 100
372
+
373
+ **Example:**
374
+ - Start TVL: $1M
375
+ - End TVL: $1.2M
376
+ - Change: ((1.2 / 1.0) - 1) * 100 = +20%
377
+
378
+ ---
379
+
380
+ ## Best Practices
381
+
382
+ ### For Analysis
383
+ 1. **Compare Time Periods**: Use multiple APR time windows for trend analysis
384
+ 2. **Check Capacity**: Ensure vault has room before recommending deposits
385
+ 3. **Review Fees**: Factor in management and performance fees for net returns
386
+ 4. **Assess Risk**: Consider curator track record, capacity utilization, chain risk
387
+ 5. **Verify Liquidity**: Check safe asset balance for immediate withdrawal needs
388
+
389
+ ### For Portfolio Management
390
+ 1. **Diversify**: Spread across multiple vaults, assets, and chains
391
+ 2. **Monitor Performance**: Track PPS growth and APR consistency
392
+ 3. **Rebalance**: Adjust allocations based on performance and risk
393
+ 4. **Stay Informed**: Watch for state changes, fee updates, and integrations
394
+
395
+ ### For Risk Management
396
+ 1. **Capacity Awareness**: Avoid vaults >80% utilized
397
+ 2. **Curator Due Diligence**: Research curator history and strategy
398
+ 3. **Emergency Planning**: Understand settlement times for withdrawals
399
+ 4. **Fee Impact**: Calculate net returns after all fees
400
+
401
+ ---
402
+
403
+ *Last Updated: ${new Date().toISOString().split('T')[0]}*
404
+ *Version: Phase 3 - Lagoon MCP Server*
405
+ `;
406
+ }
407
+ //# sourceMappingURL=glossary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glossary.js","sourceRoot":"","sources":["../../src/resources/glossary.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,UAAU,eAAe;IAC7B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2YQ,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;;CAEtD,CAAC;AACF,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Resource Registry
3
+ *
4
+ * Central registry for all MCP resources.
5
+ * Resources provide static content like documentation and schemas.
6
+ */
7
+ export interface Resource {
8
+ uri: string;
9
+ name: string;
10
+ description?: string;
11
+ mimeType?: string;
12
+ }
13
+ /**
14
+ * Resource Registry
15
+ * Resources available to MCP clients
16
+ */
17
+ export declare const resources: Resource[];
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,QAAQ,EAmB/B,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Resource Registry
3
+ *
4
+ * Central registry for all MCP resources.
5
+ * Resources provide static content like documentation and schemas.
6
+ */
7
+ /**
8
+ * Resource Registry
9
+ * Resources available to MCP clients
10
+ */
11
+ export const resources = [
12
+ {
13
+ uri: 'lagoon://graphql-schema',
14
+ name: 'GraphQL Schema',
15
+ description: 'Complete GraphQL schema in SDL format. ' +
16
+ 'Includes all types, queries, and mutations for the Lagoon API. ' +
17
+ 'Cached for 24 hours.',
18
+ mimeType: 'text/plain',
19
+ },
20
+ {
21
+ uri: 'lagoon://defi-glossary',
22
+ name: 'DeFi Glossary',
23
+ description: 'Comprehensive terminology guide for Lagoon DeFi Protocol. ' +
24
+ 'Explains vault concepts, financial metrics, transaction types, and calculations. ' +
25
+ 'Essential reference for understanding vault data and analysis.',
26
+ mimeType: 'text/markdown',
27
+ },
28
+ ];
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAe;IACnC;QACE,GAAG,EAAE,yBAAyB;QAC9B,IAAI,EAAE,gBAAgB;QACtB,WAAW,EACT,yCAAyC;YACzC,iEAAiE;YACjE,sBAAsB;QACxB,QAAQ,EAAE,YAAY;KACvB;IACD;QACE,GAAG,EAAE,wBAAwB;QAC7B,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,4DAA4D;YAC5D,mFAAmF;YACnF,gEAAgE;QAClE,QAAQ,EAAE,eAAe;KAC1B;CACF,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * GraphQL Schema Resource
3
+ *
4
+ * Provides the complete GraphQL schema in SDL (Schema Definition Language) format.
5
+ * Cached for 24 hours as the schema rarely changes.
6
+ *
7
+ * This resource enables Claude to:
8
+ * - Understand available types, queries, mutations
9
+ * - Validate query syntax before execution
10
+ * - Discover new fields and relationships
11
+ * - Generate accurate query suggestions
12
+ */
13
+ /**
14
+ * Fetch and cache the GraphQL schema
15
+ *
16
+ * Uses introspection query to fetch schema metadata,
17
+ * then converts to SDL format for easy reading.
18
+ *
19
+ * @returns GraphQL schema in SDL format
20
+ */
21
+ export declare function getGraphQLSchema(): Promise<string>;
22
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/resources/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAWH;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAgDxD"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * GraphQL Schema Resource
3
+ *
4
+ * Provides the complete GraphQL schema in SDL (Schema Definition Language) format.
5
+ * Cached for 24 hours as the schema rarely changes.
6
+ *
7
+ * This resource enables Claude to:
8
+ * - Understand available types, queries, mutations
9
+ * - Validate query syntax before execution
10
+ * - Discover new fields and relationships
11
+ * - Generate accurate query suggestions
12
+ */
13
+ import { getIntrospectionQuery, buildClientSchema, printSchema, } from 'graphql';
14
+ import { graphqlClient } from '../graphql/client.js';
15
+ import { cache, cacheKeys, cacheTTL } from '../cache/index.js';
16
+ /**
17
+ * Fetch and cache the GraphQL schema
18
+ *
19
+ * Uses introspection query to fetch schema metadata,
20
+ * then converts to SDL format for easy reading.
21
+ *
22
+ * @returns GraphQL schema in SDL format
23
+ */
24
+ export async function getGraphQLSchema() {
25
+ // Check cache first
26
+ const cacheKey = cacheKeys.schema();
27
+ const cached = cache.get(cacheKey);
28
+ if (cached) {
29
+ return cached;
30
+ }
31
+ try {
32
+ // Execute introspection query
33
+ const introspectionQuery = getIntrospectionQuery();
34
+ const result = await graphqlClient.request(introspectionQuery);
35
+ // Build client schema from introspection result
36
+ const schema = buildClientSchema(result);
37
+ // Convert to SDL format (human-readable)
38
+ const sdl = printSchema(schema);
39
+ // Add helpful header
40
+ const schemaWithHeader = `# Lagoon DeFi Protocol - GraphQL Schema
41
+ # Generated: ${new Date().toISOString()}
42
+ #
43
+ # This schema defines all available types, queries, and mutations
44
+ # for the Lagoon DeFi vault analytics API.
45
+ #
46
+ # Key Types:
47
+ # - Vault: DeFi vault with asset info, financial metrics, and curator details
48
+ # - Transaction: Historical transaction data for performance tracking
49
+ # - User: User portfolio with positions across multiple chains
50
+ # - Asset: ERC-20 token information with pricing
51
+ #
52
+
53
+ ${sdl}`;
54
+ // Cache with 24-hour TTL
55
+ cache.set(cacheKey, schemaWithHeader, cacheTTL.schema);
56
+ return schemaWithHeader;
57
+ }
58
+ catch (error) {
59
+ // If introspection fails, return error message
60
+ const errorMessage = `# Error fetching GraphQL schema
61
+ # ${error instanceof Error ? error.message : String(error)}
62
+ #
63
+ # The schema is temporarily unavailable. Please try again later.`;
64
+ return errorMessage;
65
+ }
66
+ }
67
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/resources/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,WAAW,GAEZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE/D;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,oBAAoB;IACpB,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;IACpC,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAS,QAAQ,CAAC,CAAC;IAC3C,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,CAAC;QACH,8BAA8B;QAC9B,MAAM,kBAAkB,GAAG,qBAAqB,EAAE,CAAC;QACnD,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,OAAO,CAAqB,kBAAkB,CAAC,CAAC;QAEnF,gDAAgD;QAChD,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAEzC,yCAAyC;QACzC,MAAM,GAAG,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QAEhC,qBAAqB;QACrB,MAAM,gBAAgB,GAAG;eACd,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;;;;;;;;;;;;EAYrC,GAAG,EAAE,CAAC;QAEJ,yBAAyB;QACzB,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAEvD,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,+CAA+C;QAC/C,MAAM,YAAY,GAAG;IACrB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;;iEAEO,CAAC;QAE9D,OAAO,YAAY,CAAC;IACtB,CAAC;AACH,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Environment variable validation schema
4
+ *
5
+ * Validates all environment variables at startup to ensure proper configuration.
6
+ * Uses Zod for runtime validation and type inference.
7
+ */
8
+ export declare const envSchema: z.ZodObject<{
9
+ /**
10
+ * GraphQL API endpoint for Lagoon backend
11
+ * Must be a valid URL
12
+ * @default 'http://localhost:3001/query'
13
+ */
14
+ LAGOON_GRAPHQL_URL: z.ZodDefault<z.ZodString>;
15
+ /**
16
+ * Runtime environment
17
+ * @default 'development'
18
+ */
19
+ NODE_ENV: z.ZodDefault<z.ZodEnum<["development", "production", "test"]>>;
20
+ /**
21
+ * Cache TTL in seconds (optional override)
22
+ * @default 600 (10 minutes)
23
+ */
24
+ CACHE_TTL: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
25
+ /**
26
+ * Maximum number of cache entries (optional override)
27
+ * @default 1000
28
+ */
29
+ CACHE_MAX_KEYS: z.ZodOptional<z.ZodEffects<z.ZodString, number, string>>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ LAGOON_GRAPHQL_URL: string;
32
+ NODE_ENV: "development" | "production" | "test";
33
+ CACHE_TTL?: number | undefined;
34
+ CACHE_MAX_KEYS?: number | undefined;
35
+ }, {
36
+ LAGOON_GRAPHQL_URL?: string | undefined;
37
+ NODE_ENV?: "development" | "production" | "test" | undefined;
38
+ CACHE_TTL?: string | undefined;
39
+ CACHE_MAX_KEYS?: string | undefined;
40
+ }>;
41
+ /**
42
+ * Validated environment variable type
43
+ * Inferred from the Zod schema
44
+ */
45
+ export type Env = z.infer<typeof envSchema>;
46
+ //# sourceMappingURL=config.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/config.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,SAAS;IACpB;;;;OAIG;;IAOH;;;OAGG;;IAMH;;;OAGG;;IAQH;;;OAGG;;;;;;;;;;;;EAOH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Environment variable validation schema
4
+ *
5
+ * Validates all environment variables at startup to ensure proper configuration.
6
+ * Uses Zod for runtime validation and type inference.
7
+ */
8
+ export const envSchema = z.object({
9
+ /**
10
+ * GraphQL API endpoint for Lagoon backend
11
+ * Must be a valid URL
12
+ * @default 'http://localhost:3001/query'
13
+ */
14
+ LAGOON_GRAPHQL_URL: z
15
+ .string()
16
+ .url('LAGOON_GRAPHQL_URL must be a valid URL')
17
+ .default('http://localhost:3001/query')
18
+ .describe('GraphQL API endpoint for Lagoon backend'),
19
+ /**
20
+ * Runtime environment
21
+ * @default 'development'
22
+ */
23
+ NODE_ENV: z
24
+ .enum(['development', 'production', 'test'])
25
+ .default('development')
26
+ .describe('Runtime environment'),
27
+ /**
28
+ * Cache TTL in seconds (optional override)
29
+ * @default 600 (10 minutes)
30
+ */
31
+ CACHE_TTL: z
32
+ .string()
33
+ .regex(/^\d+$/, 'CACHE_TTL must be a positive integer')
34
+ .transform(Number)
35
+ .optional()
36
+ .describe('Cache TTL in seconds (default: 600)'),
37
+ /**
38
+ * Maximum number of cache entries (optional override)
39
+ * @default 1000
40
+ */
41
+ CACHE_MAX_KEYS: z
42
+ .string()
43
+ .regex(/^\d+$/, 'CACHE_MAX_KEYS must be a positive integer')
44
+ .transform(Number)
45
+ .optional()
46
+ .describe('Maximum cache entries (default: 1000)'),
47
+ });
48
+ //# sourceMappingURL=config.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.schema.js","sourceRoot":"","sources":["../../src/schemas/config.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC;;;;OAIG;IACH,kBAAkB,EAAE,CAAC;SAClB,MAAM,EAAE;SACR,GAAG,CAAC,wCAAwC,CAAC;SAC7C,OAAO,CAAC,6BAA6B,CAAC;SACtC,QAAQ,CAAC,yCAAyC,CAAC;IAEtD;;;OAGG;IACH,QAAQ,EAAE,CAAC;SACR,IAAI,CAAC,CAAC,aAAa,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;SAC3C,OAAO,CAAC,aAAa,CAAC;SACtB,QAAQ,CAAC,qBAAqB,CAAC;IAElC;;;OAGG;IACH,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,KAAK,CAAC,OAAO,EAAE,sCAAsC,CAAC;SACtD,SAAS,CAAC,MAAM,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CAAC,qCAAqC,CAAC;IAElD;;;OAGG;IACH,cAAc,EAAE,CAAC;SACd,MAAM,EAAE;SACR,KAAK,CAAC,OAAO,EAAE,2CAA2C,CAAC;SAC3D,SAAS,CAAC,MAAM,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CAAC,uCAAuC,CAAC;CACrD,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * APR Service Test Suite
3
+ *
4
+ * Comprehensive tests for SDK APR calculations and period summary transformations.
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=apr-service.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apr-service.test.d.ts","sourceRoot":"","sources":["../../../src/sdk/__tests__/apr-service.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}