@agether/sdk 2.17.2 → 2.17.3

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/cli.js CHANGED
@@ -1885,7 +1885,7 @@ var init_MorphoClient = __esm({
1885
1885
  *
1886
1886
  * @returns Array of markets with yield analysis, sorted by net spread descending.
1887
1887
  */
1888
- async getYieldSpread() {
1888
+ async getYieldSpread(minLiquidity = 0) {
1889
1889
  const lstYields = await this._getLstYields();
1890
1890
  if (Object.keys(lstYields).length === 0) {
1891
1891
  console.warn("[agether] No LST yield data available \u2014 DeFi Llama may be unreachable");
@@ -1927,10 +1927,13 @@ var init_MorphoClient = __esm({
1927
1927
  maxSafeLeverage: parseFloat(maxLeverage.toFixed(2)),
1928
1928
  leveragedNetApy: parseFloat(leveragedNetApy.toFixed(2)),
1929
1929
  liquidity: mkt.totalSupplyUsd - mkt.totalBorrowUsd,
1930
+ totalSupply: mkt.totalSupplyUsd,
1931
+ utilization: mkt.totalBorrowUsd > 0 ? mkt.totalBorrowUsd / mkt.totalSupplyUsd * 100 : 0,
1930
1932
  marketId: mkt.marketId
1931
1933
  });
1932
1934
  }
1933
- return results.sort((a, b) => b.netSpread - a.netSpread);
1935
+ const filtered = minLiquidity > 0 ? results.filter((r) => r.liquidity >= minLiquidity) : results;
1936
+ return filtered.sort((a, b) => b.liquidity - a.liquidity || b.netSpread - a.netSpread);
1934
1937
  }
1935
1938
  /**
1936
1939
  * Withdraw collateral from Morpho Blue.
package/dist/index.d.mts CHANGED
@@ -581,6 +581,8 @@ interface YieldSpreadResult {
581
581
  maxSafeLeverage: number;
582
582
  leveragedNetApy: number;
583
583
  liquidity: number;
584
+ totalSupply: number;
585
+ utilization: number;
584
586
  marketId: string;
585
587
  }
586
588
  declare class MorphoClient {
@@ -932,7 +934,7 @@ declare class MorphoClient {
932
934
  *
933
935
  * @returns Array of markets with yield analysis, sorted by net spread descending.
934
936
  */
935
- getYieldSpread(): Promise<YieldSpreadResult[]>;
937
+ getYieldSpread(minLiquidity?: number): Promise<YieldSpreadResult[]>;
936
938
  /**
937
939
  * Withdraw collateral from Morpho Blue.
938
940
  *
package/dist/index.d.ts CHANGED
@@ -581,6 +581,8 @@ interface YieldSpreadResult {
581
581
  maxSafeLeverage: number;
582
582
  leveragedNetApy: number;
583
583
  liquidity: number;
584
+ totalSupply: number;
585
+ utilization: number;
584
586
  marketId: string;
585
587
  }
586
588
  declare class MorphoClient {
@@ -932,7 +934,7 @@ declare class MorphoClient {
932
934
  *
933
935
  * @returns Array of markets with yield analysis, sorted by net spread descending.
934
936
  */
935
- getYieldSpread(): Promise<YieldSpreadResult[]>;
937
+ getYieldSpread(minLiquidity?: number): Promise<YieldSpreadResult[]>;
936
938
  /**
937
939
  * Withdraw collateral from Morpho Blue.
938
940
  *
package/dist/index.js CHANGED
@@ -2830,7 +2830,7 @@ var _MorphoClient = class _MorphoClient {
2830
2830
  *
2831
2831
  * @returns Array of markets with yield analysis, sorted by net spread descending.
2832
2832
  */
2833
- async getYieldSpread() {
2833
+ async getYieldSpread(minLiquidity = 0) {
2834
2834
  const lstYields = await this._getLstYields();
2835
2835
  if (Object.keys(lstYields).length === 0) {
2836
2836
  console.warn("[agether] No LST yield data available \u2014 DeFi Llama may be unreachable");
@@ -2872,10 +2872,13 @@ var _MorphoClient = class _MorphoClient {
2872
2872
  maxSafeLeverage: parseFloat(maxLeverage.toFixed(2)),
2873
2873
  leveragedNetApy: parseFloat(leveragedNetApy.toFixed(2)),
2874
2874
  liquidity: mkt.totalSupplyUsd - mkt.totalBorrowUsd,
2875
+ totalSupply: mkt.totalSupplyUsd,
2876
+ utilization: mkt.totalBorrowUsd > 0 ? mkt.totalBorrowUsd / mkt.totalSupplyUsd * 100 : 0,
2875
2877
  marketId: mkt.marketId
2876
2878
  });
2877
2879
  }
2878
- return results.sort((a, b) => b.netSpread - a.netSpread);
2880
+ const filtered = minLiquidity > 0 ? results.filter((r) => r.liquidity >= minLiquidity) : results;
2881
+ return filtered.sort((a, b) => b.liquidity - a.liquidity || b.netSpread - a.netSpread);
2879
2882
  }
2880
2883
  /**
2881
2884
  * Withdraw collateral from Morpho Blue.
package/dist/index.mjs CHANGED
@@ -2754,7 +2754,7 @@ var _MorphoClient = class _MorphoClient {
2754
2754
  *
2755
2755
  * @returns Array of markets with yield analysis, sorted by net spread descending.
2756
2756
  */
2757
- async getYieldSpread() {
2757
+ async getYieldSpread(minLiquidity = 0) {
2758
2758
  const lstYields = await this._getLstYields();
2759
2759
  if (Object.keys(lstYields).length === 0) {
2760
2760
  console.warn("[agether] No LST yield data available \u2014 DeFi Llama may be unreachable");
@@ -2796,10 +2796,13 @@ var _MorphoClient = class _MorphoClient {
2796
2796
  maxSafeLeverage: parseFloat(maxLeverage.toFixed(2)),
2797
2797
  leveragedNetApy: parseFloat(leveragedNetApy.toFixed(2)),
2798
2798
  liquidity: mkt.totalSupplyUsd - mkt.totalBorrowUsd,
2799
+ totalSupply: mkt.totalSupplyUsd,
2800
+ utilization: mkt.totalBorrowUsd > 0 ? mkt.totalBorrowUsd / mkt.totalSupplyUsd * 100 : 0,
2799
2801
  marketId: mkt.marketId
2800
2802
  });
2801
2803
  }
2802
- return results.sort((a, b) => b.netSpread - a.netSpread);
2804
+ const filtered = minLiquidity > 0 ? results.filter((r) => r.liquidity >= minLiquidity) : results;
2805
+ return filtered.sort((a, b) => b.liquidity - a.liquidity || b.netSpread - a.netSpread);
2803
2806
  }
2804
2807
  /**
2805
2808
  * Withdraw collateral from Morpho Blue.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agether/sdk",
3
- "version": "2.17.2",
3
+ "version": "2.17.3",
4
4
  "description": "TypeScript SDK for Agether - autonomous credit for AI agents on Ethereum & Base",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",