From 0c2833dafcfe301e13179800a09b117c638d61e0 Mon Sep 17 00:00:00 2001 From: wayne Date: Fri, 5 Dec 2025 14:33:43 +0000 Subject: [PATCH] variational --- projects/variational/index.js | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/projects/variational/index.js b/projects/variational/index.js index 3820bdb7f9..59787474e8 100644 --- a/projects/variational/index.js +++ b/projects/variational/index.js @@ -1,18 +1,29 @@ const { sumTokens2 } = require('../helper/unwrapLPs'); +const { getLogs } = require('../helper/cache/getLogs') const OLP_VAULT = '0x74bbbb0e7f0bad6938509dd4b556a39a4db1f2cd'; +const POOL_FACTORY = '0x0F820B9afC270d658a9fD7D16B1Bdc45b70f074C' -async function tvl(timestamp, ethBlock, chainBlocks, { api }) { - return sumTokens2({ +async function tvl({ api }) { + const logs = await getLogs({ api, - owner: OLP_VAULT, - fetchCoValentTokens: true, + target: POOL_FACTORY, + eventAbi: 'event PoolCreated(address indexed creatorAddress, address[] otherAddresses, uint128 indexed poolUuid, address pool, uint128 rfqUuid, uint128 parentQuoteUuid, address feePaidBy, uint256 feeAmount)', + onlyArgs: true, + fromBlock: 300692000, + }) + + const pools = logs.map(log => log.pool) + + await sumTokens2({ + api, + owners: [...pools, OLP_VAULT], + token: '0xaf88d065e77c8cc2239327c5edb3a432268e5831', }) } module.exports = { start: 1722470400, // Aug 2024 mainnet launch - misrepresentedTokens: false, - methodology: `TVL counts all tokens held in Variational's Core OLP Vault (${OLP_VAULT}) on Arbitrum. This represents the main collateral/liquidity pool for perpetual futures trading via the Omni Liquidity Provider (OLP).`, + methodology: `TVL counts USDC held in Variational's Core OLP Vault (${OLP_VAULT}) on Arbitrum, and pools created by the factory (${POOL_FACTORY}).`, arbitrum: { tvl } }; \ No newline at end of file