From 5984321aaaad1a4d95f204e44aca59f8d47bc617 Mon Sep 17 00:00:00 2001 From: hoomp3 Date: Mon, 6 Jan 2025 06:26:52 -0500 Subject: [PATCH] Add Omega (#12960) Co-authored-by: g1nt0ki <99907941+g1nt0ki@users.noreply.github.com> --- projects/helper/coreAssets.json | 10 ++++- projects/omega/index.js | 74 +++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 projects/omega/index.js diff --git a/projects/helper/coreAssets.json b/projects/helper/coreAssets.json index c8ab89f2f6..caf3334767 100644 --- a/projects/helper/coreAssets.json +++ b/projects/helper/coreAssets.json @@ -1491,7 +1491,13 @@ "WMNT": "0x78c1b0c915c4faa5fffa6cabf0219da63d7f4cb8", "WETH": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead1111", "USDT": "0x201eba5cc46d216ce6dc03f6a759e8e766e956ae", - "USDC": "0x09Bc4E0D864854c6aFB6eB9A9cdF58aC190D0dF9" + "USDC": "0x09Bc4E0D864854c6aFB6eB9A9cdF58aC190D0dF9", + "cmETH": "0xE6829d9a7eE3040e1276Fa75293Bde931859e8fA", + "mETH": "0xcDA86A272531e8640cD7F1a92c01839911B90bb0", + "FBTC": "0xC96dE26018A54D51c097160568752c4E3BD6C364", + "AUSD": "0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a", + "USDe": "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34", + "sUSDe": "0x211Cc4DD073734dA055fbF44a2b4667d5E5fE5d2" }, "linea": { "WETH": "0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f", @@ -2117,4 +2123,4 @@ "crossfi": { "WXFI" : "0xC537D12bd626B135B251cCa43283EFF69eC109c4" } -} +} \ No newline at end of file diff --git a/projects/omega/index.js b/projects/omega/index.js new file mode 100644 index 0000000000..7c44ac0719 --- /dev/null +++ b/projects/omega/index.js @@ -0,0 +1,74 @@ +const ADDRESSES = require("../helper/coreAssets.json"); +const { sumTokens2 } = require("../helper/unwrapLPs"); + +const CONTRACTS = [ + { + asset: ADDRESSES.mantle.mETH, + lendingPool: "0x68F108F6bDbe14b77f5d042b1b43bb36c60F8580", + collateralManager: "0xb092b9543B2C18D0857C3e81fACAE8c0CC08e079", + }, + { + asset: ADDRESSES.mantle.cmETH, + lendingPool: "0x0819EC86Bf7278547B6962392f49Fa0e88A04b7b", + collateralManager: "0xd2698b234b23966258578e0539a5d5aAb8d49893", + }, + { + asset: ADDRESSES.mantle.WETH, + lendingPool: "0x1B69264CA6E951B14db2Cf330dE2744524A22040", + collateralManager: "0x911A9E6b1C1FA4A8CEc88153c4C841f579899308", + }, + { + asset: ADDRESSES.mantle.WMNT, + lendingPool: "0xA49C0FA50768c4560feD129e90D3734a12711E8A", + collateralManager: "0x5181F0Ed157CA00ab3D899e131D424d456884078", + }, + { + asset: ADDRESSES.mantle.USDT, + lendingPool: "0x5dad97d4973B60870AAe284eF3EC6d74Bffc011D", + collateralManager: "0x709a5B78980b17E7f7C20b59f5a3e4E744e4590f", + }, + { + asset: ADDRESSES.mantle.USDe, + lendingPool: "0xa803861Ae852Cb34A4fD8F1b756C0cE3b29A2928", + collateralManager: "0x382c41175ebC9c906Fb52148AFFD7aFB5158ECcf", + }, + { + asset: ADDRESSES.mantle.AUSD, + lendingPool: "0x55A31051066bA19b765f2B8D49FE68367C2094ef", + collateralManager: "0x99845253B0d208f977f14756Fa5C93B73ca73CA6", + }, + { + asset: ADDRESSES.mantle.sUSDe, + lendingPool: "0x768f82Ca2055A7068FeA33f22b5a3cC8681598Ef", + collateralManager: "0xa7C81aA29409Fd2a4D26b3ea4529a4413dc6a352", + }, + { + asset: ADDRESSES.mantle.FBTC, + lendingPool: "0x72c7d27320e042417506e594697324dB5Fbf334C", + collateralManager: "0x0e27103CD0002ED9694E8865BEfd6e2167132BA9", + }, +]; + +async function tvl(api) { + const lendingPoolTvls = await api.multiCall({ + abi: "uint256:getTotalSupply", + calls: CONTRACTS.map((contract) => contract.lendingPool), + }); + + for (const [index, lendingPoolTvl] of lendingPoolTvls.entries()) { + api.add(CONTRACTS[index].asset, lendingPoolTvl); + } + + await sumTokens2({ + api, + tokensAndOwners: [ + ...CONTRACTS.map((contract) => [contract.asset, contract.collateralManager,]), + ], + }); +} + +module.exports = { + mantle: { + tvl, + }, +};