File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ const sdk = require ( '@defillama/sdk' )
2
+
3
+ const endpoint = 'http://api.flexlend.fi/stats'
4
+ const startTimestamp = 1704067200 // 2024-01-01
5
+
6
+ async function tvl ( options ) {
7
+ const balances = { }
8
+ const request = {
9
+ method : 'GET' ,
10
+ headers : {
11
+ accept : 'application/json' ,
12
+ 'x-lulo-api-key' : String ( process . env . LULO_API_KEY || '' ) ,
13
+ } ,
14
+ }
15
+
16
+ const response = await fetch ( `${ endpoint } ?timestamp=${ options . timestamp } ` , request )
17
+
18
+ const { data } = await response . json ( )
19
+
20
+ data . map ( d => {
21
+ sdk . util . sumSingleBalance ( balances , d . mintAddress , d . tokens , 'solana' )
22
+ } )
23
+ return balances
24
+ }
25
+
26
+ module . exports = {
27
+ doublecounted : true ,
28
+ timetravel : true ,
29
+ start : startTimestamp ,
30
+ methodology :
31
+ 'Volume is calculated by summing the total USD value of deposited funds in Lulo across all tokens' ,
32
+ solana : { tvl } ,
33
+ }
You can’t perform that action at this time.
0 commit comments