From aa7388b22ab36407221d84a79772f993176db6c4 Mon Sep 17 00:00:00 2001 From: g1nt0ki <99907941+g1nt0ki@users.noreply.github.com> Date: Sat, 8 Nov 2025 19:07:26 +0100 Subject: [PATCH] revert sunswap v1 --- projects/justSwap/index.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/projects/justSwap/index.js b/projects/justSwap/index.js index f5707c182..4cf1b9a3c 100644 --- a/projects/justSwap/index.js +++ b/projects/justSwap/index.js @@ -1,14 +1,28 @@ const { getCache, setCache } = require('../helper/cache') +const { get } = require('../helper/http') const { sliceIntoChunks, sleep } = require('../helper/utils') module.exports = { misrepresentedTokens: true, isHeavyProtocol: true, + timetravel: false, tron: { - tvl, + tvl: httpTvl, }, } +async function httpTvl(api) { + const {data} = await get('https://abc.endjgfsv.link/swap/scan/liquidityall') + const latest = data.pop() + const timestamp = Date.now() - 24 * 60 * 60 * 1000 + + if (latest.time > timestamp) { + api.addUSDValue(+latest.liquidity) + } else { + throw new Error("No recent data found") + } +} + async function tvl(api) { const factories = [ 'TXk8rQSAvPvBBNtqSoY6nCfsXWCSSpTVQF', // v1