@1delta/margin-fetcher 0.0.111 → 0.0.112

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
@@ -10819,8 +10819,9 @@ var MORPHO_LENS = {
10819
10819
  [Chain.ETHEREUM_MAINNET]: "0x4b5458BB47dCBC1a41B31b41e1a8773dE312BE9d",
10820
10820
  [Chain.PLASMA_MAINNET]: "0xcB6Eb8df68153cebF60E1872273Ef52075a5C297",
10821
10821
  [Chain.BERACHAIN]: "0x7a59ddbB76521E8982Fa3A08598C9a83b14A6C07",
10822
- [Chain.BNB_SMART_CHAIN_MAINNET]: "0xFc98b3157f0447DfbB9FdBE7d072F7DdacA1E27C"
10822
+ [Chain.BNB_SMART_CHAIN_MAINNET]: "0xFc98b3157f0447DfbB9FdBE7d072F7DdacA1E27C",
10823
10823
  // lista lens
10824
+ [Chain.UNICHAIN]: "0xA453ba397c61B0c292EA3959A858821145B2707F"
10824
10825
  };
10825
10826
  var LISTA_LENS = {
10826
10827
  [Chain.BNB_SMART_CHAIN_MAINNET]: "0xFc98b3157f0447DfbB9FdBE7d072F7DdacA1E27C"
@@ -12109,7 +12110,7 @@ var MOONWELL_LENS = {
12109
12110
  [Chain.BASE]: "0x6834770aba6c2028f448e3259ddee4bcb879d459",
12110
12111
  [Chain.MOONBEAM]: "0xe76C8B8706faC85a8Fbdcac3C42e3E7823c73994"
12111
12112
  };
12112
- var CONMPOUND_V2_LENS = {
12113
+ var COMPOUND_V2_LENS = {
12113
12114
  [Lender.VENUS]: VENUS_LENS,
12114
12115
  [Lender.MOONWELL]: MOONWELL_LENS
12115
12116
  };
@@ -12124,7 +12125,7 @@ function getCompoundV2Reserves(chainId, lender = Lender.VENUS) {
12124
12125
  }
12125
12126
  function getCompoundV2Lens(chainId, lender) {
12126
12127
  if (isVenusType(lender)) return VENUS_LENS[chainId];
12127
- return CONMPOUND_V2_LENS[lender]?.[chainId];
12128
+ return COMPOUND_V2_LENS[lender]?.[chainId];
12128
12129
  }
12129
12130
 
12130
12131
  // src/abis/compound-v2/VenusLensLegacy.ts
@@ -20132,7 +20133,7 @@ var fetchGeneralYields = async () => {
20132
20133
  method: "GET",
20133
20134
  headers: { Accept: "application/json" }
20134
20135
  }).then((r) => r.json());
20135
- return Number(res.data?.last_annualized_apr ?? 0);
20136
+ return Number(res.data?.apr_1d ?? 0);
20136
20137
  });
20137
20138
  const csusdlPromise = safeFetch("CSUSDL", async () => {
20138
20139
  const res = await fetch(FeedData.MORPHO_VAULTS, {
@@ -20161,8 +20162,16 @@ var fetchGeneralYields = async () => {
20161
20162
  vaultAddress: "0xdfc24b077bc1425ad1dea75bcb6f8158e10df303"
20162
20163
  })
20163
20164
  }).then((r) => r.json());
20164
- const apr = (res?.apr ?? 0) * 100;
20165
- return apr;
20165
+ let calculated;
20166
+ try {
20167
+ const p = res.portfolio[0][1];
20168
+ const val = p.accountValueHistory[p.accountValueHistory.length - 1][1];
20169
+ const pnl = p.pnlHistory[p.pnlHistory.length - 1][1];
20170
+ calculated = pnl / val * 100;
20171
+ } catch {
20172
+ calculated = (res?.apr ?? 0) * 100;
20173
+ }
20174
+ return calculated;
20166
20175
  });
20167
20176
  const rtokensPromise = safeFetch("RTOKENS", async () => {
20168
20177
  const res = await fetch(FeedData.RTOKENS).then((r) => r.json());