From b42fa96a3eb3452b8776417280fb291d8b885722 Mon Sep 17 00:00:00 2001 From: g1nt0ki <99907941+g1nt0ki@users.noreply.github.com> Date: Wed, 14 Aug 2024 14:21:08 +0200 Subject: [PATCH] track jvault (#11269) --- projects/jvault/index.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 projects/jvault/index.js diff --git a/projects/jvault/index.js b/projects/jvault/index.js new file mode 100644 index 0000000000..260a6a9aeb --- /dev/null +++ b/projects/jvault/index.js @@ -0,0 +1,22 @@ +const ADDRESSES = require("../helper/coreAssets.json"); +const { fetchURL } = require('../helper/utils'); + +async function staking(api) { + + // API is used to get all vaults and their TVLs to avoid scan of all blockchain for matching vaults + // also Jettons values are converted to TON using DEXs prices + const response = await fetchURL("https://jvault.xyz/staking/stake?type=json") + for (const pool of response.data.pools) { + api.add(ADDRESSES.ton.TON, pool.ton_tvl * 1e9) + } +} + + +module.exports = { + methodology: 'Counts balances of all tokens based on DEXs prices in all vaults.', + timetravel: false, + ton: { + tvl: () => ({}), + staking, + } +}