Skip to content

Commit 88221ee

Browse files
authored
lulo tvl adapter with timetravel (DefiLlama#11333)
1 parent 4ecc050 commit 88221ee

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

projects/lulo/index.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
}

0 commit comments

Comments
 (0)