Skip to content

Commit 4d257c9

Browse files
authored
ETH Strategy ESPN TVL (#16387)
1 parent d23653b commit 4d257c9

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

projects/EthStrategy/index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const USDS_CONTRACT_ADDRESS = '0xdC035D45d973E3EC169d2276DDab16f1e407384F';
2+
const ESPN_CONTRACT_ADDRESS = '0xb250C9E0F7bE4cfF13F94374C993aC445A1385fE';
3+
4+
const ESPN_ABI = {
5+
totalAssets: "function totalAssets() view returns (uint256)",
6+
};
7+
8+
async function tvl(api) {
9+
const espnTotalAssets = await api.call({
10+
abi: ESPN_ABI.totalAssets,
11+
target: ESPN_CONTRACT_ADDRESS,
12+
});
13+
api.add(USDS_CONTRACT_ADDRESS, espnTotalAssets);
14+
return api.getBalances();
15+
}
16+
17+
module.exports = {
18+
methodology: 'Calculates total USDS TVL from ESPN contract totalAssets() only.',
19+
ethereum: {
20+
tvl,
21+
},
22+
};

0 commit comments

Comments
 (0)