Query editor
-- Compare the first fresh registration after each initial auction with the-- original 2017 winner. Includes repeat old-registry auctions, excludes-- renewals and the 2020 bulk migration. This is recorded-address equality:-- the first winner may have traded the name before it expired.-- Repeat old-registry finalizations with the same auction registration date-- are excluded, because they are not another auction.WITH original_events AS (SELECThash AS labelhash,owner AS original_winner,registrationdate AS original_auction_registration_date,evt_block_number AS original_block,evt_index AS original_log_index,row_number() OVER (PARTITION BY hash ORDER BY evt_block_number, evt_index) AS occurrenceFROM ethereumnameservice_ethereum.registrar_old_evt_hashregisteredWHERE contract_address = 0x6090a6e47849629b7245dfa1ca21d94cd15878efAND evt_block_date >= DATE '2017-05-09'AND evt_block_date < DATE '2017-07-01'AND evt_block_number < 3919721),prepunks AS (SELECT labelhash, original_winner, original_auction_registration_date,original_block, original_log_indexFROM original_eventsWHERE occurrence = 1),fresh_events AS (SELECT e.hash AS labelhash, e.owner AS registrant,e.evt_block_time, e.evt_block_number, e.evt_indexFROM ethereumnameservice_ethereum.registrar_old_evt_hashregistered eJOIN prepunks p ON p.labelhash = e.hashWHERE e.contract_address = 0x6090a6e47849629b7245dfa1ca21d94cd15878efAND e.evt_block_date >= DATE '2017-05-09'AND e.evt_block_date < DATE '2020-08-01'AND (e.evt_block_number > p.original_blockOR (e.evt_block_number = p.original_blockAND e.evt_index > p.original_log_index))AND e.registrationdate <> p.original_auction_registration_dateUNION ALLSELECT label AS labelhash, owner AS registrant,evt_block_time, evt_block_number, CAST(evt_index AS bigint) AS evt_indexFROM ens.view_registrationsWHERE evt_block_time >= TIMESTAMP '2019-05-04'AND label IN (SELECT labelhash FROM prepunks)UNION ALLSELECT labelhash, owner, evt_block_time, evt_block_number, evt_indexFROM ethereumnameservice_ethereum.ethregistrarcontroller_5_evt_nameregisteredWHERE evt_block_date >= DATE '2025-01-01'AND labelhash IN (SELECT labelhash FROM prepunks)),first_return AS (SELECT labelhash, registrant, evt_block_time,row_number() OVER (PARTITION BY labelhash