Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: count rings as sonic TVL #13206

Merged
merged 6 commits into from
Jan 27, 2025
Merged
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
53 changes: 33 additions & 20 deletions projects/rings/index.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
const ADDRESSES = require('../helper/coreAssets.json')
const sdk = require("@defillama/sdk");
const { sumTokensExport } = require("../helper/unwrapLPs");
const { stakings } = require("../helper/staking");

module.exports = {
methodology: 'TVL counts the tokens deposited in the boring vaults.',
start: 1733726867
}

const config = {
const CONFIG = {
ethereum: {
vaults: [
'0xd3DCe716f3eF535C5Ff8d041c1A41C3bd89b97aE',
'0x3bcE5CB273F0F148010BbEa2470e7b5df84C7812',
],
supportedAssets: [
ADDRESSES.ethereum.USDC, // USDC
ADDRESSES.ethereum.USDC, // USDC
ADDRESSES.ethereum.USDT, // USDT
ADDRESSES.ethereum.DAI, // DAI
ADDRESSES.ethereum.SDAI, // SDAI
ADDRESSES.ethereum.sUSDS, // SUSDS
ADDRESSES.ethereum.WETH, // WETH
ADDRESSES.ethereum.WSTETH, // WSTETH
ADDRESSES.ethereum.STETH, // WSTETH
ADDRESSES.ethereum.WEETH, // WEETH
ADDRESSES.ethereum.EETH, // WEETH
'0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f', // GHO
'0x98C23E9d8f34FEFb1B7BD6a91B7FF122F4e16F5c', // AAVEUSDC
ADDRESSES.ethereum.USDT, // USDT
'0x23878914EFE38d27C4D67Ab83ed1b93A74D4086a', // AAVEUSDT
'0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f', // GHO
'0x1a88Df1cFe15Af22B3c4c783D4e6F7F9e0C1885d', // STKGHO
ADDRESSES.ethereum.DAI, // DAI
ADDRESSES.ethereum.SDAI, // SDAI
'0xdC035D45d973E3EC169d2276DDab16f1e407384F', // USDS
ADDRESSES.ethereum.sUSDS, // SUSDS
ADDRESSES.ethereum.WETH, // WETH
'0x4d5F47FA6A74757f35C14fD3a6Ef8E3C9BC514E8', // AAVEWETH
ADDRESSES.ethereum.WSTETH, // WSTETH
ADDRESSES.ethereum.WEETH, // WEETH
'0xd63070114470f685b75B74D60EEc7c1113d33a3D' // USDO MORPHO
'0xd63070114470f685b75B74D60EEc7c1113d33a3D', // USDO MORPHO,
'0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB', // STEAK_USDC
'0x2371e134e3455e0593363cBF89d3b6cf53740618' // GAUNTLET WETH
]
},
sonic: {
Expand All @@ -37,15 +41,24 @@ const config = {
'0x3bcE5CB273F0F148010BbEa2470e7b5df84C7812'
],
supportedAssets: [
ADDRESSES.sonic.USDC_e, // USDC
'0x50c42dEAcD8Fc9773493ED674b675bE577f2634b', // WETH
ADDRESSES.sonic.USDC_e,
'0x50c42dEAcD8Fc9773493ED674b675bE577f2634b', // WETH
],
stakingVaults: [
'0x4d85ba8c3918359c78ed09581e5bc7578ba932ba', // stkscUSD
'0x455d5f11Fea33A8fa9D3e285930b478B6bF85265' // stkscETH
],
stakingSupportedAssets: [
'0xd3DCe716f3eF535C5Ff8d041c1A41C3bd89b97aE', // scUSD
'0x3bce5cb273f0f148010bbea2470e7b5df84c7812', // scETH
]
},
}

Object.keys(config).forEach(chain => {
const { vaults, supportedAssets } = config[chain]
module.exports[chain] = {
tvl: sumTokensExport({ owners: vaults, tokens: supportedAssets})
}
})
Object.keys(CONFIG).forEach((chain) => {
const { vaults, supportedAssets, stakingVaults = [], stakingSupportedAssets = [] } = CONFIG[chain]
module.exports[chain] = {
tvl: sumTokensExport({ owners: vaults, tokens: supportedAssets }),
staking: stakings(stakingVaults, stakingSupportedAssets),
};
});
Loading