@defisaver/positions-sdk 0.0.122 → 0.0.124

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.
@@ -1,5 +1,5 @@
1
1
  import Web3 from 'web3';
2
- import { CompoundMarketData, CompoundV3AssetsData, CompoundV3MarketsData, CompoundV3PositionData } from '../types/compound';
2
+ import { CompoundMarketData, CompoundV3AssetsData, CompoundV3MarketsData, CompoundV3PositionData } from '../types';
3
3
  import { Blockish, EthAddress, NetworkNumber, PositionBalances } from '../types/common';
4
4
  export declare const getCompoundV3MarketsData: (web3: Web3, network: NetworkNumber, selectedMarket: CompoundMarketData, defaultWeb3: Web3) => Promise<CompoundV3MarketsData>;
5
5
  export declare const EMPTY_COMPOUND_V3_DATA: {
@@ -24,6 +24,7 @@ const moneymarket_1 = require("../moneymarket");
24
24
  const compoundHelpers_1 = require("../helpers/compoundHelpers");
25
25
  const compound_1 = require("../markets/compound");
26
26
  const priceService_1 = require("../services/priceService");
27
+ const getSupportedAssetsAddressesForMarket = (selectedMarket, network) => selectedMarket.collAssets.map(asset => (0, tokens_1.getAssetInfo)((0, utils_1.ethToWeth)(asset), network)).map(addr => addr.address.toLowerCase());
27
28
  const getCompoundV3MarketsData = (web3, network, selectedMarket, defaultWeb3) => __awaiter(void 0, void 0, void 0, function* () {
28
29
  const baseAssetPrice = selectedMarket.baseAsset === 'ETH' ? yield (0, priceService_1.getEthPrice)(defaultWeb3) : yield (0, priceService_1.getUSDCPrice)(defaultWeb3);
29
30
  const compPrice = yield (0, priceService_1.getCompPrice)(defaultWeb3);
@@ -42,7 +43,10 @@ const getCompoundV3MarketsData = (web3, network, selectedMarket, defaultWeb3) =>
42
43
  },
43
44
  ];
44
45
  const data = yield (0, multicall_1.multicall)(calls, web3, network);
45
- const colls = data[1].colls.map((coll) => (0, compoundHelpers_1.formatMarketData)(coll, network, baseAssetPrice));
46
+ const supportedAssetsAddresses = getSupportedAssetsAddressesForMarket(selectedMarket, network);
47
+ const colls = data[1].colls
48
+ .filter((coll) => supportedAssetsAddresses.includes(coll.tokenAddr.toLowerCase()))
49
+ .map((coll) => (0, compoundHelpers_1.formatMarketData)(coll, network, baseAssetPrice));
46
50
  for (const coll of colls) {
47
51
  if (coll.symbol === 'wstETH') {
48
52
  // eslint-disable-next-line no-await-in-loop
@@ -180,7 +184,11 @@ const getCompoundV3AccountData = (web3, network, address, proxyAddress, extracte
180
184
  usedAssets[baseAssetSymbol].borrowedUsd = (0, tokens_1.assetAmountInEth)(loanData.borrowValue, baseAssetInfo.symbol);
181
185
  }
182
186
  }
187
+ const supportedAssetsAddresses = getSupportedAssetsAddressesForMarket(selectedMarket, network);
183
188
  loanData.collAddr.forEach((coll, i) => {
189
+ // not filtering collAddr because there is no way of knowing how to filter loanData.collAmounts
190
+ if (!supportedAssetsAddresses.includes(coll.toLowerCase()))
191
+ return;
184
192
  const assetInfo = (0, tokens_1.getAssetInfoByAddress)(coll, network);
185
193
  const symbol = (0, utils_1.wethToEth)(assetInfo.symbol);
186
194
  const supplied = (0, tokens_1.assetAmountInEth)(loanData.collAmounts[i].toString(), symbol);
@@ -2375,6 +2375,9 @@ export namespace cETHv3 {
2375
2375
  "1": {
2376
2376
  address: string;
2377
2377
  };
2378
+ "10": {
2379
+ address: string;
2380
+ };
2378
2381
  "8453": {
2379
2382
  address: string;
2380
2383
  };
@@ -353,6 +353,9 @@ module.exports = {
353
353
  "1": {
354
354
  "address": "0xa17581a9e3356d9a858b789d68b4d866e593ae94"
355
355
  },
356
+ "10": {
357
+ "address": "0xE36A30D249f7761327fd973001A32010b521b6Fd"
358
+ },
356
359
  "8453": {
357
360
  "address": "0x46e6b214b524310239732D51387075E0e70970bf"
358
361
  },
@@ -102,7 +102,7 @@ const COMPOUND_V3_USDCe = (networkId) => ({
102
102
  });
103
103
  exports.COMPOUND_V3_USDCe = COMPOUND_V3_USDCe;
104
104
  const COMPOUND_V3_ETH = (networkId) => ({
105
- chainIds: [common_1.NetworkNumber.Eth, common_1.NetworkNumber.Base, common_1.NetworkNumber.Arb],
105
+ chainIds: [common_1.NetworkNumber.Eth, common_1.NetworkNumber.Base, common_1.NetworkNumber.Arb, common_1.NetworkNumber.Opt],
106
106
  label: 'Compound V3 - ETH',
107
107
  shortLabel: 'v3',
108
108
  value: types_1.CompoundVersions.CompoundV3ETH,
@@ -19,9 +19,10 @@ export declare const v3USDCeCollAssets: {
19
19
  export declare const v3ETHCollAssetsEth: string[];
20
20
  export declare const v3ETHCollAssetsBase: string[];
21
21
  export declare const v3ETHCollAssetsArb: string[];
22
+ export declare const v3ETHCollAssetsOpt: string[];
22
23
  export declare const v3ETHCollAssets: {
23
24
  readonly 1: string[];
24
- readonly 10: readonly [];
25
+ readonly 10: string[];
25
26
  readonly 42161: string[];
26
27
  readonly 8453: string[];
27
28
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.v3USDTCollAssets = exports.v3USDTCollAssetsOpt = exports.v3USDTCollAssetsArb = exports.v3USDTCollAssetsEth = exports.v3USDbCCollAssets = exports.v3USDbCCollAssetsBase = exports.v3ETHCollAssets = exports.v3ETHCollAssetsArb = exports.v3ETHCollAssetsBase = exports.v3ETHCollAssetsEth = exports.v3USDCeCollAssets = exports.v3USDCeCollAssetsArb = exports.v3USDCCollAssets = exports.v3USDCCollAssetsOpt = exports.v3USDCCollAssetsBase = exports.v3USDCCollAssetsArb = exports.v3USDCCollAssetsEth = exports.compoundV2CollateralAssets = void 0;
3
+ exports.v3USDTCollAssets = exports.v3USDTCollAssetsOpt = exports.v3USDTCollAssetsArb = exports.v3USDTCollAssetsEth = exports.v3USDbCCollAssets = exports.v3USDbCCollAssetsBase = exports.v3ETHCollAssets = exports.v3ETHCollAssetsOpt = exports.v3ETHCollAssetsArb = exports.v3ETHCollAssetsBase = exports.v3ETHCollAssetsEth = exports.v3USDCeCollAssets = exports.v3USDCeCollAssetsArb = exports.v3USDCCollAssets = exports.v3USDCCollAssetsOpt = exports.v3USDCCollAssetsBase = exports.v3USDCCollAssetsArb = exports.v3USDCCollAssetsEth = exports.compoundV2CollateralAssets = void 0;
4
4
  const tokens_1 = require("@defisaver/tokens");
5
5
  const common_1 = require("../../types/common");
6
6
  exports.compoundV2CollateralAssets = [
@@ -9,8 +9,8 @@ exports.compoundV2CollateralAssets = [
9
9
  ].map((symbol) => (0, tokens_1.getAssetInfo)(symbol));
10
10
  exports.v3USDCCollAssetsEth = ['COMP', 'WBTC', 'ETH', 'UNI', 'LINK', 'wstETH'];
11
11
  exports.v3USDCCollAssetsArb = ['ARB', 'ETH', 'GMX', 'WBTC', 'wstETH'];
12
- exports.v3USDCCollAssetsBase = ['ETH', 'cbETH'];
13
- exports.v3USDCCollAssetsOpt = ['ETH', 'OP', 'WBTC'];
12
+ exports.v3USDCCollAssetsBase = ['ETH', 'cbETH', 'wstETH'];
13
+ exports.v3USDCCollAssetsOpt = ['ETH', 'OP', 'WBTC', 'wstETH'];
14
14
  // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
15
15
  exports.v3USDCCollAssets = {
16
16
  [common_1.NetworkNumber.Eth]: exports.v3USDCCollAssetsEth,
@@ -28,11 +28,12 @@ exports.v3USDCeCollAssets = {
28
28
  };
29
29
  exports.v3ETHCollAssetsEth = ['cbETH', 'wstETH', 'rETH', 'rsETH', 'weETH', 'osETH', 'WBTC', 'ezETH'];
30
30
  exports.v3ETHCollAssetsBase = ['cbETH', 'ezETH'];
31
- exports.v3ETHCollAssetsArb = ['weETH', 'rETH', 'wstETH', 'WBTC'];
31
+ exports.v3ETHCollAssetsArb = ['weETH', 'rETH', 'wstETH', 'WBTC', 'rsETH'];
32
+ exports.v3ETHCollAssetsOpt = ['rETH', 'wstETH', 'WBTC'];
32
33
  // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
33
34
  exports.v3ETHCollAssets = {
34
35
  [common_1.NetworkNumber.Eth]: exports.v3ETHCollAssetsEth,
35
- [common_1.NetworkNumber.Opt]: [],
36
+ [common_1.NetworkNumber.Opt]: exports.v3ETHCollAssetsOpt,
36
37
  [common_1.NetworkNumber.Arb]: exports.v3ETHCollAssetsArb,
37
38
  [common_1.NetworkNumber.Base]: exports.v3ETHCollAssetsBase,
38
39
  };
@@ -46,7 +47,7 @@ exports.v3USDbCCollAssets = {
46
47
  };
47
48
  exports.v3USDTCollAssetsEth = ['ETH', 'WBTC', 'wstETH', 'COMP', 'UNI', 'LINK'];
48
49
  exports.v3USDTCollAssetsArb = ['ETH', 'WBTC', 'wstETH', 'ARB', 'GMX'];
49
- exports.v3USDTCollAssetsOpt = ['ETH', 'WBTC', 'OP'];
50
+ exports.v3USDTCollAssetsOpt = ['ETH', 'WBTC', 'OP', 'wstETH'];
50
51
  // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
51
52
  exports.v3USDTCollAssets = {
52
53
  [common_1.NetworkNumber.Eth]: exports.v3USDTCollAssetsEth,
@@ -1,5 +1,5 @@
1
1
  import Web3 from 'web3';
2
- import { CompoundMarketData, CompoundV3AssetsData, CompoundV3MarketsData, CompoundV3PositionData } from '../types/compound';
2
+ import { CompoundMarketData, CompoundV3AssetsData, CompoundV3MarketsData, CompoundV3PositionData } from '../types';
3
3
  import { Blockish, EthAddress, NetworkNumber, PositionBalances } from '../types/common';
4
4
  export declare const getCompoundV3MarketsData: (web3: Web3, network: NetworkNumber, selectedMarket: CompoundMarketData, defaultWeb3: Web3) => Promise<CompoundV3MarketsData>;
5
5
  export declare const EMPTY_COMPOUND_V3_DATA: {
@@ -12,12 +12,13 @@ import { assetAmountInEth, assetAmountInWei, getAssetInfo, getAssetInfoByAddress
12
12
  import { CompV3ViewContract } from '../contracts';
13
13
  import { multicall } from '../multicall';
14
14
  import { getStakingApy, getStETHByWstETHMultiple, getWstETHByStETH, STAKING_ASSETS, } from '../staking';
15
- import { wethToEth } from '../services/utils';
15
+ import { ethToWeth, wethToEth } from '../services/utils';
16
16
  import { ZERO_ADDRESS } from '../constants';
17
17
  import { calculateBorrowingAssetLimit } from '../moneymarket';
18
18
  import { formatBaseData, formatMarketData, getCompoundV3AggregatedData, getIncentiveApys, } from '../helpers/compoundHelpers';
19
19
  import { COMPOUND_V3_ETH, COMPOUND_V3_USDBC, COMPOUND_V3_USDC } from '../markets/compound';
20
20
  import { getEthPrice, getCompPrice, getUSDCPrice } from '../services/priceService';
21
+ const getSupportedAssetsAddressesForMarket = (selectedMarket, network) => selectedMarket.collAssets.map(asset => getAssetInfo(ethToWeth(asset), network)).map(addr => addr.address.toLowerCase());
21
22
  export const getCompoundV3MarketsData = (web3, network, selectedMarket, defaultWeb3) => __awaiter(void 0, void 0, void 0, function* () {
22
23
  const baseAssetPrice = selectedMarket.baseAsset === 'ETH' ? yield getEthPrice(defaultWeb3) : yield getUSDCPrice(defaultWeb3);
23
24
  const compPrice = yield getCompPrice(defaultWeb3);
@@ -36,7 +37,10 @@ export const getCompoundV3MarketsData = (web3, network, selectedMarket, defaultW
36
37
  },
37
38
  ];
38
39
  const data = yield multicall(calls, web3, network);
39
- const colls = data[1].colls.map((coll) => formatMarketData(coll, network, baseAssetPrice));
40
+ const supportedAssetsAddresses = getSupportedAssetsAddressesForMarket(selectedMarket, network);
41
+ const colls = data[1].colls
42
+ .filter((coll) => supportedAssetsAddresses.includes(coll.tokenAddr.toLowerCase()))
43
+ .map((coll) => formatMarketData(coll, network, baseAssetPrice));
40
44
  for (const coll of colls) {
41
45
  if (coll.symbol === 'wstETH') {
42
46
  // eslint-disable-next-line no-await-in-loop
@@ -172,7 +176,11 @@ export const getCompoundV3AccountData = (web3, network, address, proxyAddress, e
172
176
  usedAssets[baseAssetSymbol].borrowedUsd = assetAmountInEth(loanData.borrowValue, baseAssetInfo.symbol);
173
177
  }
174
178
  }
179
+ const supportedAssetsAddresses = getSupportedAssetsAddressesForMarket(selectedMarket, network);
175
180
  loanData.collAddr.forEach((coll, i) => {
181
+ // not filtering collAddr because there is no way of knowing how to filter loanData.collAmounts
182
+ if (!supportedAssetsAddresses.includes(coll.toLowerCase()))
183
+ return;
176
184
  const assetInfo = getAssetInfoByAddress(coll, network);
177
185
  const symbol = wethToEth(assetInfo.symbol);
178
186
  const supplied = assetAmountInEth(loanData.collAmounts[i].toString(), symbol);
@@ -2375,6 +2375,9 @@ export namespace cETHv3 {
2375
2375
  "1": {
2376
2376
  address: string;
2377
2377
  };
2378
+ "10": {
2379
+ address: string;
2380
+ };
2378
2381
  "8453": {
2379
2382
  address: string;
2380
2383
  };
@@ -352,6 +352,9 @@ module.exports = {
352
352
  "1": {
353
353
  "address": "0xa17581a9e3356d9a858b789d68b4d866e593ae94"
354
354
  },
355
+ "10": {
356
+ "address": "0xE36A30D249f7761327fd973001A32010b521b6Fd"
357
+ },
355
358
  "8453": {
356
359
  "address": "0x46e6b214b524310239732D51387075E0e70970bf"
357
360
  },
@@ -92,7 +92,7 @@ export const COMPOUND_V3_USDCe = (networkId) => ({
92
92
  // icon: SvgAdapter(protocolIcons.compoundv3),
93
93
  });
94
94
  export const COMPOUND_V3_ETH = (networkId) => ({
95
- chainIds: [NetworkNumber.Eth, NetworkNumber.Base, NetworkNumber.Arb],
95
+ chainIds: [NetworkNumber.Eth, NetworkNumber.Base, NetworkNumber.Arb, NetworkNumber.Opt],
96
96
  label: 'Compound V3 - ETH',
97
97
  shortLabel: 'v3',
98
98
  value: CompoundVersions.CompoundV3ETH,
@@ -19,9 +19,10 @@ export declare const v3USDCeCollAssets: {
19
19
  export declare const v3ETHCollAssetsEth: string[];
20
20
  export declare const v3ETHCollAssetsBase: string[];
21
21
  export declare const v3ETHCollAssetsArb: string[];
22
+ export declare const v3ETHCollAssetsOpt: string[];
22
23
  export declare const v3ETHCollAssets: {
23
24
  readonly 1: string[];
24
- readonly 10: readonly [];
25
+ readonly 10: string[];
25
26
  readonly 42161: string[];
26
27
  readonly 8453: string[];
27
28
  };
@@ -6,8 +6,8 @@ export const compoundV2CollateralAssets = [
6
6
  ].map((symbol) => getAssetInfo(symbol));
7
7
  export const v3USDCCollAssetsEth = ['COMP', 'WBTC', 'ETH', 'UNI', 'LINK', 'wstETH'];
8
8
  export const v3USDCCollAssetsArb = ['ARB', 'ETH', 'GMX', 'WBTC', 'wstETH'];
9
- export const v3USDCCollAssetsBase = ['ETH', 'cbETH'];
10
- export const v3USDCCollAssetsOpt = ['ETH', 'OP', 'WBTC'];
9
+ export const v3USDCCollAssetsBase = ['ETH', 'cbETH', 'wstETH'];
10
+ export const v3USDCCollAssetsOpt = ['ETH', 'OP', 'WBTC', 'wstETH'];
11
11
  // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
12
12
  export const v3USDCCollAssets = {
13
13
  [NetworkNumber.Eth]: v3USDCCollAssetsEth,
@@ -25,11 +25,12 @@ export const v3USDCeCollAssets = {
25
25
  };
26
26
  export const v3ETHCollAssetsEth = ['cbETH', 'wstETH', 'rETH', 'rsETH', 'weETH', 'osETH', 'WBTC', 'ezETH'];
27
27
  export const v3ETHCollAssetsBase = ['cbETH', 'ezETH'];
28
- export const v3ETHCollAssetsArb = ['weETH', 'rETH', 'wstETH', 'WBTC'];
28
+ export const v3ETHCollAssetsArb = ['weETH', 'rETH', 'wstETH', 'WBTC', 'rsETH'];
29
+ export const v3ETHCollAssetsOpt = ['rETH', 'wstETH', 'WBTC'];
29
30
  // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
30
31
  export const v3ETHCollAssets = {
31
32
  [NetworkNumber.Eth]: v3ETHCollAssetsEth,
32
- [NetworkNumber.Opt]: [],
33
+ [NetworkNumber.Opt]: v3ETHCollAssetsOpt,
33
34
  [NetworkNumber.Arb]: v3ETHCollAssetsArb,
34
35
  [NetworkNumber.Base]: v3ETHCollAssetsBase,
35
36
  };
@@ -43,7 +44,7 @@ export const v3USDbCCollAssets = {
43
44
  };
44
45
  export const v3USDTCollAssetsEth = ['ETH', 'WBTC', 'wstETH', 'COMP', 'UNI', 'LINK'];
45
46
  export const v3USDTCollAssetsArb = ['ETH', 'WBTC', 'wstETH', 'ARB', 'GMX'];
46
- export const v3USDTCollAssetsOpt = ['ETH', 'WBTC', 'OP'];
47
+ export const v3USDTCollAssetsOpt = ['ETH', 'WBTC', 'OP', 'wstETH'];
47
48
  // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
48
49
  export const v3USDTCollAssets = {
49
50
  [NetworkNumber.Eth]: v3USDTCollAssetsEth,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/positions-sdk",
3
- "version": "0.0.122",
3
+ "version": "0.0.124",
4
4
  "description": "",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
@@ -20,7 +20,7 @@
20
20
  "author": "",
21
21
  "license": "ISC",
22
22
  "dependencies": {
23
- "@defisaver/tokens": "^1.5.30",
23
+ "@defisaver/tokens": "^1.5.31",
24
24
  "@ethersproject/bignumber": "^5.7.0",
25
25
  "@morpho-org/morpho-aave-v3-sdk": "^1.5.3",
26
26
  "decimal.js": "^10.4.3"
@@ -6,15 +6,15 @@ import {
6
6
  import { CompV3ViewContract } from '../contracts';
7
7
  import { multicall } from '../multicall';
8
8
  import {
9
- CompoundV3AssetData, CompoundMarketData, CompoundV3AssetsData, CompoundV3UsedAssets, CompoundV3MarketsData, CompoundV3PositionData, CompoundVersions,
10
- } from '../types/compound';
9
+ CompoundV3AssetData, CompoundMarketData, CompoundV3AssetsData, CompoundV3UsedAssets, CompoundV3MarketsData, CompoundV3PositionData,
10
+ } from '../types';
11
11
  import {
12
12
  Blockish, EthAddress, NetworkNumber, PositionBalances,
13
13
  } from '../types/common';
14
14
  import {
15
15
  getStakingApy, getStETHByWstETHMultiple, getWstETHByStETH, STAKING_ASSETS,
16
16
  } from '../staking';
17
- import { wethToEth } from '../services/utils';
17
+ import { ethToWeth, wethToEth } from '../services/utils';
18
18
  import { ZERO_ADDRESS } from '../constants';
19
19
  import { calculateBorrowingAssetLimit } from '../moneymarket';
20
20
  import {
@@ -23,6 +23,8 @@ import {
23
23
  import { COMPOUND_V3_ETH, COMPOUND_V3_USDBC, COMPOUND_V3_USDC } from '../markets/compound';
24
24
  import { getEthPrice, getCompPrice, getUSDCPrice } from '../services/priceService';
25
25
 
26
+ const getSupportedAssetsAddressesForMarket = (selectedMarket: CompoundMarketData, network: NetworkNumber) => selectedMarket.collAssets.map(asset => getAssetInfo(ethToWeth(asset), network)).map(addr => addr.address.toLowerCase());
27
+
26
28
  export const getCompoundV3MarketsData = async (web3: Web3, network: NetworkNumber, selectedMarket: CompoundMarketData, defaultWeb3: Web3): Promise<CompoundV3MarketsData> => {
27
29
  const baseAssetPrice = selectedMarket.baseAsset === 'ETH' ? await getEthPrice(defaultWeb3) : await getUSDCPrice(defaultWeb3);
28
30
  const compPrice = await getCompPrice(defaultWeb3);
@@ -41,7 +43,12 @@ export const getCompoundV3MarketsData = async (web3: Web3, network: NetworkNumbe
41
43
  },
42
44
  ];
43
45
  const data = await multicall(calls, web3, network);
44
- const colls = data[1].colls.map((coll: any) => formatMarketData(coll, network, baseAssetPrice)) as CompoundV3AssetData[];
46
+ const supportedAssetsAddresses = getSupportedAssetsAddressesForMarket(selectedMarket, network);
47
+
48
+ const colls = data[1].colls
49
+ .filter((coll: any) => supportedAssetsAddresses.includes(coll.tokenAddr.toLowerCase()))
50
+ .map((coll: any) => formatMarketData(coll, network, baseAssetPrice)) as CompoundV3AssetData[];
51
+
45
52
  for (const coll of colls) {
46
53
  if (coll.symbol === 'wstETH') {
47
54
  // eslint-disable-next-line no-await-in-loop
@@ -219,7 +226,11 @@ export const getCompoundV3AccountData = async (
219
226
  usedAssets[baseAssetSymbol].borrowedUsd = assetAmountInEth(loanData.borrowValue, baseAssetInfo.symbol);
220
227
  }
221
228
  }
229
+ const supportedAssetsAddresses = getSupportedAssetsAddressesForMarket(selectedMarket, network);
230
+
222
231
  loanData.collAddr.forEach((coll: string, i: number): void => {
232
+ // not filtering collAddr because there is no way of knowing how to filter loanData.collAmounts
233
+ if (!supportedAssetsAddresses.includes(coll.toLowerCase())) return;
223
234
  const assetInfo = getAssetInfoByAddress(coll, network);
224
235
  const symbol = wethToEth(assetInfo.symbol);
225
236
  const supplied = assetAmountInEth(loanData.collAmounts[i].toString(), symbol);
@@ -353,6 +353,9 @@ module.exports = {
353
353
  "1": {
354
354
  "address": "0xa17581a9e3356d9a858b789d68b4d866e593ae94"
355
355
  },
356
+ "10": {
357
+ "address": "0xE36A30D249f7761327fd973001A32010b521b6Fd"
358
+ },
356
359
  "8453": {
357
360
  "address": "0x46e6b214b524310239732D51387075E0e70970bf"
358
361
  },
@@ -117,7 +117,7 @@ export const COMPOUND_V3_USDCe = (networkId: NetworkNumber): CompoundMarketData
117
117
  });
118
118
 
119
119
  export const COMPOUND_V3_ETH = (networkId: NetworkNumber): CompoundMarketData => ({
120
- chainIds: [NetworkNumber.Eth, NetworkNumber.Base, NetworkNumber.Arb],
120
+ chainIds: [NetworkNumber.Eth, NetworkNumber.Base, NetworkNumber.Arb, NetworkNumber.Opt],
121
121
  label: 'Compound V3 - ETH',
122
122
  shortLabel: 'v3',
123
123
  value: CompoundVersions.CompoundV3ETH,
@@ -8,8 +8,8 @@ export const compoundV2CollateralAssets = [
8
8
 
9
9
  export const v3USDCCollAssetsEth = ['COMP', 'WBTC', 'ETH', 'UNI', 'LINK', 'wstETH'];
10
10
  export const v3USDCCollAssetsArb = ['ARB', 'ETH', 'GMX', 'WBTC', 'wstETH'];
11
- export const v3USDCCollAssetsBase = ['ETH', 'cbETH'];
12
- export const v3USDCCollAssetsOpt = ['ETH', 'OP', 'WBTC'];
11
+ export const v3USDCCollAssetsBase = ['ETH', 'cbETH', 'wstETH'];
12
+ export const v3USDCCollAssetsOpt = ['ETH', 'OP', 'WBTC', 'wstETH'];
13
13
 
14
14
  // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
15
15
  export const v3USDCCollAssets = {
@@ -31,12 +31,13 @@ export const v3USDCeCollAssets = {
31
31
 
32
32
  export const v3ETHCollAssetsEth = ['cbETH', 'wstETH', 'rETH', 'rsETH', 'weETH', 'osETH', 'WBTC', 'ezETH'];
33
33
  export const v3ETHCollAssetsBase = ['cbETH', 'ezETH'];
34
- export const v3ETHCollAssetsArb = ['weETH', 'rETH', 'wstETH', 'WBTC'];
34
+ export const v3ETHCollAssetsArb = ['weETH', 'rETH', 'wstETH', 'WBTC', 'rsETH'];
35
+ export const v3ETHCollAssetsOpt = ['rETH', 'wstETH', 'WBTC'];
35
36
 
36
37
  // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
37
38
  export const v3ETHCollAssets = {
38
39
  [NetworkNumber.Eth]: v3ETHCollAssetsEth,
39
- [NetworkNumber.Opt]: [],
40
+ [NetworkNumber.Opt]: v3ETHCollAssetsOpt,
40
41
  [NetworkNumber.Arb]: v3ETHCollAssetsArb,
41
42
  [NetworkNumber.Base]: v3ETHCollAssetsBase,
42
43
  } as const;
@@ -53,7 +54,7 @@ export const v3USDbCCollAssets = {
53
54
 
54
55
  export const v3USDTCollAssetsEth = ['ETH', 'WBTC', 'wstETH', 'COMP', 'UNI', 'LINK'];
55
56
  export const v3USDTCollAssetsArb = ['ETH', 'WBTC', 'wstETH', 'ARB', 'GMX'];
56
- export const v3USDTCollAssetsOpt = ['ETH', 'WBTC', 'OP'];
57
+ export const v3USDTCollAssetsOpt = ['ETH', 'WBTC', 'OP', 'wstETH'];
57
58
 
58
59
  // @dev Keep assets in array, do not assign directly, so we can parse it and edit it programmatically with `scripts/updateMarkets`
59
60
  export const v3USDTCollAssets = {