@hypurrquant/defi-cli 0.3.2 → 0.3.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/main.js CHANGED
@@ -7922,18 +7922,30 @@ function registerYield(parent, getOpts, makeExecutor2) {
7922
7922
  yieldCmd.option("--asset <token>", "Token symbol or address", "USDC").action(async (opts) => {
7923
7923
  try {
7924
7924
  const registry = Registry.loadEmbedded();
7925
- const chainName = (parent.opts().chain ?? "hyperevm").toLowerCase();
7926
- const chain = registry.getChain(chainName);
7927
- const rpc = chain.effectiveRpcUrl();
7928
- const assetAddr = resolveAsset(registry, chainName, opts.asset);
7929
- const results = await collectLendingRates(registry, chainName, rpc, assetAddr);
7930
- results.sort((a, b) => b.supply_apy - a.supply_apy);
7931
- const bestSupply = results[0]?.protocol ?? null;
7932
- const bestBorrow = results.reduce((best, r) => {
7933
- if (!best || r.borrow_variable_apy < best.borrow_variable_apy) return r;
7934
- return best;
7935
- }, null)?.protocol ?? null;
7936
- printOutput({ asset: opts.asset, chain: chainName, rates: results, best_supply: bestSupply, best_borrow: bestBorrow }, getOpts());
7925
+ const asset = opts.asset;
7926
+ const allRates = [];
7927
+ for (const [chainKey] of registry.chains) {
7928
+ try {
7929
+ const chain = registry.getChain(chainKey);
7930
+ const rpc = chain.effectiveRpcUrl();
7931
+ let assetAddr;
7932
+ try {
7933
+ assetAddr = resolveAsset(registry, chainKey, asset);
7934
+ } catch {
7935
+ continue;
7936
+ }
7937
+ const rates = await collectLendingRates(registry, chainKey, rpc, assetAddr);
7938
+ for (const r of rates) {
7939
+ if (r.supply_apy > 0) {
7940
+ allRates.push({ chain: chain.name, protocol: r.protocol, supply_apy: r.supply_apy, borrow_variable_apy: r.borrow_variable_apy });
7941
+ }
7942
+ }
7943
+ } catch {
7944
+ }
7945
+ }
7946
+ allRates.sort((a, b) => b.supply_apy - a.supply_apy);
7947
+ const best = allRates[0] ? `${allRates[0].protocol} on ${allRates[0].chain}` : null;
7948
+ printOutput({ asset, chains_scanned: registry.chains.size, rates: allRates, best_supply: best }, getOpts());
7937
7949
  } catch (err) {
7938
7950
  printOutput({ error: String(err) }, getOpts());
7939
7951
  }
@@ -10985,7 +10997,7 @@ var BANNER = `
10985
10997
  \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551
10986
10998
  \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D
10987
10999
 
10988
- 2 chains \xB7 23 protocols \xB7 by HypurrQuant
11000
+ 2 chains \xB7 21 protocols \xB7 by HypurrQuant
10989
11001
 
10990
11002
  Scan exploits, swap tokens, bridge assets, track whales,
10991
11003
  compare yields \u2014 all from your terminal.