From 9377cd88bd02f3b602964d6e81957f3ce0f3270e Mon Sep 17 00:00:00 2001 From: Faizan ul haq Date: Wed, 15 Oct 2025 00:24:50 +0500 Subject: [PATCH] feat: add thorswap --- projects/thorswap/index.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 projects/thorswap/index.js diff --git a/projects/thorswap/index.js b/projects/thorswap/index.js new file mode 100644 index 00000000000..7b20c55b30d --- /dev/null +++ b/projects/thorswap/index.js @@ -0,0 +1,23 @@ +const THOR = "0xa5f2211b9b8170f694421f2046281775e8468044"; +const VTHOR = "0x815C23eCA83261b6Ec689b60Cc4a58b54BC24D8D"; +const UTHOR = "0x34deff97889f3a6a483e3b9255cafcb9a6e03588"; +const YTHOR = "0x8793CD69895C45b2d2474236b3Cb28FC5C764775"; + +const staking = async (api) => { + const stakingContracts = [VTHOR, UTHOR, YTHOR]; + const balances = await api.multiCall({ + abi: 'erc20:balanceOf', + calls: stakingContracts.map(contract => ({ target: THOR, params: [contract] })) + }); + + balances.forEach(balance => api.add(THOR, balance)); + return api.getBalances(); +}; + +module.exports = { + methodology: "TVL is the total amount of THOR tokens staked in VTHOR, UTHOR, and YTHOR staking contracts", + ethereum: { + tvl: () => ({}), + staking, + }, +};