Skip to content

Commit 237d759

Browse files
add Ethereum staking to venofinance TVL (DefiLlama#9195)
* add Ethereum staking to venofinance TVL * code refactor --------- Co-authored-by: g1nt0ki <[email protected]>
1 parent 07ddd2d commit 237d759

File tree

1 file changed

+29
-34
lines changed

1 file changed

+29
-34
lines changed

projects/venofinance/index.js

Lines changed: 29 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,39 @@
1-
const sdk = require('@defillama/sdk')
21
const { staking } = require("../helper/staking.js");
32

4-
const fountain_contract_address = "0xb4be51216f4926ab09ddf4e64bc20f499fd6ca95"
5-
const reservoir_contract_address = "0x21179329c1dcfd36ffe0862cca2c7e85538cca07"
6-
const vno_contract_address = "0xdb7d0a1ec37de1de924f8e8adac6ed338d4404e9"
3+
const fountain_contract_address = "0xb4be51216f4926ab09ddf4e64bc20f499fd6ca95";
4+
const reservoir_contract_address = "0x21179329c1dcfd36ffe0862cca2c7e85538cca07";
5+
const vno_contract_address = "0xdb7d0a1ec37de1de924f8e8adac6ed338d4404e9";
76

8-
async function tvl(timestamp, ethBlock, chainBlocks, {api}) {
7+
async function tvlCronos(timestamp, ethBlock, chainBlocks, { api }) {
8+
const lcro_contract_address = "0x9Fae23A2700FEeCd5b93e43fDBc03c76AA7C08A6";
9+
const latom_contract_address = "0xac974ee7fc5d083112c809ccb3fce4a4f385750d";
910

11+
const cro_pooled = await api.call({ abi: "uint256:getTotalPooledCro", target: lcro_contract_address, })
12+
const atom_pooled = await api.call({ abi: "uint256:getTotalPooledToken", target: latom_contract_address, })
1013

11-
const lcro_contract_address = '0x9Fae23A2700FEeCd5b93e43fDBc03c76AA7C08A6';
12-
const latom_contract_address = '0xac974ee7fc5d083112c809ccb3fce4a4f385750d';
13-
14-
const block = chainBlocks.cronos
15-
16-
const cro_pooled = await sdk.api.abi.call({
17-
abi: "uint256:getTotalPooledCro",
18-
target: lcro_contract_address,
19-
block: block,
20-
chain: 'cronos'
21-
})
14+
api.addGasToken(cro_pooled)
15+
api.addCGToken('cosmos', atom_pooled / 1e6)
16+
return api.getBalances()
17+
}
2218

23-
const atom_pooled = await sdk.api.abi.call({
24-
abi: "uint256:getTotalPooledToken",
25-
target: latom_contract_address,
26-
block: block,
27-
chain: 'cronos'
28-
})
19+
async function tvlEra(timestamp, ethBlock, chainBlocks, { api }) {
20+
const leth_contract_address = "0xE7895ed01a1a6AAcF1c2E955aF14E7cf612E7F9d";
2921

30-
return {
31-
'crypto-com-chain': Number(cro_pooled.output) / 1e18,
32-
"cosmos": Number(atom_pooled.output) / 1e6
33-
};
22+
const eth_pooled = await api.call({ abi: "uint256:getTotalPooledToken", target: leth_contract_address, })
23+
api.addGasToken(eth_pooled)
24+
return api.getBalances()
3425
}
3526

3627
module.exports = {
37-
timetravel: true,
38-
misrepresentedTokens: false,
39-
methodology: 'TVL counts CRO staked by the protocol.',
40-
cronos: {
41-
tvl ,
42-
staking: staking([fountain_contract_address, reservoir_contract_address], vno_contract_address)
43-
}
44-
}
28+
methodology: "TVL counts tokens staked by the protocol.",
29+
cronos: {
30+
tvl: tvlCronos,
31+
staking: staking(
32+
[fountain_contract_address, reservoir_contract_address],
33+
vno_contract_address
34+
),
35+
},
36+
era: {
37+
tvl: tvlEra,
38+
},
39+
};

0 commit comments

Comments
 (0)