Query editor
--deposit_type :0 rebase--deposit_type: 2 purchased one--deposit_type: 1 airdropwithdeposits as (SELECTnft_id,sum(value) as value,max(locktime) as lockTimestamp,from_unixtime(CAST(max(locktime) as BIGINT)) as lockTimefrom(SELECTcast(value / 1e18 as DECIMAL) as value,tokenId as nft_id,locktimefromaerodrome_base.VotingEscrow_evt_Deposit-- where-- evt_block_time <= cast('2024-11-30 00:00:00' as TIMESTAMP)UNION allSELECT(-1) * cast(value / 1e18 as DECIMAL) as value,tokenId as nft_id,tokenId as locktimefromaerodrome_base.VotingEscrow_evt_Withdraw-- where-- evt_block_time <= cast('2024-11-30 00:00:00' as TIMESTAMP)) xGROUP by1),nft_transfers as (SELECTold_owner,new_owner,nft_id,evt_tx_hashfrom(SELECT"from" as old_owner,to as new_owner,tokenId as nft_id,evt_block_time,evt_tx_hash,row_number() over (partition bytokenIdorder byevt_block_time desc) as row_numfromaerodrome_base.VotingEscrow_evt_Transfer-- where-- evt_block_time <= cast('2024-11-30 00:00:00' as TIMESTAMP)) xwhererow_num = 1