forked from DefiLlama/DefiLlama-Adapters
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding seneca tvl for chambers on arbitrum and ethereum, staking tvl … (
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
1 parent
e8428ba
commit 2eb5326
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |