File tree Expand file tree Collapse file tree 3 files changed +51
-1
lines changed Expand file tree Collapse file tree 3 files changed +51
-1
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "version" : " 0.1.0" ,
3+ "name" : " aggrelend" ,
4+ "instructions" : [],
5+ "accounts" : [
6+ {
7+ "name" : " PoolVault" ,
8+ "type" : {
9+ "kind" : " struct" ,
10+ "fields" : [
11+ {"name" : " vault" , "type" : " publicKey" },
12+ {"name" : " tokenMint" , "type" : " publicKey" },
13+ {"name" : " depositTokens" , "type" : " u64" },
14+ {"name" : " scaledShares" , "type" : " u128" },
15+ {"name" : " lastAccruedTime" , "type" : " i64" },
16+ {"name" : " cumulativeYieldIndex" , "type" : " u128" },
17+ {"name" : " hasMarket" , "type" : {"array" : [" bool" , 45 ]}},
18+ {"name" : " rewards" , "type" : " u64" },
19+ {"name" : " boost" , "type" : " bool" },
20+ {"name" : " bump" , "type" : " u8" }
21+ ]
22+ }
23+ }
24+ ],
25+ "events" : [],
26+ "errors" : [],
27+ "types" : []
28+ }
Original file line number Diff line number Diff line change 1+ const { getProvider } = require ( '../helper/solana' )
2+ const { Program } = require ( '@project-serum/anchor' )
3+ const idl = require ( './idl.json' )
4+
5+ const PROGRAM_ID = 'AGGREbma2Gi9unS1mPptAcG4HmkMTLNmqcunYaSSf46b'
6+
7+ const tvl = async ( api ) => {
8+ const provider = getProvider ( )
9+ const program = new Program ( idl , PROGRAM_ID , provider )
10+
11+ const vaults = await program . account . poolVault . all ( )
12+
13+ for ( const { account : pool } of vaults )
14+ api . add ( pool . tokenMint . toBase58 ( ) , pool . depositTokens . toString ( ) )
15+ }
16+
17+ module . exports = {
18+ methodology : 'Sum of all assets deposited into the AggreLend protocol for yield aggregation.' ,
19+ doublecounted : true ,
20+ timetravel : false ,
21+ solana : { tvl } ,
22+ }
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ idl.errors = []
1010
1111const whitelistedTypes = new Set ( )
1212const typeMap = { }
13- idl . types . forEach ( t => typeMap [ t . name ] = t )
13+ idl . types ? .forEach ( t => typeMap [ t . name ] = t )
1414const whitelistedTypeMap = { }
1515const accountMap = { }
1616idl . accounts . forEach ( a => accountMap [ a . name ] = a )
You can’t perform that action at this time.
0 commit comments