From 39661004a273840a9afb78f52e9b3fd32a9dad7e Mon Sep 17 00:00:00 2001 From: g1nt0ki <99907941+g1nt0ki@users.noreply.github.com> Date: Sun, 29 Sep 2024 20:49:46 +0200 Subject: [PATCH] update vfat --- projects/vfat/index.js | 18 ++++++++++++++++-- test.js | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/projects/vfat/index.js b/projects/vfat/index.js index 3942aecaf8b9..6865d2b68beb 100644 --- a/projects/vfat/index.js +++ b/projects/vfat/index.js @@ -1,4 +1,5 @@ const { getLogs } = require('../helper/cache/getLogs'); +const { get } = require('../helper/http'); const { sumTokens2, addUniV3LikePosition } = require('../helper/unwrapLPs'); const config = require('./config'); @@ -322,7 +323,20 @@ Object.keys(config).forEach(chain => { tvl = genericTvl } - module.exports[chain] = { tvl } + module.exports[chain] = { tvl: tvl2 } }) -module.exports.isHeavyProtocol = true \ No newline at end of file +// module.exports.isHeavyProtocol = true +module.exports.misrepresentedTokens = true +let _get + +async function tvl2(api) { + if (!_get) + _get = get(`https://api.vfat.io/v1/sickle-stats`) + + const { chainStats } = await _get + chainStats.filter(chain => chain.chainId === api.chainId).forEach(chain => { + api.addUSDValue(chain.tvl) + }) + +} \ No newline at end of file diff --git a/test.js b/test.js index 29cab073d704..1518dd2ae7da 100644 --- a/test.js +++ b/test.js @@ -27,7 +27,7 @@ const currentCacheVersion = sdk.cache.currentVersion // load env for cache if (process.env.LLAMA_SANITIZE) Object.keys(process.env).forEach((key) => { if (key.endsWith('_RPC')) return; - if (['TVL_LOCAL_CACHE_ROOT_FOLDER', 'LLAMA_DEBUG_MODE', 'GRAPH_API_KEY', ...ENV_KEYS].includes(key) || key.includes('SDK')) return; + if (['TVL_LOCAL_CACHE_ROOT_FOLDER', 'LLAMA_DEBUG_MODE', 'GRAPH_API_KEY', 'LLAMA_DEBUG_LEVEL2', ...ENV_KEYS].includes(key) || key.includes('SDK')) return; delete process.env[key] }) process.env.SKIP_RPC_CHECK = 'true'