-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5cee999
commit d7f6903
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
||
}, | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |