Query editor
-- inspiration https://dune.com/queries/4231919-- EURe is traded on eth, gnosis and polychain.-- what's the transaction size of euro denominated transactions? Does it become more popular to use EURe (volume go up)?-- 0x4822521E6135CD2599199c83Ea35179229A172EE, -- Gnosis Pay aggregator ("to field")-- 0x3d4fd6a1a7a1382ae1d62c3dd7247254a0236847 -- Gnosis Pay sales address ("to field")with transfers as (select date_trunc('week', evt_block_time) as week, value/1e18 as amount_EUR, amount, evt_tx_hash, evt_tx_to, evt_tx_from, "from", "to",casewhen "to" = 0x4822521E6135CD2599199c83Ea35179229A172EE then 'Gnosis_Pay_aggregator'when "to" = 0x3d4fd6a1a7a1382ae1d62c3dd7247254a0236847 then 'Gnosis_Pay_sales_address'else 'other' end as evt_tx_to_catfrom monerium_eure_multichain.eure_evt_transfer)SELECTweek,-- Regular weekly aggregations happen firstavg(amount_EUR) as avg_EURe,variance(amount_EUR) as var_EURe,approx_percentile(amount_EUR, 0.5) as median_EURe,count("from") as nbr_users,count(DISTINCT "from") as nbr_unique_users,count(*) as nbr_tx,-- 30-day (4-week) moving averages over the weekly aggregationsavg(avg(amount_EUR)) over (partition by evt_tx_to_cat order by week asc rows between 3 PRECEDING and current row) AS avg_EURe_30d,variance(avg(amount_EUR)) over (partition by evt_tx_to_cat order by week asc rows between 3 PRECEDING and current row) AS var_EURe_30d,approx_percentile(avg(amount_EUR), 0.5) over (partition by evt_tx_to_cat order by week asc rows between 3 PRECEDING and current row) AS med_EURe_30d,sum(count("from")) over (partition by evt_tx_to_cat order by week asc rows between 3 PRECEDING and current row) AS count_user_30d,sum(count(DISTINCT "from")) over (partition by evt_tx_to_cat order by week asc rows between 3 PRECEDING and current row) AS count_unique_user_30d,sum(count(*)) over (partition by evt_tx_to_cat order by week asc rows between 3 PRECEDING and current row) AS count_tx_30d,evt_tx_to_cat as categoryFROM transfersGROUP BY week, evt_tx_to_catORDER BY week DESC