Skip to content

Commit

Permalink
Bedrock brBTC: add kernel valut tvl
Browse files Browse the repository at this point in the history
  • Loading branch information
AgoL5866 committed Jan 20, 2025
1 parent c444de7 commit da58ed9
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion projects/brbtc/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const chainConfigs = {
"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",//cbBTC
"0x2F913C820ed3bEb3a67391a6eFF64E70c4B20b19",//M-BTC
],
staking: null,
},
bsc: {
addr: "0x733a6c29eDA4a58931AE81b8d91e29f2EAf01df3",
Expand All @@ -22,8 +23,16 @@ const chainConfigs = {
ADDRESSES.mantle.FBTC,//FBTC
"0x9BFA177621119e64CecbEabE184ab9993E2ef727",//M-BTC
],
staking: {
kernel: {
vault: "0x4F49f1d480D48AF660b7f4506bbB785AD5648726",
owner: "0x1Ae02CD8a4566A4f2432857D7A943765D1e3E757",
assets: ["0x9BFA177621119e64CecbEabE184ab9993E2ef727"]
}, // kernel -> M-BTC
}
}
}

module.exports = {
methodology: 'brBTC standing for Bedrock BTC, is designed specifically for Bitcoin holders seeking to participate in the next generation of DeFi opportunities. It accepts uniBTC and multiple wrapped BTC assets and Bedrock manages those assets on multiple trusted yield source layers such as Babylon, Kernel, Pell, Satlayer and etc.',
doublecounted: true,
Expand All @@ -32,9 +41,17 @@ module.exports = {
async function tvl(api) {
const cfg = chainConfigs[api.chain] ?? {}
if (!cfg) return;
if (cfg.staking.kernel) {
const stakingCfg = cfg.staking.kernel
const stakingToken = stakingCfg.assets[0]
const stakingBalance = await api.call({
abi: 'erc20:balanceOf', chain: api.chain, target: stakingCfg.vault, params: [stakingCfg.owner]
})
api.add(stakingToken, stakingBalance)
}
return sumTokens2({ api, owner: cfg.vault, tokens: cfg.assets })
}

['ethereum', 'bsc'].forEach(chain => {
['bsc'].forEach(chain => {
module.exports[chain] = { tvl: tvl }
})

0 comments on commit da58ed9

Please sign in to comment.