Query editor
WITH holder_count AS (SELECTTheBasedLP_holder_address,COUNT(TheBasedLP_nft_id) AS TheBasedLP_held_countFROM query_3493592GROUP BYTheBasedLP_holder_address), average_TheBasedLP_held AS (SELECTAVG(TheBasedLP_held_count) AS avg_TheBasedLP_heldFROM holder_count), total_TheBasedLP_Burned AS (SELECTTheBasedLP_held_count AS burned,(1950000000/3333 *.6) + (((1950000000/3333*.4*.6) * TheBasedLP_held_count) / (3333-TheBasedLP_held_count)) as TheBasedLP_tn100xFROM holder_countWHERE TheBasedLP_holder_address = from_hex('0x000000000000000000000000000000000000dead')),prices AS (SELECTDATE_TRUNC('hour', block_time) AS hour,SUM(amount_usd) / SUM((token_sold_amount_raw/1e18)) AS tn100x_token_priceFROM uniswap.tradesWHERE(-- token_bought_address = FROM_HEX('5B5dee44552546ECEA05EDeA01DCD7Be7aa6144A') ORtoken_sold_address = FROM_HEX('5B5dee44552546ECEA05EDeA01DCD7Be7aa6144A'))AND amount_usd > 0AND blockchain = 'base'-- AND block_time < now() - '1 hour'GROUP BY1ORDER BYhour DESCLIMIT 1)SELECTh.TheBasedLP_holder_address,h.TheBasedLP_held_count,b.TheBasedLP_tn100x AS TheBasedLP_tn100x,b.TheBasedLP_tn100x * h.TheBasedLP_held_count AS total_TheBasedLP_tn100x,ROUND(p.tn100x_token_price,7) AS tn100x_price_usd,ROUND(b.TheBasedLP_tn100x * p.tn100x_token_price,2) AS TheBasedLP_price_usd,ROUND(p.tn100x_token_price * b.TheBasedLP_tn100x * h.TheBasedLP_held_count,2) AS total_TheBasedLP_usd,b.burned as TheBasedLP_burnedFROM holder_count AS hCROSS JOIN average_TheBasedLP_held AS aCROSS JOIN total_TheBasedLP_Burned AS bCROSS JOIN prices AS pWHEREh.TheBasedLP_held_count > 1AND h.TheBasedLP_holder_address != from_hex('0x000000000000000000000000000000000000dead')