@1delta/margin-fetcher 0.0.22 → 0.0.25

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 (50) hide show
  1. package/dist/lending/addresses/compoundV3.d.ts +1 -2
  2. package/dist/lending/addresses/compoundV3.d.ts.map +1 -1
  3. package/dist/lending/addresses/compoundV3.js +17 -15
  4. package/dist/lending/compound-v3/publicCallBuild.js +2 -2
  5. package/dist/lending/fetchLender.d.ts.map +1 -1
  6. package/dist/lending/morpho/publicCallBuild.d.ts +1 -1
  7. package/dist/lending/morpho/publicCallBuild.d.ts.map +1 -1
  8. package/dist/lending/morpho/publicCallBuild.js +7 -3
  9. package/dist/lending/user-data/compound-v3/index.d.ts +0 -1
  10. package/dist/lending/user-data/compound-v3/index.d.ts.map +1 -1
  11. package/dist/lending/user-data/compound-v3/index.js +0 -1
  12. package/dist/lending/user-data/compound-v3/userCallBuild.d.ts +2 -2
  13. package/dist/lending/user-data/compound-v3/userCallBuild.d.ts.map +1 -1
  14. package/dist/lending/user-data/compound-v3/userCallBuild.js +6 -10
  15. package/dist/lending/user-data/compound-v3/userCallParse.js +2 -2
  16. package/dist/lending/user-data/fetchUserData.d.ts.map +1 -1
  17. package/dist/lending/user-data/morpho/userCallBuild.d.ts.map +1 -1
  18. package/dist/lending/user-data/morpho/userCallBuild.js +1 -0
  19. package/dist/lending/user-data/morpho/userCallParse.d.ts.map +1 -1
  20. package/dist/lending/user-data/morpho/userCallParse.js +8 -1
  21. package/dist/prices/main-prices/addresses/aaveOracles.d.ts +6 -0
  22. package/dist/prices/main-prices/addresses/aaveOracles.d.ts.map +1 -1
  23. package/dist/prices/main-prices/addresses/aaveOracles.js +6 -0
  24. package/dist/prices/main-prices/addresses/morpho.d.ts.map +1 -1
  25. package/dist/prices/main-prices/addresses/morpho.js +1311 -0
  26. package/dist/utils/multicall.d.ts.map +1 -1
  27. package/dist/utils/multicall.js +3 -3
  28. package/package.json +2 -2
  29. package/src/lending/addresses/compoundV3.ts +24 -23
  30. package/src/lending/compound-v3/publicCallBuild.ts +2 -2
  31. package/src/lending/fetchLender.ts +1 -2
  32. package/src/lending/morpho/publicCallBuild.ts +13 -8
  33. package/src/lending/user-data/compound-v3/index.ts +1 -2
  34. package/src/lending/user-data/compound-v3/userCallBuild.ts +18 -16
  35. package/src/lending/user-data/compound-v3/userCallParse.ts +2 -2
  36. package/src/lending/user-data/fetchUserData.ts +0 -1
  37. package/src/lending/user-data/morpho/userCallBuild.ts +1 -0
  38. package/src/lending/user-data/morpho/userCallParse.ts +11 -3
  39. package/src/prices/main-prices/addresses/aaveOracles.ts +6 -0
  40. package/src/prices/main-prices/addresses/morpho.ts +1311 -0
  41. package/src/utils/multicall.ts +45 -37
  42. package/test/lenderDataBasic.test.ts +43 -0
  43. package/test/mainPriceMB.test.ts +17 -2
  44. package/test/mainPrices.test.ts +1 -1
  45. package/test/morphoPrice.test.ts +1 -1
  46. package/test/userDataMorpho.test.ts +203 -13
  47. package/dist/lending/user-data/compound-v3/addresses.d.ts +0 -10
  48. package/dist/lending/user-data/compound-v3/addresses.d.ts.map +0 -1
  49. package/dist/lending/user-data/compound-v3/addresses.js +0 -33
  50. package/src/lending/user-data/compound-v3/addresses.ts +0 -59
@@ -1,7 +1,6 @@
1
- import { Lender } from "@1delta/asset-registry";
1
+ import { Lender } from '@1delta/asset-registry';
2
2
  export declare function getCompoundV3CometAddress(chainId: string, lender?: Lender): string | undefined;
3
3
  export declare function getCompoundV3CometRewardsAddress(chainId: string): any;
4
- export declare function getCompoundV3CometIRGetterAddress(chainId: string): any;
5
4
  export declare function getCompoundV3CometLens(chainId: string): any;
6
5
  export declare function getCompoundV3BaseAsset(lender: Lender | string, chainId: string): {
7
6
  baseAsset: string;
@@ -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,CAAC;AAEhC,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,iCAAiC,CAAC,OAAO,EAAE,MAAM,OAGhE;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,OAGrD;AAmBD,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,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,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, SWAYLEND_BASE_TOKENS, } 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
  }
@@ -6,28 +6,30 @@ export function getCompoundV3CometRewardsAddress(chainId) {
6
6
  // @ts-ignore
7
7
  return addressesCompoundV3.cometRewards[chainId];
8
8
  }
9
- export function getCompoundV3CometIRGetterAddress(chainId) {
10
- // @ts-ignore
11
- return addressesCompoundV3.lens[chainId];
12
- }
13
9
  export function getCompoundV3CometLens(chainId) {
14
10
  // @ts-ignore
15
11
  return addressesCompoundV3.lens[chainId];
16
12
  }
17
13
  const addressesCompoundV3 = {
18
14
  lens: {
19
- [Chain.POLYGON_MAINNET]: "0x4eDA401658c5286d16c4d342884F32280B4E8b1b",
20
- [Chain.MANTLE]: "0x32B31A066c8dd3F7b77283Ba1d89Ddaf6DA0a8aE",
21
- [Chain.ARBITRUM_ONE]: "0x13D9c35f4901491Ac4FFebd3100238BBfFBD7181",
22
- [Chain.BASE]: "0x7e2D250E4FD0EeD6BD2cB3DC525A2b9f12508152",
23
- [Chain.OP_MAINNET]: "0xA453ba397c61B0c292EA3959A858821145B2707F",
15
+ [Chain.POLYGON_MAINNET]: '0x4eDA401658c5286d16c4d342884F32280B4E8b1b',
16
+ [Chain.MANTLE]: '0x32B31A066c8dd3F7b77283Ba1d89Ddaf6DA0a8aE',
17
+ [Chain.ARBITRUM_ONE]: '0x13D9c35f4901491Ac4FFebd3100238BBfFBD7181',
18
+ [Chain.BASE]: '0x7e2D250E4FD0EeD6BD2cB3DC525A2b9f12508152',
19
+ [Chain.OP_MAINNET]: '0xA453ba397c61B0c292EA3959A858821145B2707F',
20
+ [Chain.ETHEREUM_MAINNET]: '0xCe434378adacC51d54312c872113D687Ac19B516',
21
+ [Chain.UNICHAIN]: '0x0bd7473CbBf81d9dD936c61117eD230d95006CA2',
22
+ [Chain.LINEA]: '0x7a59ddbB76521E8982Fa3A08598C9a83b14A6C07',
24
23
  },
25
24
  cometRewards: {
26
- [Chain.POLYGON_MAINNET]: "0x45939657d1CA34A8FA39A924B71D28Fe8431e581",
27
- [Chain.MANTLE]: "0xCd83CbBFCE149d141A5171C3D6a0F0fCCeE225Ab",
28
- [Chain.ARBITRUM_ONE]: "0x88730d254A2f7e6AC8388c3198aFd694bA9f7fae",
29
- [Chain.BASE]: "0x123964802e6ABabBE1Bc9547D72Ef1B69B00A6b1",
30
- [Chain.OP_MAINNET]: "0x443EA0340cb75a160F31A440722dec7b5bc3C2E9",
25
+ [Chain.POLYGON_MAINNET]: '0x45939657d1CA34A8FA39A924B71D28Fe8431e581',
26
+ [Chain.MANTLE]: '0xCd83CbBFCE149d141A5171C3D6a0F0fCCeE225Ab',
27
+ [Chain.ARBITRUM_ONE]: '0x88730d254A2f7e6AC8388c3198aFd694bA9f7fae',
28
+ [Chain.BASE]: '0x123964802e6ABabBE1Bc9547D72Ef1B69B00A6b1',
29
+ [Chain.OP_MAINNET]: '0x443EA0340cb75a160F31A440722dec7b5bc3C2E9',
30
+ [Chain.ETHEREUM_MAINNET]: '0x1B0e765F6224C21223AeA2af16c1C46E38885a40',
31
+ [Chain.SCROLL]: '0x70167D30964cbFDc315ECAe02441Af747bE0c5Ee',
32
+ [Chain.LINEA]: '0x2c7118c4C88B9841FCF839074c26Ae8f035f2921',
31
33
  },
32
34
  };
33
35
  export function getCompoundV3BaseAsset(lender, chainId) {
@@ -1,5 +1,5 @@
1
1
  import { getCompoundV3Assets } from "../../assets";
2
- import { getCompoundV3BaseAsset, getCompoundV3CometAddress, getCompoundV3CometIRGetterAddress } from "../addresses/compoundV3";
2
+ import { getCompoundV3BaseAsset, getCompoundV3CometAddress, getCompoundV3CometLens } from "../addresses/compoundV3";
3
3
  export const buildCompoundV3StyleLenderReserveCall = (chainId, lender) => {
4
4
  const baseAssetData = getCompoundV3BaseAsset(lender, chainId);
5
5
  const underlyingArray = getCompoundV3Assets(chainId, lender);
@@ -46,7 +46,7 @@ export const buildCompoundV3StyleLenderReserveCall = (chainId, lender) => {
46
46
  params: [],
47
47
  };
48
48
  const callInterest = {
49
- address: getCompoundV3CometIRGetterAddress(chainId),
49
+ address: getCompoundV3CometLens(chainId),
50
50
  name: 'getCometInterest',
51
51
  params: [cometContractAddress],
52
52
  };
@@ -1 +1 @@
1
- {"version":3,"file":"fetchLender.d.ts","sourceRoot":"","sources":["../../src/lending/fetchLender.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAWnE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAG/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AA+E1C,eAAO,MAAM,mBAAmB,GAC9B,SAAS,MAAM,EACf,SAAS,MAAM,EAAE,EACjB,QAAQ;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EACnC,kBAAkB,gBAAgB,EAClC,gBAAgB,sBAAsB,EACtC,YAAW,MAAM,OAAO,CAAC,gBAAgB,CAExC,KACA,OAAO,CAAC;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAsDnC,CAAA"}
1
+ {"version":3,"file":"fetchLender.d.ts","sourceRoot":"","sources":["../../src/lending/fetchLender.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAWnE,OAAO,EAAS,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAGtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AA+E1C,eAAO,MAAM,mBAAmB,GAC9B,SAAS,MAAM,EACf,SAAS,MAAM,EAAE,EACjB,QAAQ;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EACnC,kBAAkB,gBAAgB,EAClC,gBAAgB,sBAAsB,EACtC,YAAW,MAAM,OAAO,CAAC,gBAAgB,CAExC,KACA,OAAO,CAAC;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAqDnC,CAAA"}
@@ -1,4 +1,4 @@
1
- import { AdditionalYields } from "../../types";
1
+ import { AdditionalYields } from '../../types';
2
2
  export declare function fetchMorphoPublicData(chainId: string, yields?: AdditionalYields): Promise<{
3
3
  [m: string]: import("./types").MorphoGeneralPublicResponse;
4
4
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"publicCallBuild.d.ts","sourceRoot":"","sources":["../../../src/lending/morpho/publicCallBuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAI9C,wBAAsB,qBAAqB,CACvC,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,gBAA2E;;GAItF"}
1
+ {"version":3,"file":"publicCallBuild.d.ts","sourceRoot":"","sources":["../../../src/lending/morpho/publicCallBuild.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAI9C,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,gBAIP;;GAIF"}
@@ -1,6 +1,10 @@
1
- import { convertMarketsToMorphoResponse } from "./convertPublic";
2
- import { fetchMorphoMarkets } from "./fetchPublic";
3
- export async function fetchMorphoPublicData(chainId, yields = { intrinsicYields: {}, lenderRewards: {}, loaded: true }) {
1
+ import { convertMarketsToMorphoResponse } from './convertPublic';
2
+ import { fetchMorphoMarkets } from './fetchPublic';
3
+ export async function fetchMorphoPublicData(chainId, yields = {
4
+ intrinsicYields: {},
5
+ lenderRewards: {},
6
+ loaded: true,
7
+ }) {
4
8
  const mbData = await fetchMorphoMarkets(chainId);
5
9
  return convertMarketsToMorphoResponse(mbData, chainId, yields);
6
10
  }
@@ -1,4 +1,3 @@
1
1
  export * from "./userCallBuild";
2
2
  export * from "./userCallParse";
3
- export * from "./addresses";
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/compound-v3/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/compound-v3/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA"}
@@ -1,3 +1,2 @@
1
1
  export * from "./userCallBuild";
2
2
  export * from "./userCallParse";
3
- export * from "./addresses";
@@ -1,4 +1,4 @@
1
- import { Lender } from "@1delta/asset-registry";
2
- import { Call } from "../../../utils/multicall";
1
+ import { Lender } from '@1delta/asset-registry';
2
+ import { Call } from '../../../utils/multicall';
3
3
  export declare const buildCompoundV3UserCall: (chainId: string, lender: Lender, account: string) => Call[];
4
4
  //# sourceMappingURL=userCallBuild.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"userCallBuild.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/compound-v3/userCallBuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAI/C,eAAO,MAAM,uBAAuB,GAAI,SAAS,MAAM,EAAE,QAAQ,MAAM,EAAE,SAAS,MAAM,KAAG,IAAI,EAwC9F,CAAA"}
1
+ {"version":3,"file":"userCallBuild.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/compound-v3/userCallBuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAQ/C,eAAO,MAAM,uBAAuB,GAClC,SAAS,MAAM,EACf,QAAQ,MAAM,EACd,SAAS,MAAM,KACd,IAAI,EAkCN,CAAA"}
@@ -1,10 +1,10 @@
1
- import { getLenderAssets } from "../../../utils";
2
- import { getCompoundV3BaseAsset, getCompoundV3CometAddress, getCompoundV3CometRewardsAddress } from "./addresses";
1
+ import { getLenderAssets } from '../../../utils';
2
+ import { getCompoundV3BaseAsset, getCompoundV3CometAddress, getCompoundV3CometRewardsAddress, } from '../../addresses/compoundV3';
3
3
  export const buildCompoundV3UserCall = (chainId, lender, account) => {
4
- const baseAsset = getCompoundV3BaseAsset(lender, chainId).baseAsset;
4
+ const baseAsset = getCompoundV3BaseAsset(lender, chainId)?.baseAsset;
5
5
  const cometContractAddress = getCompoundV3CometAddress(chainId, lender);
6
6
  const assets = getLenderAssets(chainId, lender);
7
- const assetsNoBase = assets.filter(a => a !== baseAsset);
7
+ const assetsNoBase = assets.filter((a) => a !== baseAsset);
8
8
  const baseCalls = [
9
9
  {
10
10
  address: cometContractAddress,
@@ -15,7 +15,7 @@ export const buildCompoundV3UserCall = (chainId, lender, account) => {
15
15
  address: cometContractAddress,
16
16
  name: 'borrowBalanceOf',
17
17
  params: [account],
18
- }
18
+ },
19
19
  ];
20
20
  const callsNonBase = assetsNoBase.map((tk) => {
21
21
  return {
@@ -29,10 +29,6 @@ export const buildCompoundV3UserCall = (chainId, lender, account) => {
29
29
  name: 'getRewardOwed',
30
30
  params: [cometContractAddress, account],
31
31
  };
32
- const calls = [
33
- ...callsNonBase,
34
- ...baseCalls,
35
- callEarnedBalances
36
- ];
32
+ const calls = [...callsNonBase, ...baseCalls, callEarnedBalances];
37
33
  return calls;
38
34
  };
@@ -1,11 +1,11 @@
1
1
  import { getAssetMeta, getCompoundV3Assets, toGenericPriceKey, toOracleKey, } from '../../../assets';
2
- import { getCompoundV3BaseAsset } from './addresses';
2
+ import { getCompoundV3BaseAsset } from '../../addresses/compoundV3';
3
3
  import { parseRawAmount } from '../../../utils/parsing';
4
4
  import { Asset as SupportedAssets } from '@1delta/asset-registry';
5
5
  import { createBaseTypeUserState } from '../utils';
6
6
  export const getCompoundV3UserDataConverter = (lender, chainId, account, prices, pricesHist, lenderData) => {
7
7
  const assetAddresses = getCompoundV3Assets(chainId, lender);
8
- const baseAsset = getCompoundV3BaseAsset(lender, chainId).baseAsset;
8
+ const baseAsset = getCompoundV3BaseAsset(lender, chainId)?.baseAsset;
9
9
  const assetsNoBase = assetAddresses.filter((a) => a !== baseAsset);
10
10
  const expectedNumberOfCalls = assetsNoBase.length + 2 + 1;
11
11
  return [
@@ -1 +1 @@
1
- {"version":3,"file":"fetchUserData.d.ts","sourceRoot":"","sources":["../../../src/lending/user-data/fetchUserData.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAuB,MAAM,SAAS,CAAA;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AA6FlD;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,GAClC,SAAS,MAAM,EACf,YAAY,eAAe,EAAE,EAC7B,cAAc,oBAAoB,KACjC,OAAO,CAAC,GAAG,EAAE,CA4Bf,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B,GACtC,SAAS,MAAM,EACf,YAAY,eAAe,EAAE,EAC7B,YAAY,GAAG,EAAE,EACjB,QAAQ,GAAG,EACX,YAAY,GAAG,EACf,aAAa,GAAG,KACf;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAA;CAuCzB,CAAA"}
1
+ {"version":3,"file":"fetchUserData.d.ts","sourceRoot":"","sources":["../../../src/lending/user-data/fetchUserData.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAuB,MAAM,SAAS,CAAA;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AA6FlD;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,GAClC,SAAS,MAAM,EACf,YAAY,eAAe,EAAE,EAC7B,cAAc,oBAAoB,KACjC,OAAO,CAAC,GAAG,EAAE,CA4Bf,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B,GACtC,SAAS,MAAM,EACf,YAAY,eAAe,EAAE,EAC7B,YAAY,GAAG,EAAE,EACjB,QAAQ,GAAG,EACX,YAAY,GAAG,EACf,aAAa,GAAG,KACf;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAA;CAsCzB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"userCallBuild.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/morpho/userCallBuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAyB,MAAM,wBAAwB,CAAA;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAkC/C,eAAO,MAAM,mBAAmB,GAC9B,SAAS,MAAM,EACf,SAAS,MAAM,EACf,QAAQ,MAAM,EACd,gBAAgB,MAAM,EAAE,KACvB,IAAI,EAIN,CAAA;AAED,eAAO,MAAM,2BAA2B,GACtC,SAAS,MAAM,EACf,SAAS,MAAM,EACf,QAAQ,MAAM,EACd,gBAAgB,MAAM,EAAE,KACvB,IAAI,EAaN,CAAA"}
1
+ {"version":3,"file":"userCallBuild.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/morpho/userCallBuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAyB,MAAM,wBAAwB,CAAA;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAmC/C,eAAO,MAAM,mBAAmB,GAC9B,SAAS,MAAM,EACf,SAAS,MAAM,EACf,QAAQ,MAAM,EACd,gBAAgB,MAAM,EAAE,KACvB,IAAI,EAIN,CAAA;AAED,eAAO,MAAM,2BAA2B,GACtC,SAAS,MAAM,EACf,SAAS,MAAM,EACf,QAAQ,MAAM,EACd,gBAAgB,MAAM,EAAE,KACvB,IAAI,EAaN,CAAA"}
@@ -7,6 +7,7 @@ const MORPHO_LENS = {
7
7
  [Chain.ARBITRUM_ONE]: '0xF64F862Fb7D687411585e06C08711B612e156530',
8
8
  [Chain.KATANA]: '0xcB6Eb8df68153cebF60E1872273Ef52075a5C297',
9
9
  [Chain.HYPEREVM]: '0xCe434378adacC51d54312c872113D687Ac19B516',
10
+ [Chain.ETHEREUM_MAINNET]: '0x0bd7473CbBf81d9dD936c61117eD230d95006CA2',
10
11
  };
11
12
  const getBaseMorphoCalls = (lender, chainId, account, marketsToQuery) => {
12
13
  return marketsToQuery.flatMap((id) => [
@@ -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;AA+CpD,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,CA+EP,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;AA+CpD,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,CAuFP,CAAA"}
@@ -49,6 +49,13 @@ export const getMorphoUserDataConverterWithlens = (lender, chainId, account, mar
49
49
  if (data.length !== expectedNumberOfCalls) {
50
50
  return undefined;
51
51
  }
52
+ // we map the index from the return data
53
+ // to the real chunk
54
+ // it is
55
+ // (chunk number) * (chunksize = 100) + index
56
+ function mapMarketToChunk(i, c) {
57
+ return (c + 1) * 100 + i;
58
+ }
52
59
  let marketsHandled = [];
53
60
  // de-chunk the calldata
54
61
  const returnDatas = data.flatMap((d) => decodePackedDataset(d));
@@ -57,7 +64,7 @@ export const getMorphoUserDataConverterWithlens = (lender, chainId, account, mar
57
64
  let totalDebt24h = 0;
58
65
  let totalDeposits24h = 0;
59
66
  const balanceData = returnDatas[i];
60
- const markeId = markets[balanceData.index];
67
+ const markeId = markets[mapMarketToChunk(balanceData.index, i)];
61
68
  marketsHandled.push(markeId);
62
69
  const market = lenderData[markeId]?.params?.market;
63
70
  const { dataForMarket, addedDebt, addedDeposits } = createMorphoEntryFromMarketWithLens(balanceData, chainId, market, prices, pricesHist);
@@ -93,6 +93,12 @@ export declare const AAVE_STYLE_ORACLES: {
93
93
  HYPERYIELD: {
94
94
  '999': string;
95
95
  };
96
+ RADIANT_V2: {
97
+ '1': string;
98
+ '56': string;
99
+ '8453': string;
100
+ '42161': string;
101
+ };
96
102
  AVALON_SOLVBTC: {
97
103
  '1': string;
98
104
  '56': string;
@@ -1 +1 @@
1
- {"version":3,"file":"aaveOracles.d.ts","sourceRoot":"","sources":["../../../../src/prices/main-prices/addresses/aaveOracles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoS9B,CAAA"}
1
+ {"version":3,"file":"aaveOracles.d.ts","sourceRoot":"","sources":["../../../../src/prices/main-prices/addresses/aaveOracles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0S9B,CAAA"}
@@ -93,6 +93,12 @@ export const AAVE_STYLE_ORACLES = {
93
93
  HYPERYIELD: {
94
94
  '999': '0x2a740743Fc385197a71f0d1773E419715B88D734',
95
95
  },
96
+ RADIANT_V2: {
97
+ '1': '0xbD60293fBe4B285402510562A64E5fCEE9c4a8F9',
98
+ '56': '0x0BB5c1Bc173b207cBf47CDf013617087776F3782',
99
+ '8453': '0xe373749cd9b2D379f7f6Dd595e5164498b922164',
100
+ '42161': '0xC0cE5De939aaD880b0bdDcf9aB5750a53EDa454b',
101
+ },
96
102
  AVALON_SOLVBTC: {
97
103
  '1': '0x7db0217b628240f583fA8Cb01fb98B79B80e99F1',
98
104
  '56': '0xC204f75f22Ec427869aBf80b1b8Cf98e028f7Fc1',
@@ -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;CAsrC5D,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;CAq9E5D,CAAA"}