Query editor
with positions as (-- get all positionsselect fee, b.tokenid, "to" as original_minter, a.tickLower, a.tickUpper, date_trunc('day',a.evt_block_time) as created_datefrom uniswap_v3_ethereum.Pair_evt_Mint ainner join uniswap_v3_ethereum.nonfungiblepositionmanager_evt_transfer bon a.evt_tx_hash = b.evt_tx_hashinner join (select b.fee, a.tokenId, a.tickLower, a.tickUpperfrom query_2506476 a -- uni v3 eth position listsinner join (select * from uniswap_v3_ethereum.Factory_evt_PoolCreatedwhere pool in (0xF260d15e8eBe54D210ef53F5b61Cb46bD9Aa29EE,0x0a61a26c0DC08F4ed68A00966Cc5A0CA60918ea3,0x8A54c7C7d2d4481429fa96ED14d98c64E1b16005)) bon a.token0 = b.token0 and a.token1 = b.token1 and a.fee = b.feegroup by 1,2,3,4) con b.tokenId = c.tokenId and a.tickUpper = c.tickUpper and a.tickLower = c.tickLowerwhere a.contract_address in (0xF260d15e8eBe54D210ef53F5b61Cb46bD9Aa29EE,0x0a61a26c0DC08F4ed68A00966Cc5A0CA60918ea3,0x8A54c7C7d2d4481429fa96ED14d98c64E1b16005)and b."from" = 0x0000000000000000000000000000000000000000group by 1,2,3,4,5,6), owners as (-- get current owner of positionsselect tokenid, "to" as current_ownerfrom (select tokenid, "to", row_number() over (partition by tokenid order by evt_block_number desc) as rnfrom uniswap_v3_ethereum.nonfungiblepositionmanager_evt_transfer as awhere tokenid in (select tokenid from positions))where rn = 1), tokens as (select p.*, p0.price as token0_price, p1.price as token1_pricefrom (select erc20a.symbol as token0_symbol, erc20b.symbol as token1_symbol, erc20a.contract_address as token0_address, erc20b.contract_address as token1_address, erc20a.decimals as token0_decimal, erc20b.decimals as token1_decimalfrom uniswap_v3_ethereum.Factory_evt_PoolCreated qleft join tokens.erc20 erc20aon erc20a.contract_address = q.token0 and erc20a.blockchain = 'ethereum'left join tokens.erc20 erc20bon erc20b.contract_address = q.token1 and erc20b.blockchain = 'ethereum'where q.pool = 0xF260d15e8eBe54D210ef53F5b61Cb46bD9Aa29EEgroup by 1,2,3,4,5,6) pleft join prices.usd_latest as p0on p0.contract_address = p.token0_addressand p0.blockchain = 'ethereum'left join prices.usd_latest as p1