From 68d58f48213948f428003975575a6b6c03a744be Mon Sep 17 00:00:00 2001 From: darvin Date: Wed, 14 Aug 2024 23:02:04 +0530 Subject: [PATCH] add swell-swbtc --- projects/swell-swbtc/index.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 projects/swell-swbtc/index.js diff --git a/projects/swell-swbtc/index.js b/projects/swell-swbtc/index.js new file mode 100644 index 000000000000..a419de3aeea2 --- /dev/null +++ b/projects/swell-swbtc/index.js @@ -0,0 +1,20 @@ +const ADDRESSES = require('../helper/coreAssets.json') + +const WBTC = ADDRESSES.ethereum.WBTC; +const swBTC = '0x8DB2350D78aBc13f5673A411D4700BCF87864dDE' + +async function tvl(api) { + const totalSupply = await api.call({ target: swBTC, abi: 'uint256:totalSupply'}); + const rate = await api.call({ target: swBTC, abi: 'uint256:pricePerShare'}); + + return { + [WBTC]: (totalSupply * rate)/1e8 + }; +} + +module.exports = { + doublecounted: true, + ethereum: { + tvl, + }, +} \ No newline at end of file