Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions projects/variational/index.js
Original file line number Diff line number Diff line change
@@ -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 }
};
Loading