From 28bcc4b1eb815c1c7ef0421f40f0a9d81eda3a93 Mon Sep 17 00:00:00 2001 From: maybeyonas Date: Thu, 15 Aug 2024 03:46:32 +0530 Subject: [PATCH] add swell-swbtc (#11297) --- 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