From 1a87c4463119c4cfb00aee7f1937762f51287703 Mon Sep 17 00:00:00 2001 From: "lang.young" Date: Tue, 13 Aug 2024 17:04:49 +0800 Subject: [PATCH] feat: add solana tvl for astherus --- projects/astherus/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/projects/astherus/index.js b/projects/astherus/index.js index 3b76478de1..de07fb304d 100644 --- a/projects/astherus/index.js +++ b/projects/astherus/index.js @@ -1,4 +1,5 @@ const { getConfig } = require('../helper/cache') +const { sumTokens2 } = require('../helper/solana') const config = { bsc: '0x128463A60784c4D3f46c23Af3f65Ed859Ba87974', @@ -19,3 +20,10 @@ Object.keys(config).forEach(chain => { } } }) + +module.exports['solana'] = { + tvl: async function (...rest) { + const { data: tokens } = await getConfig(`astherus/solana`, `https://astherus.finance/bapi/futures/v1/public/future/web3/ae-deposit-asset?network=SOL`) + return sumTokens2({ tokenAccounts: tokens.map(({ tokenVault }) => [tokenVault]).flat() }) + } +}