Skip to content

Commit 2b1b7eb

Browse files
committed
track royco
1 parent a6d9045 commit 2b1b7eb

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

projects/royco/index.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const { getLogs2 } = require('../helper/cache/getLogs')
2+
3+
const config = {
4+
ethereum: { factory: '0xb316D165D01aC68d31B297F847533D671c965662', fromBlock: 21040754 },
5+
arbitrum: { factory: '0xb316D165D01aC68d31B297F847533D671c965662', fromBlock: 267610608 },
6+
base: { factory: '0xb316D165D01aC68d31B297F847533D671c965662', fromBlock: 21548421 },
7+
}
8+
9+
Object.keys(config).forEach(chain => {
10+
const { factory, fromBlock } = config[chain]
11+
module.exports[chain] = {
12+
tvl: async (api) => {
13+
const logs = await getLogs2({ api, factory, eventAbi: 'event WrappedVaultCreated (address indexed underlyingVaultAddress, address indexed incentivizedVaultAddress, address owner, address inputToken, uint256 frontendFee, string name, string vaultSymbol)', fromBlock, })
14+
const tokensAndOwners = logs.map(log => [log.underlyingVaultAddress, log.incentivizedVaultAddress])
15+
return api.sumTokens({ tokensAndOwners })
16+
17+
}
18+
}
19+
})

0 commit comments

Comments
 (0)