Skip to content

Commit 8b2b716

Browse files
ekmanssg1nt0ki
andauthored
add roguex (DefiLlama#9149)
* add roguex * code refactor --------- Co-authored-by: g1nt0ki <[email protected]>
1 parent d60009d commit 8b2b716

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

projects/roguex/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const { getLogs } = require('../helper/cache/getLogs')
2+
3+
// const graphUri = "https://api.studio.thegraph.com/query/42478/blast_mainnet/version/latest";
4+
5+
const config = {
6+
blast: { factory: '0x5B0b4b97edb7377888E2c37268c46E28f5BD81d0', fromBlock: 202321, },
7+
}
8+
9+
Object.keys(config).forEach(chain => {
10+
const { factory, fromBlock, } = config[chain]
11+
module.exports[chain] = {
12+
tvl: async (_, _b, _cb, { api, }) => {
13+
const logs = await getLogs({ api, target: factory, eventAbi: 'event PoolCreated (address indexed token0, address indexed token1, uint24 indexed fee, int24 tickSpacing, address pool, address tradePool)', onlyArgs: true, fromBlock, })
14+
const ownerTokens = logs.map(i => [[[i.token0, i.token1], i.pool], [[i.token0, i.token1], i.tradePool]]).flat()
15+
return api.sumTokens({ ownerTokens })
16+
}
17+
}
18+
})

0 commit comments

Comments
 (0)