ramishoow2023-04-05 01:30 PM
    Updated 2023-04-05
    with rami as ( SELECT block_timestamp as dt, tx_hash, decoded_log:amount / 1e18 as royalty, decoded_log:collection as collection
    from avalanche.core.ez_decoded_event_logs where origin_to_address = '0xae079eda901f7727d0715aff8f82ba8295719977' and event_name in ('RoyaltyPayment')
    and tx_status = 'SUCCESS' ) SELECT name, round(avg(royalty), 2) as "avg fee", round(sum(royalty), 2) as "royalty fee", count(tx_hash) as "txs" from
    rami s LEFT join avalanche.core.dim_contracts a on s.collection = a.address GROUP by 1 order by 2 DESC LIMIT 20

    Run a query to Download Data