diff --git a/projects/milky-way-restaking/index.js b/projects/milky-way-restaking/index.js new file mode 100644 index 000000000..6d2538811 --- /dev/null +++ b/projects/milky-way-restaking/index.js @@ -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, + } +} + diff --git a/projects/milky-way/index.js b/projects/milky-way/index.js index 3ce0e3650..930db8484 100644 --- a/projects/milky-way/index.js +++ b/projects/milky-way/index.js @@ -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, },