From f7fef2ca2e2492d35914237c0919ca960afc3209 Mon Sep 17 00:00:00 2001 From: "a.maik" Date: Fri, 10 May 2024 16:48:40 +0200 Subject: [PATCH] Keller Sprinkler Information added (CL) --- projects/keller-CL/index.js | 40 +++++++++++++++++++++++++++++++++++++ projects/keller/index.js | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 projects/keller-CL/index.js diff --git a/projects/keller-CL/index.js b/projects/keller-CL/index.js new file mode 100644 index 0000000000..074c0996fb --- /dev/null +++ b/projects/keller-CL/index.js @@ -0,0 +1,40 @@ +const { default: axios } = require('axios') + +async function tvl(api) { + const data = await axios.get('https://api.steer.finance/getSmartPools?chainId=534352&dexName=equilibre') + const pools = data.data; + const vaults = Object.values(pools.pools).flatMap(pool => pool.map(obj => obj.vaultAddress)); + const bals = await api.multiCall({ + abi: "function getTotalAmounts() view returns (uint256 total0, uint256 total1)", + calls: vaults, + permitFailure: true, + }) + const token0s = await api.multiCall({ + abi: "address:token0", + calls: vaults, + permitFailure: true, + }) + const token1s = await api.multiCall({ + abi: "address:token1", + calls: vaults, + permitFailure: true, + }) + bals.forEach((bal, i) => { + const token0 = token0s[i] + const token1 = token1s[i] + if (!bal || !token0 || !token1) return // skip failures + api.add(token0, bal.total0) + api.add(token1, bal.total1) + }) + return api.getBalances() + + } + +module.exports = { + misrepresentedTokens: true, + methodology: 'TVL shows the sum of all the assets deposited in the vaults provided by our ALM partners.', + scroll: { + tvl, + }, +} + diff --git a/projects/keller/index.js b/projects/keller/index.js index 20a9d8a886..98899584e4 100644 --- a/projects/keller/index.js +++ b/projects/keller/index.js @@ -1,5 +1,5 @@ const { getUniTVL } = require('../helper/cache/uniswap.js') -const { staking } = require('../helper/staking.js') +const { staking } = require('../helper/staking.js'); module.exports = { misrepresentedTokens: true,