Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion projects/zoofi-io/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,35 @@ async function tvlLNT(api) {
}
}

const lvts = {
bsc: [
{
// Filecoin LvtVault
asset: '0x0D8Ce2A99Bb6e3B7Db580eD848240e4a0F9aE153',
vt: '0x24ef95c39dfaa8f9a5adf58edf76c5b22c34ef46',
vtHook: '0xed202a7050ee856ba9f0d3cd5eabcab6b8a23a88',
}
],
}

async function tvlLVT(api) {
const lvtConfigs = lvts[api.chain] || []
for (const lvt of lvtConfigs) {
const decimals = await api.call({ abi: 'erc20:decimals', target: lvt.vt })
const oneVT = BigNumber(10).pow(decimals).toString()

const [totalSupply, unitPrice] = await api.batchCall([
{ abi: 'erc20:totalSupply', target: lvt.vt },
{ abi: 'function getAmountOutVTforT(uint256) view returns (uint256)', target: lvt.vtHook, params: [oneVT] }
])

api.add(lvt.asset, BigNumber(totalSupply).times(unitPrice).div(oneVT).toFixed(0))
}
}

module.exports = {
doublecounted: true,
berachain: { tvl },
arbitrum: { tvl: tvlLNT }
arbitrum: { tvl: tvlLNT },
bsc: { tvl: tvlLVT }
}
Loading