@@ -3,15 +3,36 @@ const { sumTokens2 } = require('../helper/solana')
33const { getObjects } = require ( "../helper/chain/sui" ) ;
44
55const evm_config = {
6- ethereum : { kernelEventEmitter : '0x6984DC28Bf473160805AE0fd580bCcaB77f4bD7C' , fromBlock : 22330649 } ,
7- bsc : { kernelEventEmitter : '0x6984DC28Bf473160805AE0fd580bCcaB77f4bD7C' , fromBlock : 49126003 } ,
8- base : { kernelEventEmitter : '0x3dDe8E4b5120875B1359b283034F9606D0f2F9eC' , fromBlock : 29522359 } ,
9- arbitrum : { kernelEventEmitter : '0x3dDe8E4b5120875B1359b283034F9606D0f2F9eC' , fromBlock : 331057353 } ,
10- hyperliquid : { kernelEventEmitter : '0x5a428F12a55d6E0ABa77Eb5B340f2ff95dE01BF5' , fromBlock : 4470476 } ,
11- plume_mainnet : { kernelEventEmitter : '0x6984DC28Bf473160805AE0fd580bCcaB77f4bD7C' , fromBlock : 4574846 } ,
12- mantle : { kernelEventEmitter : '0xD76515844574A7c3f4521704098082371ACEEeB5' , fromBlock : 80184784 } ,
13- "0g" : { kernelEventEmitter : '0xFBD495862410c549f200Ce224Ad3D02a0bAe260D' , fromBlock : 5961960 } ,
14- monad : { kernelEventEmitter : '0xFBD495862410c549f200Ce224Ad3D02a0bAe260D' , fromBlock : 33372521 } ,
6+ ethereum : [
7+ { kernelEventEmitter : '0x6984DC28Bf473160805AE0fd580bCcaB77f4bD7C' , fromBlock : 22330649 } ,
8+ { kernelEventEmitter : '0xEFfC0fD0CaD5762c360Eb2158500a5537bb4637d' , fromBlock : 22965694 }
9+ ] ,
10+ bsc : [
11+ { kernelEventEmitter : '0x6984DC28Bf473160805AE0fd580bCcaB77f4bD7C' , fromBlock : 49126003 } ,
12+ { kernelEventEmitter : '0xcE9ecebAFE2174FFC9b662FE6cc4610574AB602C' , fromBlock : 54773913 }
13+ ] ,
14+ base : [
15+ { kernelEventEmitter : '0x3dDe8E4b5120875B1359b283034F9606D0f2F9eC' , fromBlock : 29522359 } ,
16+ { kernelEventEmitter : '0x9b69c72B68B7A7E765335831d6234F593f818e6B' , fromBlock : 33144489 }
17+ ] ,
18+ arbitrum : [
19+ { kernelEventEmitter : '0x3dDe8E4b5120875B1359b283034F9606D0f2F9eC' , fromBlock : 331057353 } ,
20+ { kernelEventEmitter : '0xf7b221F8a45a62539a53F20C8D3A5a1edDd1b510' , fromBlock : 359940838 }
21+ ] ,
22+ hyperliquid : [
23+ { kernelEventEmitter : '0x5a428F12a55d6E0ABa77Eb5B340f2ff95dE01BF5' , fromBlock : 4470476 } ,
24+ { kernelEventEmitter : '0x59964b3af53eb10C596B92B3d6aeAfC038B3Bd8d' , fromBlock : 8976860 }
25+ ] ,
26+ plume_mainnet : [
27+ { kernelEventEmitter : '0x6984DC28Bf473160805AE0fd580bCcaB77f4bD7C' , fromBlock : 4574846 } ,
28+ { kernelEventEmitter : '0x1F5C460A8BF18B12fb7218019a1693391A8251a7' , fromBlock : 13309471 }
29+ ] ,
30+ mantle : [
31+ { kernelEventEmitter : '0xD76515844574A7c3f4521704098082371ACEEeB5' , fromBlock : 80184784 } ,
32+ { kernelEventEmitter : '0x802bE72795617ACec443321504150951f85De652' , fromBlock : 82474030 }
33+ ] ,
34+ "0g" : [ { kernelEventEmitter : '0xFBD495862410c549f200Ce224Ad3D02a0bAe260D' , fromBlock : 5961960 } ] ,
35+ monad : [ { kernelEventEmitter : '0xFBD495862410c549f200Ce224Ad3D02a0bAe260D' , fromBlock : 33372521 } ] ,
1536}
1637
1738const svm_config = {
@@ -63,14 +84,15 @@ module.exports = {
6384}
6485
6586const evmTvl = async ( api ) => {
66- const { kernelEventEmitter, fromBlock } = evm_config [ api . chain ]
67- const logs = await getLogs2 ( { api, target : kernelEventEmitter , eventAbi : eventAbis . pool_created , fromBlock, onlyArgs : true } )
68- const balances = await api . multiCall ( { calls : logs . map ( ( [ _ , pool ] ) => ( { target : pool } ) ) , abi : abis . balances_available } )
69- logs . forEach ( ( [ _ , __ , token0 , token1 ] , i ) => {
70- const { amount0, amount1 } = balances [ i ]
71- api . add ( token0 , amount0 )
72- api . add ( token1 , amount1 )
73- } )
87+ for ( const { kernelEventEmitter, fromBlock } of evm_config [ api . chain ] ) {
88+ const logs = await getLogs2 ( { api, target : kernelEventEmitter , eventAbi : eventAbis . pool_created , fromBlock, onlyArgs : true } )
89+ const balances = await api . multiCall ( { calls : logs . map ( ( [ _ , pool ] ) => ( { target : pool } ) ) , abi : abis . balances_available } )
90+ logs . forEach ( ( [ _ , __ , token0 , token1 ] , i ) => {
91+ const { amount0, amount1 } = balances [ i ]
92+ api . add ( token0 , amount0 )
93+ api . add ( token1 , amount1 )
94+ } )
95+ }
7496}
7597
7698Object . keys ( evm_config ) . forEach ( ( chain ) => {
0 commit comments