Skip to content

Commit

Permalink
adding seneca tvl for chambers on arbitrum and ethereum, staking tvl … (
Browse files Browse the repository at this point in the history
DefiLlama#8978)

* adding seneca tvl for chambers on arbitrum and ethereum, staking tvl for arbitrum

* code refactor

---------

Co-authored-by: g1nt0ki <[email protected]>
  • Loading branch information
encrypt3dw4lrus and g1nt0ki authored Feb 16, 2024
1 parent e8428ba commit 2eb5326
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions projects/seneca/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const { staking } = require('../helper/staking');

const stakingContract = '0x0bD623E8150918b4252a1df407B914250AcE4CC6';
const senToken = '0x154388a4650D63acC823e06Ef9e47C1eDdD3cBb2';

const config = {
arbitrum: { chambers: ['0x2d99E1116E73110B88C468189aa6AF8Bb4675ec9', '0x4D7b1A1900b74ea4b843a5747740F483152cbA5C', '0x7C160FfE3741a28e754E018DCcBD25dB04B313AC',], lens: '0x5c6cBA80e5FA3c8D9FD53F17d6F5a7A2EDb5fC8C', },
ethereum: { chambers: ['0xBC83F2711D0749D7454e4A9D53d8594DF0377c05'], lens: '0x9cae6d5a09E4860AfCD1DF144250dd02A014DF15', },
}

module.exports = {
doublecounted: true,
methodology: 'Counts the TVL of SEN tokens staked in the staking contracts and the total collateral in chambers across Arbitrum and Ethereum.',
};

Object.keys(config).forEach(chain => {
const { chambers } = config[chain]
module.exports[chain] = {
tvl: async (_, _b, _cb, { api, }) => {
const tokens = await api.multiCall({ abi: 'address:collateral', calls: chambers })
const bals = await api.multiCall({ abi: 'uint256:totalCollateralShare', calls: chambers })
api.add(tokens, bals)
return api.getBalances()
}
}
})

module.exports.arbitrum.staking = staking(stakingContract, senToken)

0 comments on commit 2eb5326

Please sign in to comment.