Query editor
with prev as (select * from table(previous.query.result(schema => descriptor(day timestamp(3),rarity varchar,plays bigint,unique_players bigint,cards_distributed bigint)))),checkpoint as (select coalesce(max(day), timestamp '2025-06-01') - interval '1' day as cutofffrom prev),new_data as (selectdate_trunc('day', block_time) as day, case from_ownerwhen 'Low6UekJP3QrFVMfNRTL8CPK2SiGFhvp57sgF2pkmVu' then 'Low'when 'Lowq9dkpY43VpjfYeRjtKfGA6JtB7HaMmwQgXkjHLvN' then 'Low'when 'Mid9NeCpPNxP59fAdsLgMLy7BYexxXFw52ZP58Jrney' then 'Mid'when 'miDtj3vgdxVykHzRyFwyG8MXpvK8eQqamSLVdBr7WPt' then 'Mid'when 'HighJBfnAaqH9cKkeMErQFJZ4ATxQJwxqFupX6zaKTns' then 'High'when 'HiGHqwYddP5N2waqUmXPdaASpMpUEvfqPr2fSawctEb' then 'High'when 'EpicWWZspT1trKndbDDr29ULViN56rN5vofWSKZp8ePF' then 'Epic'when 'epiC3zkqa1RfcPMMM1Kc8m3GZGDwF2RmjbfA3g1BBjn' then 'Epic'when 'LGNDXqcm6U57QQ6Ad7icZ6oizkAVKRWrw97KwZy5nVf' then 'Legend'when 'onePMfirJs2Rx3eixoPnjY6NHiaC74pkQ2k313K2Lxs' then 'One'when 'SportGmqffp9zC3VZV7Wwz6s2nCkEB5Q3nVwKGU4esD' then 'Sport'else 'Other'end as rarity, approx_distinct(tx_id) as plays, approx_distinct(to_owner) as unique_players, count(*) as cards_distributedfrom tokens_solana.transferswhere block_date >= (select cutoff from checkpoint)and action = 'transfer'and outer_executing_account = 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s'and amount_display is nulland symbol is nulland from_owner in ('Low6UekJP3QrFVMfNRTL8CPK2SiGFhvp57sgF2pkmVu', 'Lowq9dkpY43VpjfYeRjtKfGA6JtB7HaMmwQgXkjHLvN', 'EpicWWZspT1trKndbDDr29ULViN56rN5vofWSKZp8ePF', 'HighJBfnAaqH9cKkeMErQFJZ4ATxQJwxqFupX6zaKTns', 'Mid9NeCpPNxP59fAdsLgMLy7BYexxXFw52ZP58Jrney', 'miDtj3vgdxVykHzRyFwyG8MXpvK8eQqamSLVdBr7WPt', 'HiGHqwYddP5N2waqUmXPdaASpMpUEvfqPr2fSawctEb', 'onePMfirJs2Rx3eixoPnjY6NHiaC74pkQ2k313K2Lxs', 'epiC3zkqa1RfcPMMM1Kc8m3GZGDwF2RmjbfA3g1BBjn', 'LGNDXqcm6U57QQ6Ad7icZ6oizkAVKRWrw97KwZy5nVf', 'SportGmqffp9zC3VZV7Wwz6s2nCkEB5Q3nVwKGU4esD')and to_owner not in ('Low6UekJP3QrFVMfNRTL8CPK2SiGFhvp57sgF2pkmVu', 'Lowq9dkpY43VpjfYeRjtKfGA6JtB7HaMmwQgXkjHLvN', 'EpicWWZspT1trKndbDDr29ULViN56rN5vofWSKZp8ePF', 'HighJBfnAaqH9cKkeMErQFJZ4ATxQJwxqFupX6zaKTns', 'Mid9NeCpPNxP59fAdsLgMLy7BYexxXFw52ZP58Jrney'