@1delta/margin-fetcher 0.0.30 → 0.0.32

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.
Files changed (38) hide show
  1. package/dist/assets/index.d.ts +0 -1
  2. package/dist/assets/index.d.ts.map +1 -1
  3. package/dist/assets/index.js +2 -7
  4. package/dist/lending/addresses/compoundV3.d.ts.map +1 -1
  5. package/dist/lending/addresses/compoundV3.js +2 -3
  6. package/dist/lending/user-data/morpho/userCallParse.d.ts.map +1 -1
  7. package/dist/lending/user-data/morpho/userCallParse.js +3 -6
  8. package/dist/prices/defillama/index.d.ts.map +1 -1
  9. package/dist/prices/defillama/index.js +21 -0
  10. package/dist/prices/main-prices/addresses/aaveOracles.d.ts +4 -1
  11. package/dist/prices/main-prices/addresses/aaveOracles.d.ts.map +1 -1
  12. package/dist/prices/main-prices/addresses/aaveOracles.js +4 -1
  13. package/dist/prices/main-prices/addresses/morpho.d.ts.map +1 -1
  14. package/dist/prices/main-prices/addresses/morpho.js +39 -32
  15. package/dist/prices/main-prices/fetchOracleData.js +2 -0
  16. package/dist/utils/index.d.ts +1 -1
  17. package/dist/utils/index.d.ts.map +1 -1
  18. package/dist/utils/index.js +19 -14
  19. package/dist/yields/index.d.ts.map +1 -1
  20. package/dist/yields/index.js +21 -2
  21. package/dist/yields/yieldTypes.d.ts +76 -0
  22. package/dist/yields/yieldTypes.d.ts.map +1 -0
  23. package/dist/yields/yieldTypes.js +7 -0
  24. package/package.json +2 -2
  25. package/src/assets/index.ts +1 -11
  26. package/src/lending/addresses/compoundV3.ts +1 -5
  27. package/src/lending/user-data/morpho/userCallParse.ts +4 -10
  28. package/src/prices/defillama/index.ts +24 -0
  29. package/src/prices/main-prices/addresses/aaveOracles.ts +4 -1
  30. package/src/prices/main-prices/addresses/morpho.ts +39 -32
  31. package/src/prices/main-prices/fetchOracleData.ts +1 -0
  32. package/src/utils/index.ts +33 -21
  33. package/src/yields/index.ts +25 -2
  34. package/src/yields/yieldTypes.ts +80 -0
  35. package/test/lenderData.test.ts +3 -4
  36. package/test/mainPrices.test.ts +14 -13
  37. package/test/morphoPrice.test.ts +1 -1
  38. package/test/userDataMorphoKatana.test.ts +4 -5
@@ -6,7 +6,6 @@ export declare const getAaveAssets: (chainId: string | undefined, lendingProtoco
6
6
  export declare const getInitAssets: (chainId: string | undefined, lendingProtocol?: Lender) => string[];
7
7
  export declare const getCompoundV3Assets: (chainId: string | undefined, lendingProtocol?: Lender) => string[];
8
8
  export declare const getCompoundV2Assets: (chainId: string | undefined, lendingProtocol?: Lender) => string[];
9
- export declare const getSwaylendAssets: (chainId: string | undefined, lendingProtocol?: Lender) => string[];
10
9
  export declare function getAaveTypePoolDataProviderAddress(chainId: string, lender: string): any;
11
10
  export declare function getAaveTypePoolAddress(chainId: string, lender: string): string;
12
11
  export declare function getAssetMeta(chainId: string, asset: string | undefined): any;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/assets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,MAAM,EAEP,MAAM,wBAAwB,CAAC;AAGhC,gCAAgC;AAChC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAC3B,GAAG,CACnD;AAED,eAAO,MAAM,aAAa,GACxB,SAAS,MAAM,GAAG,SAAS,EAC3B,kBAAiB,MAAuB,KACvC,MAAM,EAIR,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,SAAS,MAAM,GAAG,SAAS,EAC3B,wBAA6B,KAC5B,MAAM,EAIR,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,SAAS,MAAM,GAAG,SAAS,EAC3B,wBAA0C,KACzC,MAAM,EAMR,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,SAAS,MAAM,GAAG,SAAS,EAC3B,wBAA8B,KAC7B,MAAM,EAMR,CAAC;AAEF,e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AAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GACb,MAAM,CAGR;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GACF,GAAG,CACvE;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,GAAG,MAAM,WAEpC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,cAAc,MAAM,EAAE,SAAS,MAAM,WAEtE,CAAC"}
@@ -1,5 +1,5 @@
1
- import { AAVE_FORK_POOL_DATA, AAVE_STYLE_RESERVE_ASSETS, AAVE_STYLE_TOKENS, ASSET_META, COMPOUND_STYLE_RESERVE_ASSETS, COMPOUND_V2_STYLE_RESERVE_ASSETS, INIT_STYLE_RESERVE_ASSETS, Lender, SWAYLEND_RESERVE_ASSETS, } from "@1delta/asset-registry";
2
- import { isAaveType, isCompoundV3, isInit, isSwaylend } from "../utils";
1
+ import { AAVE_FORK_POOL_DATA, AAVE_STYLE_RESERVE_ASSETS, AAVE_STYLE_TOKENS, ASSET_META, COMPOUND_STYLE_RESERVE_ASSETS, COMPOUND_V2_STYLE_RESERVE_ASSETS, INIT_STYLE_RESERVE_ASSETS, Lender, } from "@1delta/asset-registry";
2
+ import { isAaveType, isCompoundV3, isInit } from "../utils";
3
3
  /** No specific configuration */
4
4
  export const LENDER_MODE_NO_MODE = 0;
5
5
  export function getAaveStyleProtocolTokenMap(chainId, lender) {
@@ -25,11 +25,6 @@ export const getCompoundV2Assets = (chainId, lendingProtocol = Lender.VENUS) =>
25
25
  return (COMPOUND_V2_STYLE_RESERVE_ASSETS[lendingProtocol]?.[chainId ?? "0"] ?? []);
26
26
  return [];
27
27
  };
28
- export const getSwaylendAssets = (chainId, lendingProtocol = Lender.SWAYLEND_USDC) => {
29
- if (isSwaylend(lendingProtocol))
30
- return SWAYLEND_RESERVE_ASSETS[lendingProtocol]?.[chainId ?? "0"] ?? [];
31
- return [];
32
- };
33
28
  export function getAaveTypePoolDataProviderAddress(chainId, lender) {
34
29
  // @ts-ignore
35
30
  return AAVE_FORK_POOL_DATA[lender]?.[chainId]?.protocolDataProvider;
@@ -1 +1 @@
1
- {"version":3,"file":"compoundV3.d.ts","sourceRoot":"","sources":["../../../src/lending/addresses/compoundV3.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,MAAM,EAEP,MAAM,wBAAwB,CAAA;AAE/B,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,EACf,MAAM,SAA2B,GAChC,MAAM,GAAG,SAAS,CAEpB;AAED,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,MAAM,OAG/D;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,OAGrD;AAyBD,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,OAAO,EAAE,MAAM;;;EAMhB"}
1
+ {"version":3,"file":"compoundV3.d.ts","sourceRoot":"","sources":["../../../src/lending/addresses/compoundV3.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,MAAM,EACP,MAAM,wBAAwB,CAAA;AAE/B,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,EACf,MAAM,SAA2B,GAChC,MAAM,GAAG,SAAS,CAEpB;AAED,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,MAAM,OAG/D;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,OAGrD;AAyBD,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,OAAO,EAAE,MAAM;;;EAGhB"}
@@ -1,4 +1,4 @@
1
- import { Chain, COMETS_PER_CHAIN_MAP, COMPOUND_BASE_TOKENS, Lender, SWAYLEND_BASE_TOKENS, } from '@1delta/asset-registry';
1
+ import { Chain, COMETS_PER_CHAIN_MAP, COMPOUND_BASE_TOKENS, Lender, } from '@1delta/asset-registry';
2
2
  export function getCompoundV3CometAddress(chainId, lender = Lender.COMPOUND_V3_USDCE) {
3
3
  return COMETS_PER_CHAIN_MAP[chainId]?.[lender];
4
4
  }
@@ -33,6 +33,5 @@ const addressesCompoundV3 = {
33
33
  },
34
34
  };
35
35
  export function getCompoundV3BaseAsset(lender, chainId) {
36
- return (COMPOUND_BASE_TOKENS[lender]?.[chainId] ??
37
- SWAYLEND_BASE_TOKENS[lender]?.[chainId]);
36
+ return COMPOUND_BASE_TOKENS[lender]?.[chainId];
38
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"userCallParse.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/morpho/userCallParse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAE/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAA;AAiDpD,eAAO,MAAM,kCAAkC,GAC7C,QAAQ,MAAM,EACd,SAAS,MAAM,EACf,SAAS,MAAM,EACf,SAAS,MAAM,EAAE,EACjB,QAAQ;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EACnC,YAAY;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EACvC,YAAY,GAAG,KACd,CACD,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,yBAAyB,CAAA;CAAE,GAAG,SAAS,EAC5E,MAAM,CAkGP,CAAA"}
1
+ {"version":3,"file":"userCallParse.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/morpho/userCallParse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAE/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAA;AAiDpD,eAAO,MAAM,kCAAkC,GAC7C,QAAQ,MAAM,EACd,SAAS,MAAM,EACf,SAAS,MAAM,EACf,SAAS,MAAM,EAAE,EACjB,QAAQ;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EACnC,YAAY;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EACvC,YAAY,GAAG,KACd,CACD,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,yBAAyB,CAAA;CAAE,GAAG,SAAS,EAC5E,MAAM,CA4FP,CAAA"}
@@ -61,8 +61,6 @@ export const getMorphoUserDataConverterWithlens = (lender, chainId, account, mar
61
61
  let datas = {};
62
62
  // we loop over the return dat
63
63
  for (let i = 0; i < data.length; i++) {
64
- let totalDebt24h = 0;
65
- let totalDeposits24h = 0;
66
64
  // get balance data array for chunk
67
65
  const balanceDatas = decodePackedDataset(data[i]);
68
66
  // itereate of balanceDatas received in chunk
@@ -72,8 +70,6 @@ export const getMorphoUserDataConverterWithlens = (lender, chainId, account, mar
72
70
  marketsHandled.push(markeId);
73
71
  const market = lenderData[markeId]?.params?.market;
74
72
  const { dataForMarket, addedDebt, addedDeposits } = createMorphoEntryFromMarketWithLens(balanceData, chainId, market, prices, pricesHist);
75
- totalDebt24h += addedDebt;
76
- totalDeposits24h += addedDeposits;
77
73
  const payload = {
78
74
  chainId,
79
75
  account,
@@ -81,7 +77,7 @@ export const getMorphoUserDataConverterWithlens = (lender, chainId, account, mar
81
77
  rewards: {},
82
78
  userEMode: 0,
83
79
  };
84
- const userData = createBaseTypeUserState(payload, lenderData[markeId].data, totalDeposits24h, totalDebt24h);
80
+ const userData = createBaseTypeUserState(payload, lenderData[markeId].data, addedDeposits, addedDebt);
85
81
  datas[market.lender] = {
86
82
  ...payload,
87
83
  ...userData,
@@ -179,7 +175,8 @@ function createMorphoEntryFromMarketWithLens(balanceInfo, chainId, market, price
179
175
  [loanAddress]: dataForLoanAsset,
180
176
  [collateralAddress]: dataForCollateralAsset,
181
177
  },
182
- addedDeposits: Number(loanDepositNumber) * priceHistLoan + Number(collateralDec) * priceHist,
178
+ addedDeposits: Number(loanDepositNumber) * priceHistLoan +
179
+ Number(collateralDec) * priceHist,
183
180
  addedDebt: Number(borrowDec) * priceHistLoan,
184
181
  };
185
182
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prices/defillama/index.ts"],"names":[],"mappings":"AAkQA,wBAAsB,kBAAkB,iBAyCvC;AAED,wBAAsB,sBAAsB,iBA6C3C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prices/defillama/index.ts"],"names":[],"mappings":"AAoRA,wBAAsB,kBAAkB,iBA4CvC;AAED,wBAAsB,sBAAsB,iBAgD3C"}
@@ -119,6 +119,12 @@ const kHYPE = '0xfd739d4e423301ce9385c1fb8850539d657c296d';
119
119
  const prefixSolana = 'solana:';
120
120
  const JITOSOL = 'J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn';
121
121
  const SOL = 'So11111111111111111111111111111111111111112';
122
+ const prefixXdc = 'xdc:';
123
+ const WXDC = '0x951857744785e80e2de051c32ee7b25f9c458c42';
124
+ const prefixBera = 'berachain:';
125
+ const WBERA = '0x6969696969696969696969696969696969696969';
126
+ const prefixCronos = 'cronos:';
127
+ const WCRO = '0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23';
122
128
  // const prefixKaia = 'kaia:'
123
129
  // const WKAIA = '0x19aac5f612f524b754ca7e7c41cbfa2e981a4432'
124
130
  const datasAvalanche = [WAVAX, SAVAX].map((d) => prefixAvalanche + d).join(',');
@@ -136,6 +142,9 @@ const datasHyperEvm = [WYPE, WSTHYPE, kHYPE]
136
142
  .map((d) => prefixHyperEVM + d)
137
143
  .join(',');
138
144
  const datasSolana = [JITOSOL, SOL].map((d) => prefixSolana + d).join(',');
145
+ const datasBera = [WBERA].map((d) => prefixBera + d).join(',');
146
+ const datasXdc = [WXDC].map((d) => prefixXdc + d).join(',');
147
+ const datasCrpnos = [WCRO].map((d) => prefixCronos + d).join(',');
139
148
  // const datasKaia = [WKAIA].map((d) => prefixKaia + d).join(',')
140
149
  const URL = `https://coins.llama.fi/prices/current/${[
141
150
  datasEthereum,
@@ -151,6 +160,9 @@ const URL = `https://coins.llama.fi/prices/current/${[
151
160
  datasSonic,
152
161
  datasPolygon,
153
162
  datasSolana,
163
+ datasBera,
164
+ datasXdc,
165
+ datasCrpnos,
154
166
  ].join(',')}?searchWidth=4h`;
155
167
  const URL_HIST = (ref) => `https://coins.llama.fi/prices/historical/${ref}/${[
156
168
  datasEthereum,
@@ -237,6 +249,9 @@ const SYMBOL_MAP = {
237
249
  woeth: 'Wrapped OETH::WOETH',
238
250
  jitosol: 'Jito Staked SOL::JitoSOL',
239
251
  sol: 'SOL',
252
+ wcro: 'WCRO',
253
+ wxdc: 'WXDC',
254
+ wbera: 'WBERA',
240
255
  };
241
256
  export async function fetchDefillamaData() {
242
257
  try {
@@ -253,6 +268,9 @@ export async function fetchDefillamaData() {
253
268
  prices['WSOL'] = prices['SOL'];
254
269
  prices['AVAX'] = prices['WAVAX'];
255
270
  prices['METIS'] = prices['WMETIS'];
271
+ prices['CRO'] = prices['WCRO'];
272
+ prices['XDC'] = prices['WXDC'];
273
+ prices['BERA'] = prices['WBERA'];
256
274
  // prices['WKAIA'] = prices['KAIA']
257
275
  prices['USDBC'] = prices['USDC'];
258
276
  prices['BTCB'] = prices['WBTC'];
@@ -290,6 +308,9 @@ export async function fetchDefillamaHistData() {
290
308
  histPrices['AVAX'] = histPrices['WAVAX'];
291
309
  histPrices['METIS'] = histPrices['WMETIS'];
292
310
  histPrices['HYPE'] = histPrices['WHYPE'];
311
+ histPrices['BERA'] = histPrices['WBERA'];
312
+ histPrices['CRO'] = histPrices['WCRO'];
313
+ histPrices['XDC'] = histPrices['WXDC'];
293
314
  // histPrices['WKAIA'] = histPrices['KAIA']
294
315
  histPrices['LUSD'] = histPrices['USDT'];
295
316
  histPrices['XDAI'] = histPrices['DAI'];
@@ -175,7 +175,7 @@ export declare const AAVE_STYLE_ORACLES: {
175
175
  AVALON_STBTC: {
176
176
  '56': string;
177
177
  };
178
- AVALON_UNILOTX: {
178
+ AVALON_UNIIOTX: {
179
179
  '4689': string;
180
180
  };
181
181
  AVALON_BOB: {
@@ -296,5 +296,8 @@ export declare const AAVE_STYLE_ORACLES: {
296
296
  PHIAT: {
297
297
  '369': string;
298
298
  };
299
+ FATHOM: {
300
+ '50': string;
301
+ };
299
302
  };
300
303
  //# sourceMappingURL=aaveOracles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"aaveOracles.d.ts","sourceRoot":"","sources":["../../../../src/prices/main-prices/addresses/aaveOracles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0S9B,CAAA"}
1
+ {"version":3,"file":"aaveOracles.d.ts","sourceRoot":"","sources":["../../../../src/prices/main-prices/addresses/aaveOracles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6S9B,CAAA"}
@@ -175,7 +175,7 @@ export const AAVE_STYLE_ORACLES = {
175
175
  AVALON_STBTC: {
176
176
  '56': '0xE8510211ed910A0fa1FeaD133353A306798BC0c8',
177
177
  },
178
- AVALON_UNILOTX: {
178
+ AVALON_UNIIOTX: {
179
179
  '4689': '0x406010dA9450f62339FBF9e0aBBB2cEF6e426918',
180
180
  },
181
181
  AVALON_BOB: {
@@ -296,4 +296,7 @@ export const AAVE_STYLE_ORACLES = {
296
296
  PHIAT: {
297
297
  '369': '0x7f9d7476e6A2561fA011aA788979234De80900F7',
298
298
  },
299
+ FATHOM: {
300
+ '50': '0x54348d953Abc4f167cbdeDe648095c1aF7DE355A',
301
+ },
299
302
  };
@@ -1 +1 @@
1
- {"version":3,"file":"morpho.d.ts","sourceRoot":"","sources":["../../../../src/prices/main-prices/addresses/morpho.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,MAAM,CAAA;IACvB,iBAAiB,EAAE,MAAM,CAAA;IACzB,uBAAuB,EAAE,MAAM,CAAA;CAChC;AAED,eAAO,MAAM,aAAa,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;CAi/E5D,CAAA"}
1
+ {"version":3,"file":"morpho.d.ts","sourceRoot":"","sources":["../../../../src/prices/main-prices/addresses/morpho.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,MAAM,CAAA;IACvB,iBAAiB,EAAE,MAAM,CAAA;IACzB,uBAAuB,EAAE,MAAM,CAAA;CAChC;AAED,eAAO,MAAM,aAAa,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;CAw/E5D,CAAA"}
@@ -1029,6 +1029,13 @@ export const MrophoOracles = {
1029
1029
  loanAssetDecimals: 18,
1030
1030
  collateralAssetDecimals: 18,
1031
1031
  },
1032
+ {
1033
+ oracle: '0xC3dA445C9c4Cd78325C6DCDD314936C2Aa226372',
1034
+ loanAsset: '0xb0f70c0bd6fd87dbeb7c10dc692a2a6106817072',
1035
+ collateralAsset: '0xecac9c5f704e954931349da37f60e39f515c11c1',
1036
+ loanAssetDecimals: 8,
1037
+ collateralAssetDecimals: 8,
1038
+ },
1032
1039
  {
1033
1040
  oracle: '0xB60F728BdcE5e3921C0E42c1a6F07A1313D0040e',
1034
1041
  loanAsset: '0x203a662b0bd271a6ed5a60edfbd04bfce608fd36',
@@ -1043,13 +1050,6 @@ export const MrophoOracles = {
1043
1050
  loanAssetDecimals: 6,
1044
1051
  collateralAssetDecimals: 18,
1045
1052
  },
1046
- {
1047
- oracle: '0xC3dA445C9c4Cd78325C6DCDD314936C2Aa226372',
1048
- loanAsset: '0xb0f70c0bd6fd87dbeb7c10dc692a2a6106817072',
1049
- collateralAsset: '0xecac9c5f704e954931349da37f60e39f515c11c1',
1050
- loanAssetDecimals: 8,
1051
- collateralAssetDecimals: 8,
1052
- },
1053
1053
  {
1054
1054
  oracle: '0xBa4c6d027b3c08Cb8c21840501Cd04ad6Bb37Cd0',
1055
1055
  loanAsset: '0x203a662b0bd271a6ed5a60edfbd04bfce608fd36',
@@ -1072,11 +1072,11 @@ export const MrophoOracles = {
1072
1072
  collateralAssetDecimals: 6,
1073
1073
  },
1074
1074
  {
1075
- oracle: '0x970b106C6C1df8276577dBdC8FdA010e418fC1EC',
1076
- loanAsset: '0x00000000efe302beaa2b3e6e1b18d08d69a9012a',
1077
- collateralAsset: '0xee7d8bcfb72bc1880d0cf19822eb0a2e6577ab62',
1075
+ oracle: '0xD978CE03d8BB0eb3f09cB2a469DbbC25DB42F3Ae',
1076
+ loanAsset: '0x203a662b0bd271a6ed5a60edfbd04bfce608fd36',
1077
+ collateralAsset: '0x9a6bd7b6fd5c4f87eb66356441502fc7dcdd185b',
1078
1078
  loanAssetDecimals: 6,
1079
- collateralAssetDecimals: 18,
1079
+ collateralAssetDecimals: 6,
1080
1080
  },
1081
1081
  {
1082
1082
  oracle: '0x3C40506CcD8f124f05a900446d38dDA4baAfd82d',
@@ -1086,25 +1086,25 @@ export const MrophoOracles = {
1086
1086
  collateralAssetDecimals: 8,
1087
1087
  },
1088
1088
  {
1089
- oracle: '0xD978CE03d8BB0eb3f09cB2a469DbbC25DB42F3Ae',
1090
- loanAsset: '0x203a662b0bd271a6ed5a60edfbd04bfce608fd36',
1091
- collateralAsset: '0x9a6bd7b6fd5c4f87eb66356441502fc7dcdd185b',
1089
+ oracle: '0x970b106C6C1df8276577dBdC8FdA010e418fC1EC',
1090
+ loanAsset: '0x00000000efe302beaa2b3e6e1b18d08d69a9012a',
1091
+ collateralAsset: '0xee7d8bcfb72bc1880d0cf19822eb0a2e6577ab62',
1092
1092
  loanAssetDecimals: 6,
1093
- collateralAssetDecimals: 6,
1093
+ collateralAssetDecimals: 18,
1094
1094
  },
1095
1095
  {
1096
- oracle: '0x2477367cFF71b31b4BE6963e5691859E8fcDF084',
1097
- loanAsset: '0x2dca96907fde857dd3d816880a0df407eeb2d2f2',
1098
- collateralAsset: '0xee7d8bcfb72bc1880d0cf19822eb0a2e6577ab62',
1096
+ oracle: '0x83F4197076614efe8e4c37BB9EFBfeaD08d4719f',
1097
+ loanAsset: '0x00000000efe302beaa2b3e6e1b18d08d69a9012a',
1098
+ collateralAsset: '0xb0f70c0bd6fd87dbeb7c10dc692a2a6106817072',
1099
1099
  loanAssetDecimals: 6,
1100
- collateralAssetDecimals: 18,
1100
+ collateralAssetDecimals: 8,
1101
1101
  },
1102
1102
  {
1103
- oracle: '0x07A9c82f38aAD9855FaF76D398F9C64a7A12F0AE',
1103
+ oracle: '0x2477367cFF71b31b4BE6963e5691859E8fcDF084',
1104
1104
  loanAsset: '0x2dca96907fde857dd3d816880a0df407eeb2d2f2',
1105
- collateralAsset: '0x0913da6da4b42f538b445599b46bb4622342cf52',
1105
+ collateralAsset: '0xee7d8bcfb72bc1880d0cf19822eb0a2e6577ab62',
1106
1106
  loanAssetDecimals: 6,
1107
- collateralAssetDecimals: 8,
1107
+ collateralAssetDecimals: 18,
1108
1108
  },
1109
1109
  {
1110
1110
  oracle: '0xcC139318686969b9D30Dd62aA206725B269DA40d',
@@ -1114,9 +1114,9 @@ export const MrophoOracles = {
1114
1114
  collateralAssetDecimals: 8,
1115
1115
  },
1116
1116
  {
1117
- oracle: '0x83F4197076614efe8e4c37BB9EFBfeaD08d4719f',
1118
- loanAsset: '0x00000000efe302beaa2b3e6e1b18d08d69a9012a',
1119
- collateralAsset: '0xb0f70c0bd6fd87dbeb7c10dc692a2a6106817072',
1117
+ oracle: '0x07A9c82f38aAD9855FaF76D398F9C64a7A12F0AE',
1118
+ loanAsset: '0x2dca96907fde857dd3d816880a0df407eeb2d2f2',
1119
+ collateralAsset: '0x0913da6da4b42f538b445599b46bb4622342cf52',
1120
1120
  loanAssetDecimals: 6,
1121
1121
  collateralAssetDecimals: 8,
1122
1122
  },
@@ -1176,6 +1176,13 @@ export const MrophoOracles = {
1176
1176
  loanAssetDecimals: 6,
1177
1177
  collateralAssetDecimals: 8,
1178
1178
  },
1179
+ {
1180
+ oracle: '0xaa9853c78B92606b21cE57Da7F04F301f031Aba4',
1181
+ loanAsset: '0x203a662b0bd271a6ed5a60edfbd04bfce608fd36',
1182
+ collateralAsset: '0xe007ca01894c863d7898045ed5a3b4abf0b18f37',
1183
+ loanAssetDecimals: 6,
1184
+ collateralAssetDecimals: 18,
1185
+ },
1179
1186
  {
1180
1187
  oracle: '0xcb2d3027Be1Fe4c88fc1840187efCF301Ff7176a',
1181
1188
  loanAsset: '0x00000000efe302beaa2b3e6e1b18d08d69a9012a',
@@ -1204,6 +1211,13 @@ export const MrophoOracles = {
1204
1211
  loanAssetDecimals: 6,
1205
1212
  collateralAssetDecimals: 18,
1206
1213
  },
1214
+ {
1215
+ oracle: '0x269013966Ef83A88B75f0573199CF1Cad8c30f82',
1216
+ loanAsset: '0x00000000efe302beaa2b3e6e1b18d08d69a9012a',
1217
+ collateralAsset: '0xecac9c5f704e954931349da37f60e39f515c11c1',
1218
+ loanAssetDecimals: 6,
1219
+ collateralAssetDecimals: 8,
1220
+ },
1207
1221
  {
1208
1222
  oracle: '0x1c5f3862c913E015eD0a2A9d71E13BE74101F47d',
1209
1223
  loanAsset: '0x203a662b0bd271a6ed5a60edfbd04bfce608fd36',
@@ -1218,13 +1232,6 @@ export const MrophoOracles = {
1218
1232
  loanAssetDecimals: 6,
1219
1233
  collateralAssetDecimals: 18,
1220
1234
  },
1221
- {
1222
- oracle: '0x269013966Ef83A88B75f0573199CF1Cad8c30f82',
1223
- loanAsset: '0x00000000efe302beaa2b3e6e1b18d08d69a9012a',
1224
- collateralAsset: '0xecac9c5f704e954931349da37f60e39f515c11c1',
1225
- loanAssetDecimals: 6,
1226
- collateralAssetDecimals: 8,
1227
- },
1228
1235
  {
1229
1236
  oracle: '0xe8F70671Bc494A96332c809d042bD9bF09452B57',
1230
1237
  loanAsset: '0x00000000efe302beaa2b3e6e1b18d08d69a9012a',
@@ -281,6 +281,8 @@ function lowDecimalOracle(chainId, fork) {
281
281
  if (chainId === Chain.AVALANCHE_C_CHAIN || chainId === Chain.MODE) {
282
282
  return false;
283
283
  }
284
+ if (chainId === Chain.XDC_NETWORK)
285
+ return true;
284
286
  // otherwise, it depends on whether it is aave V3
285
287
  return AAVE_V2_LENDERS.includes(fork);
286
288
  }
@@ -1,4 +1,4 @@
1
- import { Lender } from "@1delta/asset-registry";
1
+ import { Lender } from '@1delta/asset-registry';
2
2
  export declare function isCompoundV3(lender: string): boolean;
3
3
  export declare function isCompoundV3Type(lender: string): boolean;
4
4
  export declare function isInit(lender: string): lender is Lender.INIT;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/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B,CAAC,MAAM,EAAE,MAAM,WAE9C;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,yBAEpC;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,WAE1C;AAID,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,WAE1C;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,WAE1C;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,yBAEpC;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,WAE3C;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,WAExC;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,WAExC;AAED,eAAO,MAAM,kBAAkB,GAAI,GAAG,MAAM,aA2B3C,CAAA;AAED,sCAAsC;AACtC,eAAO,MAAM,uBAAuB,GAClC,YAAY,MAAM,EAAE,EACpB,eAAe,MAAM,EAAE,KACtB,MAAM,EAaR,CAAA;AAaD,mCAAmC;AACnC,eAAO,MAAM,eAAe;;CAAqB,CAAA;AAEjD,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,KAAG,MAEpD,CAAA;AAED,eAAO,MAAM,eAAe,GAC1B,SAAS,MAAM,GAAG,MAAM,GAAG,SAAS,EACpC,wBAAgC,KAC/B,MAAM,EASR,CAAA;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,WAE3C"}
@@ -1,15 +1,21 @@
1
- import { AAVE_FORK_POOL_DATA, AAVE_STYLE_RESERVE_ASSETS, AAVE_V2_LENDERS, AAVE_V3_LENDERS, COMPOUND_BASE_TOKENS, COMPOUND_STYLE_RESERVE_ASSETS, INIT_STYLE_RESERVE_ASSETS, Lender, SWAYLEND_RESERVE_ASSETS, INIT_CONFIG_DATA, MORPHO_BLUE_POOL_DATA, AAVE_V32_LENDERS, } from "@1delta/asset-registry";
2
- import { uniq } from "lodash";
3
- import { COMPOSERS } from "./constants";
4
- import { zeroAddress } from "viem";
5
- const COMPOUND_V3_KEY = "COMPOUND_V3";
6
- export function isCompoundV3(lender) { return lender?.startsWith(COMPOUND_V3_KEY); }
7
- export function isCompoundV3Type(lender) { return lender?.startsWith(COMPOUND_V3_KEY); }
8
- export function isInit(lender) { return lender === Lender.INIT; }
1
+ import { AAVE_FORK_POOL_DATA, AAVE_STYLE_RESERVE_ASSETS, AAVE_V2_LENDERS, AAVE_V3_LENDERS, COMPOUND_BASE_TOKENS, COMPOUND_STYLE_RESERVE_ASSETS, INIT_STYLE_RESERVE_ASSETS, Lender, INIT_CONFIG_DATA, MORPHO_BLUE_POOL_DATA, AAVE_V32_LENDERS, } from '@1delta/asset-registry';
2
+ import { uniq } from 'lodash';
3
+ import { COMPOSERS } from './constants';
4
+ import { zeroAddress } from 'viem';
5
+ const COMPOUND_V3_KEY = 'COMPOUND_V3';
6
+ export function isCompoundV3(lender) {
7
+ return lender?.startsWith(COMPOUND_V3_KEY);
8
+ }
9
+ export function isCompoundV3Type(lender) {
10
+ return lender?.startsWith(COMPOUND_V3_KEY);
11
+ }
12
+ export function isInit(lender) {
13
+ return lender === Lender.INIT;
14
+ }
9
15
  export function isMorphoType(lender) {
10
- return lender?.startsWith("MORPHO_BLUE");
16
+ return lender?.startsWith('MORPHO_BLUE');
11
17
  }
12
- const SWAYLEND_KEY = "SWAYLEND";
18
+ const SWAYLEND_KEY = 'SWAYLEND';
13
19
  export function isAaveV3Type(lender) {
14
20
  return AAVE_V3_LENDERS.includes(lender);
15
21
  }
@@ -64,7 +70,8 @@ export const filterLendersByProtocol = (allLenders, protocolList) => {
64
70
  }
65
71
  const hasMorpho = protocolList.includes(Lender.MORPHO_BLUE);
66
72
  // Filter lenders based on protocol list
67
- return allLenders.filter((lender) => protocolList.includes(lender) || (hasMorpho && lender?.startsWith("MORPHO_BLUE")));
73
+ return allLenders.filter((lender) => protocolList.includes(lender) ||
74
+ (hasMorpho && lender?.startsWith('MORPHO_BLUE')));
68
75
  };
69
76
  const getAavesForChain = () => {
70
77
  let lenders = {};
@@ -91,10 +98,8 @@ export const getLenderAssets = (chainId, lendingProtocol = Lender.AAVE_V3) => {
91
98
  return COMPOUND_STYLE_RESERVE_ASSETS[lendingProtocol]?.[chainId] ?? [];
92
99
  if (isInit(lendingProtocol))
93
100
  return INIT_STYLE_RESERVE_ASSETS[lendingProtocol]?.[chainId] ?? [];
94
- if (isSwaylend(lendingProtocol))
95
- return SWAYLEND_RESERVE_ASSETS[lendingProtocol]?.[chainId ?? 0] ?? [];
96
101
  return [];
97
102
  };
98
103
  export function isMultiMarket(lender) {
99
- return lender?.startsWith("MORPHO_BLUE");
104
+ return lender?.startsWith('MORPHO_BLUE');
100
105
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/yields/index.ts"],"names":[],"mappings":"AAgGA,UAAU,iBAAiB;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,qBAAqB,EAAE,GAAG,CAAA;IAC1B,oBAAoB,EAAE,GAAG,CAAA;CAC1B;AAED,MAAM,WAAW,sBAAsB;IACrC,eAAe,EAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;KAAE,CAAA;IACxD,aAAa,EAAE;QACb,CAAC,OAAO,EAAE,MAAM,GAAG;YACjB,CAAC,MAAM,EAAE,MAAM,GAAG;gBAAE,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAAA;aAAE,CAAA;SACzD,CAAA;KACF,CAAA;CACF;AAcD,eAAO,MAAM,kBAAkB,uCA0a9B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/yields/index.ts"],"names":[],"mappings":"AAkGA,UAAU,iBAAiB;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,qBAAqB,EAAE,GAAG,CAAA;IAC1B,oBAAoB,EAAE,GAAG,CAAA;CAC1B;AAED,MAAM,WAAW,sBAAsB;IACrC,eAAe,EAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;KAAE,CAAA;IACxD,aAAa,EAAE;QACb,CAAC,OAAO,EAAE,MAAM,GAAG;YACjB,CAAC,MAAM,EAAE,MAAM,GAAG;gBAAE,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAAA;aAAE,CAAA;SACzD,CAAA;KACF,CAAA;CACF;AAcD,eAAO,MAAM,kBAAkB,uCA+b9B,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import { apyToAprPercent, apyToApr } from '../utils/parsing';
2
+ import { addressToAssetYearn } from './yieldTypes';
2
3
  const hyUSD = 'High Yield USD Base::HYUSD';
3
4
  const bsdETH = 'Based ETH::BSDETH';
4
5
  const wstHype = 'Staked HYPE Shares::WSTHYPE';
@@ -61,6 +62,7 @@ const FeedData = {
61
62
  ETHZERO: 'https://app.usual.money/api/rewards/rates/ETH0',
62
63
  JITOSOL: 'https://www.jito.network/api/getJitoPoolStats/',
63
64
  THBILL: 'https://thbill-api.theo.xyz/snapshots',
65
+ YEARN_KATANA: 'https://katana-apr-service.vercel.app/api/vaults',
64
66
  };
65
67
  const LenderAPIs = {
66
68
  MERIDIAN: 'https://omnidex.bmaa3ajd1gjri.eu-west-2.cs.amazonlightsail.com/lending_yields',
@@ -175,6 +177,21 @@ export const fetchGeneralYields = async () => {
175
177
  const res = await fetch(FeedData.ETHX).then((r) => r.json());
176
178
  return apyToAprPercent(res.value);
177
179
  });
180
+ const yearnKatanaPromise = safeFetch('YEARN_KATANA', async () => {
181
+ const res = await fetch(FeedData.YEARN_KATANA).then((r) => r.json());
182
+ let map = {};
183
+ Object.entries(res).forEach(([addr, data]) => {
184
+ const key = addressToAssetYearn[addr.toLowerCase()];
185
+ if (key) {
186
+ const apr = ((data.apr.netAPR ?? 0) +
187
+ (data.apr.extra.extrinsicYield ?? 0) +
188
+ (data.apr.extra.katanaNativeYield ?? 0)) *
189
+ 100;
190
+ map[key] = apr;
191
+ }
192
+ });
193
+ return map;
194
+ });
178
195
  const osEthPromise = safeFetch('OSETH', async () => {
179
196
  const res = await fetch(FeedData.OSETH, {
180
197
  method: 'POST',
@@ -223,7 +240,7 @@ export const fetchGeneralYields = async () => {
223
240
  const jitoSolPromise = safeFetch('JITOSOL', async () => {
224
241
  const res = await fetch(FeedData.JITOSOL, {
225
242
  method: 'GET',
226
- headers: { Accept: 'application/json' },
243
+ headers: { Accept: 'application/json', 'User-Agent': '1delta/yields' },
227
244
  }).then((r) => r.json());
228
245
  const val = averageDataLastN(res?.getStakePoolStats?.apy, 7);
229
246
  return apyToApr(val) * 100;
@@ -362,7 +379,7 @@ export const fetchGeneralYields = async () => {
362
379
  },
363
380
  })));
364
381
  });
365
- const [wstethData, ezethData, rethData, weethData, stmaticData, methData, maticXdata, susdeData, meridianData, savaxData, cbethData, rsethData, trumaticData, rtokensData, hypeData, osEthData, ethXData, pufEthData, angleData, susdsData, srUsdData, yusdData, rlpData, wstusrData, csusdlData, sdeusdData, rswethData, ynethxData, ethZeroData, usdZeroPlusData, jitoSolData, thBillData,] = await Promise.all([
382
+ const [wstethData, ezethData, rethData, weethData, stmaticData, methData, maticXdata, susdeData, meridianData, savaxData, cbethData, rsethData, trumaticData, rtokensData, hypeData, osEthData, ethXData, pufEthData, angleData, susdsData, srUsdData, yusdData, rlpData, wstusrData, csusdlData, sdeusdData, rswethData, ynethxData, ethZeroData, usdZeroPlusData, jitoSolData, thBillData, yearnKatanaData,] = await Promise.all([
366
383
  wstethPromise,
367
384
  ezethPromise,
368
385
  rethPromise,
@@ -395,6 +412,7 @@ export const fetchGeneralYields = async () => {
395
412
  usdZeroPlusPromise,
396
413
  jitoSolPromise,
397
414
  thbillPromise,
415
+ yearnKatanaPromise,
398
416
  ]);
399
417
  const data = {
400
418
  intrinsicYields: {
@@ -432,6 +450,7 @@ export const fetchGeneralYields = async () => {
432
450
  ...rtokensData,
433
451
  ...hypeData,
434
452
  ...angleData,
453
+ ...yearnKatanaData,
435
454
  },
436
455
  lenderRewards: {
437
456
  '167000': {
@@ -0,0 +1,76 @@
1
+ export type YearnVault = {
2
+ address: string;
3
+ symbol: string;
4
+ name: string;
5
+ chainID: number;
6
+ token: {
7
+ address: string;
8
+ name: string;
9
+ symbol: string;
10
+ description: string;
11
+ decimals: number;
12
+ };
13
+ tvl: {
14
+ totalAssets: string;
15
+ tvl: number;
16
+ price: number;
17
+ };
18
+ apr: {
19
+ type: string;
20
+ netAPR: number | null;
21
+ fees: {
22
+ performance: number;
23
+ management: number;
24
+ };
25
+ points: {
26
+ weekAgo: number;
27
+ monthAgo: number;
28
+ inception: number;
29
+ };
30
+ pricePerShare: {
31
+ today: number;
32
+ weekAgo: number;
33
+ monthAgo: number;
34
+ };
35
+ extra: {
36
+ stakingRewardsAPR: number | null;
37
+ gammaRewardAPR: number | null;
38
+ katanaRewardsAPR: number | null;
39
+ katanaAppRewardsAPR: number | null;
40
+ FixedRateKatanaRewards: number | null;
41
+ katanaBonusAPY: number | null;
42
+ extrinsicYield: number | null;
43
+ katanaNativeYield: number | null;
44
+ };
45
+ forwardAPR: {
46
+ type: string;
47
+ netAPR: number | null;
48
+ composite: {
49
+ boost: number | null;
50
+ poolAPY: number | null;
51
+ boostedAPR: number | null;
52
+ baseAPR: number | null;
53
+ cvxAPR: number | null;
54
+ rewardsAPR: number | null;
55
+ };
56
+ };
57
+ };
58
+ strategies: {
59
+ address: string;
60
+ name: string;
61
+ status: string;
62
+ netAPR?: number;
63
+ details: {
64
+ totalDebt: string;
65
+ totalLoss: string;
66
+ totalGain: string;
67
+ performanceFee: number;
68
+ lastReport: number;
69
+ debtRatio?: number;
70
+ };
71
+ }[];
72
+ };
73
+ export declare const addressToAssetYearn: {
74
+ [a: string]: string;
75
+ };
76
+ //# sourceMappingURL=yieldTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yieldTypes.d.ts","sourceRoot":"","sources":["../../src/yields/yieldTypes.ts"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AAA;SACjC,CAAA;QACD,UAAU,EAAE;YACV,IAAI,EAAE,MAAM,CAAA;YACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;YACrB,SAAS,EAAE;gBACT,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;gBACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;gBACtB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;gBACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;gBACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;gBACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;aAC1B,CAAA;SACF,CAAA;KACF,CAAA;IACD,UAAU,EAAE;QACV,OAAO,EAAE,MAAM,CAAA;QACf,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,MAAM,CAAA;QACd,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,OAAO,EAAE;YACP,SAAS,EAAE,MAAM,CAAA;YACjB,SAAS,EAAE,MAAM,CAAA;YACjB,SAAS,EAAE,MAAM,CAAA;YACjB,cAAc,EAAE,MAAM,CAAA;YACtB,UAAU,EAAE,MAAM,CAAA;YAClB,SAAS,CAAC,EAAE,MAAM,CAAA;SACnB,CAAA;KACF,EAAE,CAAA;CACJ,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAMtD,CAAA"}
@@ -0,0 +1,7 @@
1
+ export const addressToAssetYearn = {
2
+ '0xe007ca01894c863d7898045ed5a3b4abf0b18f37': 'vbETH yVault::yvvbETH',
3
+ '0x80c34bd3a3569e126e7055831036aa7b212cb159': 'vbUSDC yVault::yvvbUSDC',
4
+ '0x9a6bd7b6fd5c4f87eb66356441502fc7dcdd185b': 'vbUSDT yVault::yvvbUSDT',
5
+ '0xaa0362ecc584b985056e47812931270b99c91f9d': 'vbWBTC yVault::yvvbWBTC',
6
+ '0x93fec6639717b6215a48e5a72a162c50dcc40d68': 'vbAUSD yVault::yvvbAUSD',
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1delta/margin-fetcher",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,7 +17,7 @@
17
17
  "@types/async-retry": "^1.4.9",
18
18
  "async-retry": "^1.3.3",
19
19
  "typescript": "^5.9.2",
20
- "@1delta/providers": "0.0.10"
20
+ "@1delta/providers": "0.0.11"
21
21
  },
22
22
  "scripts": {
23
23
  "build": "tsc",
@@ -7,9 +7,8 @@ import {
7
7
  COMPOUND_V2_STYLE_RESERVE_ASSETS,
8
8
  INIT_STYLE_RESERVE_ASSETS,
9
9
  Lender,
10
- SWAYLEND_RESERVE_ASSETS,
11
10
  } from "@1delta/asset-registry";
12
- import { isAaveType, isCompoundV3, isInit, isSwaylend } from "../utils";
11
+ import { isAaveType, isCompoundV3, isInit } from "../utils";
13
12
 
14
13
  /** No specific configuration */
15
14
  export const LENDER_MODE_NO_MODE = 0;
@@ -58,15 +57,6 @@ export const getCompoundV2Assets = (
58
57
  return [];
59
58
  };
60
59
 
61
- export const getSwaylendAssets = (
62
- chainId: string | undefined,
63
- lendingProtocol = Lender.SWAYLEND_USDC
64
- ): string[] => {
65
- if (isSwaylend(lendingProtocol))
66
- return SWAYLEND_RESERVE_ASSETS[lendingProtocol]?.[chainId ?? "0"] ?? [];
67
- return [];
68
- };
69
-
70
60
  export function getAaveTypePoolDataProviderAddress(
71
61
  chainId: string,
72
62
  lender: string