Skip to content

Commit

Permalink
adding babypie tvl
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-magpie committed Jan 4, 2025
1 parent 5cee999 commit d7f6903
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
18 changes: 18 additions & 0 deletions projects/babypie/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
ethereum: {
mbtc: "0xbDf245957992bfBC62B07e344128a1EEc7b7eE3f",
wbtc: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"

},
bsc: {
mbtc: "0x7c1cCA5b25Fa0bC9AF9275Fb53cBA89DC172b878",
wbtc: "0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c"

},
arbitrum: {
mbtc: "0x2172fAD929E857dDfD7dDC31E24904438434cB0B",
wbtc: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f"

},

};
35 changes: 35 additions & 0 deletions projects/babypie/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const { PollingWatchKind } = require("typescript");
const config = require("./config");
const sdk = require('@defillama/sdk')




async function tvl(api) {
const { mbtc,wbtc } = config[api.chain];

// getting total supply of pegged tokesn
tokenSupply = await api.call({ abi: 'uint256:totalSupply', target: mbtc });
//when chain is bsc the decimals of pegged token is 18, but btcb is 8
if (api.chain === "bsc") {
tokenSupply = tokenSupply * Math.pow(10, 10);
}


api.add(wbtc, tokenSupply);
}

module.exports = {
arbitrum: {
tvl: tvl,
},
ethereum: {
tvl: tvl,
},
bsc: {
tvl: tvl,
},

};

module.exports.doublecounted = true;

0 comments on commit d7f6903

Please sign in to comment.