Query editor
WITHwinner as (SELECTevt_block_time as date,winner,rewardAmount / 1e18 as ethFROM laplace_arbitrum.MomentLoteryETHv1_evt_WinnerSelected),add_price as (SELECTd.*,p.price,d.eth * p.price as amount_usdFROM winner dLEFT JOIN prices.usd_daily pON p.contract_address = 0x2170ed0880ac9a755fd29b2688956bd959f933f8and p.day = DATE_TRUNC('day',d.date))SELECT *,(count(*) over())+1 as current_epochFROM add_priceORDER BY date DESC;