diff --git a/projects/sommelier/cellar-constants.js b/projects/sommelier/cellar-constants.js index 59505a4f0504..d6c1f7ccbd05 100644 --- a/projects/sommelier/cellar-constants.js +++ b/projects/sommelier/cellar-constants.js @@ -82,6 +82,12 @@ const arbitrumCellarsV2p5 = [ { id: REAL_YIELD_ETH_ARB, startBlock: 178830458 }, { id: REAL_YIELD_USD_ARB, startBlock: 178141655 }]; + // v2.5 Cellars on Optimism + const REAL_YIELD_ETH_OPT = "0xC47bB288178Ea40bF520a91826a3DEE9e0DbFA4C"; + + const optimismCellarsV2p5 = [ + { id: REAL_YIELD_ETH_OPT, startBlock: + 116609168 }]; module.exports = { @@ -90,5 +96,6 @@ module.exports = { cellarsV2, cellarsV2p5, arbitrumCellarsV2p5, + optimismCellarsV2p5, }; diff --git a/projects/sommelier/index.js b/projects/sommelier/index.js index b4ea71d93543..56b874e11c55 100644 --- a/projects/sommelier/index.js +++ b/projects/sommelier/index.js @@ -7,6 +7,7 @@ const { cellarsV2, cellarsV2p5, arbitrumCellarsV2p5, + optimismCellarsV2p5, } = require("./cellar-constants"); @@ -63,7 +64,22 @@ async function arbitrum_tvl(api) { cellars: arbitrumCellarsV2p5.map((cellar) => cellar.id), ownersToDedupe: arbitrumCellarsV2p5, }); +} + +async function optimism_tvl(api) { + const balances = {}; + const { block } = api + const chainBlocks = { + [api.chain]: block + } + const baseOptions = { balances, chainBlocks }; + await v2.sumTvl({ + ...baseOptions, + api, + cellars: optimismCellarsV2p5.map((cellar) => cellar.id), + ownersToDedupe: optimismCellarsV2p5, + }); return balances; } @@ -80,6 +96,7 @@ module.exports = { start: 1656652494, ["ethereum"]: { tvl: ethereum_tvl }, ["arbitrum"]: { tvl: arbitrum_tvl }, + ["optimism"]: { tvl: optimism_tvl }, hallmarks: [ [1658419200, "aave2 Cellar Launch"], [1674671068, "Real Yield USD Cellar Launch"],