Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding babypie tvl #12964

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
adding babypie tvl
  • Loading branch information
jan-magpie committed Jan 4, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit d7f6903572e8dd5bbe672ad25f938999998d037e
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;
Loading