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