@continuumdao/ctm-mpc-defi 0.2.33 → 0.2.35

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 (83) hide show
  1. package/dist/agent/catalog.cjs +712 -44
  2. package/dist/agent/catalog.cjs.map +1 -1
  3. package/dist/agent/catalog.d.ts +1630 -244
  4. package/dist/agent/catalog.js +678 -45
  5. package/dist/agent/catalog.js.map +1 -1
  6. package/dist/agent/skills/aave-v4/SKILL.md +19 -4
  7. package/dist/agent/skills/aerodrome/SKILL.md +2 -2
  8. package/dist/agent/skills/compound-v3/SKILL.md +2 -2
  9. package/dist/agent/skills/curve-dao/SKILL.md +14 -0
  10. package/dist/agent/skills/ethena/SKILL.md +3 -1
  11. package/dist/agent/skills/euler-v2/SKILL.md +1 -1
  12. package/dist/agent/skills/gmx/SKILL.md +1 -1
  13. package/dist/agent/skills/hyperliquid/SKILL.md +7 -5
  14. package/dist/agent/skills/lido/SKILL.md +3 -0
  15. package/dist/agent/skills/maple-syrup/SKILL.md +35 -3
  16. package/dist/agent/skills/morpho/SKILL.md +1 -1
  17. package/dist/agent/skills/sky/SKILL.md +2 -0
  18. package/dist/agent/skills/yield-compare/SKILL.md +78 -0
  19. package/dist/index.cjs +129 -29
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.js +129 -27
  22. package/dist/index.js.map +1 -1
  23. package/dist/protocols/evm/aave-v4/index.cjs +170 -0
  24. package/dist/protocols/evm/aave-v4/index.cjs.map +1 -1
  25. package/dist/protocols/evm/aave-v4/index.d.ts +59 -1
  26. package/dist/protocols/evm/aave-v4/index.js +164 -1
  27. package/dist/protocols/evm/aave-v4/index.js.map +1 -1
  28. package/dist/protocols/evm/aerodrome/index.cjs +1308 -901
  29. package/dist/protocols/evm/aerodrome/index.cjs.map +1 -1
  30. package/dist/protocols/evm/aerodrome/index.d.ts +69 -2
  31. package/dist/protocols/evm/aerodrome/index.js +1217 -807
  32. package/dist/protocols/evm/aerodrome/index.js.map +1 -1
  33. package/dist/protocols/evm/compound-v3/index.cjs +82 -6
  34. package/dist/protocols/evm/compound-v3/index.cjs.map +1 -1
  35. package/dist/protocols/evm/compound-v3/index.d.ts +89 -1
  36. package/dist/protocols/evm/compound-v3/index.js +80 -7
  37. package/dist/protocols/evm/compound-v3/index.js.map +1 -1
  38. package/dist/protocols/evm/curve-dao/index.cjs +447 -18
  39. package/dist/protocols/evm/curve-dao/index.cjs.map +1 -1
  40. package/dist/protocols/evm/curve-dao/index.d.ts +108 -1
  41. package/dist/protocols/evm/curve-dao/index.js +440 -19
  42. package/dist/protocols/evm/curve-dao/index.js.map +1 -1
  43. package/dist/protocols/evm/ethena/index.cjs +89 -0
  44. package/dist/protocols/evm/ethena/index.cjs.map +1 -1
  45. package/dist/protocols/evm/ethena/index.d.ts +17 -1
  46. package/dist/protocols/evm/ethena/index.js +89 -2
  47. package/dist/protocols/evm/ethena/index.js.map +1 -1
  48. package/dist/protocols/evm/euler-v2/index.cjs +41 -6
  49. package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
  50. package/dist/protocols/evm/euler-v2/index.d.ts +21 -1
  51. package/dist/protocols/evm/euler-v2/index.js +41 -7
  52. package/dist/protocols/evm/euler-v2/index.js.map +1 -1
  53. package/dist/protocols/evm/gmx/index.cjs +83 -1
  54. package/dist/protocols/evm/gmx/index.cjs.map +1 -1
  55. package/dist/protocols/evm/gmx/index.d.ts +22 -2
  56. package/dist/protocols/evm/gmx/index.js +80 -2
  57. package/dist/protocols/evm/gmx/index.js.map +1 -1
  58. package/dist/protocols/evm/hyperliquid/index.cjs +67 -11
  59. package/dist/protocols/evm/hyperliquid/index.cjs.map +1 -1
  60. package/dist/protocols/evm/hyperliquid/index.d.ts +39 -2
  61. package/dist/protocols/evm/hyperliquid/index.js +64 -12
  62. package/dist/protocols/evm/hyperliquid/index.js.map +1 -1
  63. package/dist/protocols/evm/lido/index.cjs +13 -0
  64. package/dist/protocols/evm/lido/index.cjs.map +1 -1
  65. package/dist/protocols/evm/lido/index.d.ts +9 -1
  66. package/dist/protocols/evm/lido/index.js +13 -1
  67. package/dist/protocols/evm/lido/index.js.map +1 -1
  68. package/dist/protocols/evm/maple/index.cjs +129 -1
  69. package/dist/protocols/evm/maple/index.cjs.map +1 -1
  70. package/dist/protocols/evm/maple/index.d.ts +45 -1
  71. package/dist/protocols/evm/maple/index.js +124 -3
  72. package/dist/protocols/evm/maple/index.js.map +1 -1
  73. package/dist/protocols/evm/morpho/index.cjs +34 -7
  74. package/dist/protocols/evm/morpho/index.cjs.map +1 -1
  75. package/dist/protocols/evm/morpho/index.d.ts +23 -1
  76. package/dist/protocols/evm/morpho/index.js +34 -8
  77. package/dist/protocols/evm/morpho/index.js.map +1 -1
  78. package/dist/protocols/evm/sky/index.cjs +52 -0
  79. package/dist/protocols/evm/sky/index.cjs.map +1 -1
  80. package/dist/protocols/evm/sky/index.d.ts +16 -1
  81. package/dist/protocols/evm/sky/index.js +50 -1
  82. package/dist/protocols/evm/sky/index.js.map +1 -1
  83. package/package.json +1 -1
@@ -2288,9 +2288,10 @@ function vaultCashAndBorrows(r) {
2288
2288
  }
2289
2289
  return { cash, borrows };
2290
2290
  }
2291
- function v3ApyDecimalToRayString(apy) {
2292
- if (apy == null || !Number.isFinite(apy) || apy <= 0) return "0";
2293
- const ray = BigInt(Math.round(apy * 1e9)) * 10n ** 18n;
2291
+ function v3ApyPercentToRayString(apyPercent) {
2292
+ if (apyPercent == null || !Number.isFinite(apyPercent) || apyPercent <= 0) return "0";
2293
+ const fraction = apyPercent / 100;
2294
+ const ray = BigInt(Math.round(fraction * 1e9)) * 10n ** 18n;
2294
2295
  return ray.toString();
2295
2296
  }
2296
2297
  function v3VaultToGqlRow(v) {
@@ -2315,8 +2316,8 @@ function v3VaultToGqlRow(v) {
2315
2316
  state: {
2316
2317
  cash: cash.toString(),
2317
2318
  totalBorrows: borrows.toString(),
2318
- supplyApy: v3ApyDecimalToRayString(v.supplyApy),
2319
- borrowApy: v3ApyDecimalToRayString(v.borrowApy)
2319
+ supplyApy: v3ApyPercentToRayString(v.supplyApy),
2320
+ borrowApy: v3ApyPercentToRayString(v.borrowApy)
2320
2321
  }
2321
2322
  };
2322
2323
  }
@@ -2330,7 +2331,12 @@ async function fetchCollateralVaultMeta(chainId, collateralIds) {
2330
2331
  const chunkSize = 400;
2331
2332
  for (let i = 0; i < uniq.length; i += chunkSize) {
2332
2333
  const chunk = uniq.slice(i, i + chunkSize);
2333
- const d = await eulerV2QueryGraphQl(chainId, COLLATERAL_META, { first: chunk.length, ids: chunk });
2334
+ let d;
2335
+ try {
2336
+ d = await eulerV2QueryGraphQl(chainId, COLLATERAL_META, { first: chunk.length, ids: chunk });
2337
+ } catch {
2338
+ continue;
2339
+ }
2334
2340
  for (const r of d.eulerVaults ?? []) {
2335
2341
  const id = normId(r.id ?? void 0);
2336
2342
  if (!id) continue;
@@ -2827,6 +2833,34 @@ function checksumHex2(raw) {
2827
2833
  return null;
2828
2834
  }
2829
2835
  }
2836
+
2837
+ // src/protocols/evm/euler-v2/eulerV2EarnDiscovery.ts
2838
+ async function eulerV2FetchEarnVaultsSummary(args) {
2839
+ const addr = args.underlyingAddress.trim();
2840
+ if (!viem.isAddress(addr)) {
2841
+ throw new Error("underlyingAddress must be a valid ERC-20 address.");
2842
+ }
2843
+ const limit = Math.min(Math.max(args.limit ?? 30, 1), 100);
2844
+ await ensureEulerV2ChainAssetCache(args.chainId);
2845
+ const underlying = viem.getAddress(addr);
2846
+ const offerings = await fetchEulerV2EarnOfferingsForRowAsset({
2847
+ chainId: args.chainId,
2848
+ contractAddress: underlying,
2849
+ underlyingDecimals: 18
2850
+ });
2851
+ const vaults = offerings.slice(0, limit).map((o) => ({
2852
+ evaultAddress: o.evaultAddress,
2853
+ vaultName: o.vaultName,
2854
+ curatorDisplayName: o.curatorDisplayName,
2855
+ supplyApyPercentLabel: o.supplyApyPercentLabel,
2856
+ totalAssetsHumanLabel: o.totalAssetsHumanLabel,
2857
+ availableLiquidityHumanLabel: o.availableLiquidityHumanLabel,
2858
+ performanceFeePercentLabel: o.performanceFeePercentLabel,
2859
+ underlyingAddress: underlying,
2860
+ strategyCount: o.strategyCount
2861
+ }));
2862
+ return { vaults };
2863
+ }
2830
2864
  var eulerVaultRiskAbi = viem.parseAbi([
2831
2865
  "function LTVBorrow(address collateral) view returns (uint16)",
2832
2866
  "function LTVLiquidation(address collateral) view returns (uint16)"
@@ -3870,6 +3904,7 @@ exports.eulerReulUnlockAbi = eulerReulUnlockAbi;
3870
3904
  exports.eulerSameAssetApproveAmountWithBuffer = eulerSameAssetApproveAmountWithBuffer;
3871
3905
  exports.eulerSameAssetTotalCollateralPullWei = eulerSameAssetTotalCollateralPullWei;
3872
3906
  exports.eulerSubgraphVaultCapToUnderlyingWei = eulerSubgraphVaultCapToUnderlyingWei;
3907
+ exports.eulerV2FetchEarnVaultsSummary = eulerV2FetchEarnVaultsSummary;
3873
3908
  exports.eulerV2FetchLendVaultsSummary = eulerV2FetchLendVaultsSummary;
3874
3909
  exports.eulerV2GoldskyUrlForChain = eulerV2GoldskyUrlForChain;
3875
3910
  exports.eulerV2KeyForNodeAssetRow = eulerV2KeyForNodeAssetRow;