mirror of
https://github.com/alexgo-io/DefiLlama-Adapters.git
synced 2026-01-12 08:34:23 +08:00
added milkyway restake in TVL (#16824)
This commit is contained in:
33
projects/milky-way-restaking/index.js
Normal file
33
projects/milky-way-restaking/index.js
Normal 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,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user