Skip to content

Commit

Permalink
added drop protocol (#11313)
Browse files Browse the repository at this point in the history
  • Loading branch information
ratik authored Aug 15, 2024
1 parent cb8b06a commit 641ab3f
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions projects/drop/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const sdk = require("@defillama/sdk");
const { queryContract } = require('../helper/chain/cosmos')

const chains = {
cosmos: {
chainId: "cosmoshub-4",
denom: "uatom",
coinGeckoId: "cosmos",
dropContract: "neutron16m3hjh7l04kap086jgwthduma0r5l0wh8kc6kaqk92ge9n5aqvys9q6lxr"
},
};

function makeTvlFn(chain) {
return async () => {
const balances = {};
const data = await queryContract({
contract: chain.dropContract,
chain: "neutron",
data: {
"total_bonded": {}
}
});
const assetBalance = parseInt(data, 10) / 1e6;
const amount = assetBalance;

sdk.util.sumSingleBalance(
balances,
chain.coinGeckoId,
amount
);

return balances;
};
}

module.exports = {
timetravel: false,
methodology: "Sum of all the tokens that are liquid staked on DROP",
};

for (const chainName of Object.keys(chains)) {
module.exports[chainName] = { tvl: makeTvlFn(chains[chainName]) };
}

0 comments on commit 641ab3f

Please sign in to comment.