@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.
- package/dist/agent/catalog.cjs +712 -44
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +1630 -244
- package/dist/agent/catalog.js +678 -45
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/aave-v4/SKILL.md +19 -4
- package/dist/agent/skills/aerodrome/SKILL.md +2 -2
- package/dist/agent/skills/compound-v3/SKILL.md +2 -2
- package/dist/agent/skills/curve-dao/SKILL.md +14 -0
- package/dist/agent/skills/ethena/SKILL.md +3 -1
- package/dist/agent/skills/euler-v2/SKILL.md +1 -1
- package/dist/agent/skills/gmx/SKILL.md +1 -1
- package/dist/agent/skills/hyperliquid/SKILL.md +7 -5
- package/dist/agent/skills/lido/SKILL.md +3 -0
- package/dist/agent/skills/maple-syrup/SKILL.md +35 -3
- package/dist/agent/skills/morpho/SKILL.md +1 -1
- package/dist/agent/skills/sky/SKILL.md +2 -0
- package/dist/agent/skills/yield-compare/SKILL.md +78 -0
- package/dist/index.cjs +129 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +129 -27
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/aave-v4/index.cjs +170 -0
- package/dist/protocols/evm/aave-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/aave-v4/index.d.ts +59 -1
- package/dist/protocols/evm/aave-v4/index.js +164 -1
- package/dist/protocols/evm/aave-v4/index.js.map +1 -1
- package/dist/protocols/evm/aerodrome/index.cjs +1308 -901
- package/dist/protocols/evm/aerodrome/index.cjs.map +1 -1
- package/dist/protocols/evm/aerodrome/index.d.ts +69 -2
- package/dist/protocols/evm/aerodrome/index.js +1217 -807
- package/dist/protocols/evm/aerodrome/index.js.map +1 -1
- package/dist/protocols/evm/compound-v3/index.cjs +82 -6
- package/dist/protocols/evm/compound-v3/index.cjs.map +1 -1
- package/dist/protocols/evm/compound-v3/index.d.ts +89 -1
- package/dist/protocols/evm/compound-v3/index.js +80 -7
- package/dist/protocols/evm/compound-v3/index.js.map +1 -1
- package/dist/protocols/evm/curve-dao/index.cjs +447 -18
- package/dist/protocols/evm/curve-dao/index.cjs.map +1 -1
- package/dist/protocols/evm/curve-dao/index.d.ts +108 -1
- package/dist/protocols/evm/curve-dao/index.js +440 -19
- package/dist/protocols/evm/curve-dao/index.js.map +1 -1
- package/dist/protocols/evm/ethena/index.cjs +89 -0
- package/dist/protocols/evm/ethena/index.cjs.map +1 -1
- package/dist/protocols/evm/ethena/index.d.ts +17 -1
- package/dist/protocols/evm/ethena/index.js +89 -2
- package/dist/protocols/evm/ethena/index.js.map +1 -1
- package/dist/protocols/evm/euler-v2/index.cjs +41 -6
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
- package/dist/protocols/evm/euler-v2/index.d.ts +21 -1
- package/dist/protocols/evm/euler-v2/index.js +41 -7
- package/dist/protocols/evm/euler-v2/index.js.map +1 -1
- package/dist/protocols/evm/gmx/index.cjs +83 -1
- package/dist/protocols/evm/gmx/index.cjs.map +1 -1
- package/dist/protocols/evm/gmx/index.d.ts +22 -2
- package/dist/protocols/evm/gmx/index.js +80 -2
- package/dist/protocols/evm/gmx/index.js.map +1 -1
- package/dist/protocols/evm/hyperliquid/index.cjs +67 -11
- package/dist/protocols/evm/hyperliquid/index.cjs.map +1 -1
- package/dist/protocols/evm/hyperliquid/index.d.ts +39 -2
- package/dist/protocols/evm/hyperliquid/index.js +64 -12
- package/dist/protocols/evm/hyperliquid/index.js.map +1 -1
- package/dist/protocols/evm/lido/index.cjs +13 -0
- package/dist/protocols/evm/lido/index.cjs.map +1 -1
- package/dist/protocols/evm/lido/index.d.ts +9 -1
- package/dist/protocols/evm/lido/index.js +13 -1
- package/dist/protocols/evm/lido/index.js.map +1 -1
- package/dist/protocols/evm/maple/index.cjs +129 -1
- package/dist/protocols/evm/maple/index.cjs.map +1 -1
- package/dist/protocols/evm/maple/index.d.ts +45 -1
- package/dist/protocols/evm/maple/index.js +124 -3
- package/dist/protocols/evm/maple/index.js.map +1 -1
- package/dist/protocols/evm/morpho/index.cjs +34 -7
- package/dist/protocols/evm/morpho/index.cjs.map +1 -1
- package/dist/protocols/evm/morpho/index.d.ts +23 -1
- package/dist/protocols/evm/morpho/index.js +34 -8
- package/dist/protocols/evm/morpho/index.js.map +1 -1
- package/dist/protocols/evm/sky/index.cjs +52 -0
- package/dist/protocols/evm/sky/index.cjs.map +1 -1
- package/dist/protocols/evm/sky/index.d.ts +16 -1
- package/dist/protocols/evm/sky/index.js +50 -1
- package/dist/protocols/evm/sky/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -2288,9 +2288,10 @@ function vaultCashAndBorrows(r) {
|
|
|
2288
2288
|
}
|
|
2289
2289
|
return { cash, borrows };
|
|
2290
2290
|
}
|
|
2291
|
-
function
|
|
2292
|
-
if (
|
|
2293
|
-
const
|
|
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:
|
|
2319
|
-
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
|
-
|
|
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;
|