BlockTrackerBreaking down usage copy
    Updated 2023-11-07
    -- forked from Breaking down usage @ https://flipsidecrypto.xyz/edit/queries/7b33b61e-a95a-4f0f-8a55-9c6dbc43db2c

    --Average + median swap amount
    --% of users who have used Squid more than once
    --Overall % of expressed vs. regular transactions **
    --Broken down by chain
    --Broken down by tx size (<$10, $10-250, $250-$1000, >1000)

    with users_more_than_one as (
    SELECT
    sender,
    count(DISTINCT tx_hash) as n_txs,
    AVG(amount) as avg_vol,
    PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY amount) as median_vol,
    CASE when n_txs <= 1 then 'one interact'
    when n_txs >1 then 'more than one interact' end as collect
    FROM axelar.core.ez_squid
    GROUP BY 1
    )
    SELECT
    collect,
    avg(avg_vol) as avg_volume,
    median(median_vol) as median_volume,
    count(sender) as users
    FROM users_more_than_one
    GROUP BY 1




    /* users with having regular tx_hash

    WITH ranked_transactions as (
    SELECT
    date_trunc('day', block_timestamp) as date,
    sender,
    Run a query to Download Data