Skip to content

Commit c792417

Browse files
committed
track yeiswap: DefiLlama#15374
1 parent ce44360 commit c792417

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

projects/yei-swap/index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const { getConfig } = require('../helper/cache')
2+
const { sumTokens2 } = require('../helper/unwrapLPs')
3+
4+
module.exports = {
5+
sei: {
6+
tvl,
7+
},
8+
}
9+
10+
async function tvl(api) {
11+
const { pools, } = await getConfig('yei-swap', 'https://swap-api.yei.finance/pools')
12+
13+
14+
const ownerTokens = []
15+
for (const { token0, token1, address} of pools) {
16+
if (token0?.address && !token0.symbol.startsWith('stata')) ownerTokens.push([[token0.address], address])
17+
if (token1?.address && !token1.symbol.startsWith('stata')) ownerTokens.push([[token1.address], address])
18+
}
19+
20+
return sumTokens2({ api, ownerTokens, permitFailure: true })
21+
22+
}

0 commit comments

Comments
 (0)