added milkyway restake in TVL (#16824)

This commit is contained in:
Saurabh
2025-10-28 20:59:54 +05:30
committed by GitHub
parent 5ab2e57a63
commit b4bdcc6773
2 changed files with 34 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
const { queryV1Beta1 } = require("../helper/chain/cosmos");
// Query restaking TVL from MilkyWay chain's locked denoms
// This represents liquid staked tokens (like milkTIA) that have been restaked
async function restakingTVL(api) {
const res = await queryV1Beta1({
chain: api.chain,
url: "bank/v1beta1/supply",
});
// Process all locked denoms (restaked assets)
res.supply.forEach(({ denom, amount }) => {
if (denom.startsWith("locked/")) {
// Remove the "locked/" prefix to get the underlying asset
const underlyingDenom = denom.replace("locked/", "")
// Add the restaked amount to balances
if (underlyingDenom.startsWith("ibc/")) {
api.add(`${underlyingDenom.replace("/", ":")}`, amount)
} else {
api.add(underlyingDenom, amount)
}
}
})
}
module.exports = {
doublecounted: true,
methodology: 'TVL counts the liquid staked tokens that have been restaked on MilkyWay. This TVL is double counted as these assets are already included in the liquid staking TVL.',
milkyway: {
tvl: restakingTVL,
}
}

View File

@@ -51,7 +51,7 @@ async function milkINITTVL(api) {
}
module.exports = {
methodology: 'TVL counts the tokens that are locked in the Milky Way protocol',
methodology: 'TVL counts the tokens that are locked in the Milky Way liquid staking protocol',
osmosis: {
tvl: milkTIATVL,
},