Mrftiharsh-apricot copy copy copy
    Updated 2 hours ago
    -- forked from harsh-apricot copy copy @ https://flipsidecrypto.xyz/studio/queries/ee6aa7b9-2df7-40e2-964d-6d5109f1e3be

    with tbl AS
    (
    SELECT
    REGEXP_SUBSTR(fee_msg['transition']['outputs'][0]['value'], 'aleo[\\w]+') AS "Address",
    sum (fee) as "Total fee ($Aleo)"
    FROM aleo.core.fact_transactions
    WHERE tx_succeeded = TRUE
    GROUP BY 1
    order by 2 desc
    )

    SELECT
    case
    when "Total fee ($Aleo)" < 0.1 then 'tier1: less than 0.1 $Aleo'
    when "Total fee ($Aleo)" >= 0.1 and "Total fee ($Aleo)" <= 0.5 then 'tier2: 0.1-0.5 $Aleo'
    when "Total fee ($Aleo)" > 0.5 and "Total fee ($Aleo)" <= 1 then 'tier3: 0.5-1 $Aleo'
    when "Total fee ($Aleo)" > 1 and "Total fee ($Aleo)" <= 5 then 'tier4: 1-5 $Aleo'
    when "Total fee ($Aleo)" > 5 then 'tier5: more than 5 $Aleo'
    end as "Tier",
    count (DISTINCT "Address") AS "Total Addresses"

    from tbl
    group by 1
    order by 2 desc


    Last run: about 2 hours agoAuto-refreshes every 12 hours