diff --git a/projects/jones-dao/addresses.js b/projects/jones-dao/addresses.js index 6bcdf633baf2..52d32186879c 100644 --- a/projects/jones-dao/addresses.js +++ b/projects/jones-dao/addresses.js @@ -45,20 +45,20 @@ module.exports = { "0xF46Ce0C13577232D5F29D9Bd78a9Cab278755346", "0x42448fDDCec02124cf6dB19a9f91Dea7bB0e88e5", ], + smartLpArbFactories: [ + "0xFEFd54D82337d3Dacb5DE53083C22BA41ca76CC5", + "0xb385809cCdB2BD87A5Cd32ad09287399F0318a92", + "0xf965734b1750E64D9a01c991C5E630D279C34fd2", + "0xb754D87BdAb6Cc8c903abC2Bda9cE6B3c9481e60", + ], tokens: { - arb: ADDRESSES.arbitrum.ARB, aura: "0xC0c293ce456fF0ED870ADd98a0828Dd4d2903DBF", dpx: "0x6C2C06790b3E3E3c38e12Ee22F8183b37a13EE55", - dpx_eth: "0x0C1Cf6883efA1B496B01f654E247B9b419873054", glp: ADDRESSES.arbitrum.fsGLP, gohm: "0x8D9bA570D6cb60C7e3e0F31343Efe75AB8E65FB1", jones: "0x10393c20975cf177a3513071bc110f7962cd67da", - jglp: "0x7241bC8035b65865156DDb5EdEf3eB32874a3AF6", rdpx: "0x32Eb7902D4134bf98A28b963D26de779AF92A212", - rdpx_eth: "0x7418F5A2621E13c05d1EFBd71ec922070794b90a", usdc: ADDRESSES.arbitrum.USDC_CIRCLE, uvrt: "0xa485a0bc44988B95245D5F20497CCaFF58a73E99", - weth: ADDRESSES.arbitrum.WETH, - wjaura: "0xcB9295ac65De60373A25C18d2044D517ed5da8A9", }, }; diff --git a/projects/jones-dao/index.js b/projects/jones-dao/index.js index 15c9d2157869..fa378a17fef1 100644 --- a/projects/jones-dao/index.js +++ b/projects/jones-dao/index.js @@ -43,6 +43,20 @@ async function tvl(api) { api.addTokens(metavaultTokens, metavaultBalances); api.addTokens(optionVaultTokens, optionVaultBalances); api.addTokens(addresses.tokens.usdc, jusdcTvl.output); + const getLPManagerContractsABI = "function getLPManagerContracts(uint256 _nonce) view returns (address lp,address viewer,address swapper,address receiver,address priceHelper,address lpManager,address doubleTracker,address singleTrackerZero,address singleTrackerOne,address compounder,address router)" + + + for (const factoryAddress of addresses.smartLpArbFactories) { + const contracts = await api.fetchList({ lengthAbi: 'nonce', itemAbi: getLPManagerContractsABI, target: factoryAddress, startFromOne: true }) + const lpManagers = contracts.map(c => c.lpManager) + + const token0s = await api.multiCall({ abi: "address:token0", calls: lpManagers }) + const token1s = await api.multiCall({ abi: "address:token1", calls: lpManagers }) + const aums = await api.multiCall({ abi: "function aum() returns (uint256 amount0, uint256 amount1)", calls: lpManagers }) + + api.add(token0s, aums.map(a => a.amount0)) + api.add(token1s, aums.map(a => a.amount1)) + } const tokensAndOwners = [ [addresses.tokens.uvrt, addresses.glp.stableRewardTracker],