Skip to content

Commit 4a49024

Browse files
authored
Variational (#17311)
1 parent f2dec7a commit 4a49024

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

projects/variational/index.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
11
const { sumTokens2 } = require('../helper/unwrapLPs');
2+
const { getLogs } = require('../helper/cache/getLogs')
23

34
const OLP_VAULT = '0x74bbbb0e7f0bad6938509dd4b556a39a4db1f2cd';
5+
const POOL_FACTORY = '0x0F820B9afC270d658a9fD7D16B1Bdc45b70f074C'
46

5-
async function tvl(timestamp, ethBlock, chainBlocks, { api }) {
6-
return sumTokens2({
7+
async function tvl({ api }) {
8+
const logs = await getLogs({
79
api,
8-
owner: OLP_VAULT,
9-
fetchCoValentTokens: true,
10+
target: POOL_FACTORY,
11+
eventAbi: 'event PoolCreated(address indexed creatorAddress, address[] otherAddresses, uint128 indexed poolUuid, address pool, uint128 rfqUuid, uint128 parentQuoteUuid, address feePaidBy, uint256 feeAmount)',
12+
onlyArgs: true,
13+
fromBlock: 300692000,
14+
})
15+
16+
const pools = logs.map(log => log.pool)
17+
18+
await sumTokens2({
19+
api,
20+
owners: [...pools, OLP_VAULT],
21+
token: '0xaf88d065e77c8cc2239327c5edb3a432268e5831',
1022
})
1123
}
1224

1325
module.exports = {
1426
start: 1722470400, // Aug 2024 mainnet launch
15-
misrepresentedTokens: false,
16-
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).`,
27+
methodology: `TVL counts USDC held in Variational's Core OLP Vault (${OLP_VAULT}) on Arbitrum, and pools created by the factory (${POOL_FACTORY}).`,
1728
arbitrum: { tvl }
1829
};

0 commit comments

Comments
 (0)