Query editor
--Position Snapshot - snapshot of the pool users-- TIMESTAMP -> from the hypervisor transfers table-- block_date - YYYY-MM-DD HH:00:00 for hourly snapshots (from the hypervisor transfers table)-- chain_id -> namual input-- strategy_vault_contract_address -> the hypervisor address (from the hypervisor transfers table)-- user_address -> from wallet addresses in the hypervisor transfers table-- liquidity_pool_address -> call_pool table-- underlying_token_address --> same as the hypervisor address-- underlying_token_index --> 0-- Per user-- underlying_token_amount -> (decimals normalized)-- underlying_token_amount_usd-- total_fees_usd -> need % of the poolWITH HypeEvents AS (-- Gets the vault addresses asocieted with a specific hype registery, makes it easier to find the right contractsSELECT146 AS chain_id, -- manually input chain_idevt_block_time AS timestamp,evt_block_number AS creation_block_number,hype AS strategy_vault_contract_address,18 AS strategy_vault_receipt_token_decimals, -- Assuming a fixed decimal for this exampleevt_tx_hash,evt_tx_from,evt_tx_toFROMgamma_sonic.HypeRegistry_evt_HypeAdded -- change the network here once avaliable on duneWHERE evt_tx_to in ( 0x683292172E2175bd08e3927a5e72FC301b161300,0xDe4f68F55B4816adaD55047D1E8188d8525DCE72,0x2705176750a81d6b1C64c5081d55aA1B54681917,0xB24DC81f8Be7284C76C7cF865b803807B3C2EF55) -- the sepcific hype registery, would need to be updated for a new network),PoolDetails AS (-- Gets the pool details for the vaultsSELECTcontract_address AS strategy_vault_contract_address,output_0 AS liquidity_pool_addressFROMgamma_sonic.Hypervisor_call_pool -- change the network here once avaliable on dune),HypeRegistery as (-- Preselecting the HyperRegistery contracts, making sure the pool addresses are not null for further analysisSELECThe.chain_id,he.timestamp,he.creation_block_number,he.strategy_vault_contract_address,pd.liquidity_pool_address,he.strategy_vault_contract_address as strategy_vault_receipt_token_address,he.strategy_vault_receipt_token_decimalsFROMHypeEvents heLEFT JOINPoolDetails pd ON he.strategy_vault_contract_address = pd.strategy_vault_contract_addressWHERE pd.liquidity_pool_address IS NOT NULL