Skip to content

Commit

Permalink
update vfat
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed Sep 29, 2024
1 parent 1e529f8 commit 3966100
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions projects/vfat/index.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down Expand Up @@ -322,7 +323,20 @@ Object.keys(config).forEach(chain => {
tvl = genericTvl
}

module.exports[chain] = { tvl }
module.exports[chain] = { tvl: tvl2 }
})

module.exports.isHeavyProtocol = true
// 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)
})

}
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 3966100

Please sign in to comment.