Sajjadiii1.1 $MLS
    Updated 2022-09-22
    with price_tab as (
    select hour::date as date, avg(price) as matic_price
    from ethereum.core.fact_hourly_token_prices
    where symbol ='MATIC'
    group by 1
    ),

    xmatic as (
    select block_timestamp::date as date ,
    count (distinct tx_hash) as total_transaction,
    count (distinct origin_from_address) as total_users,
    sum (raw_amount/1e18) as total_matic,
    sum (raw_amount/1e18*matic_price) as total_usd_volume,
    min (raw_amount/1e18) as min_matic_volume,
    min (raw_amount/1e18*matic_price) as min_usd_volume,
    median (raw_amount/1e18) as median_matic_volume,
    median (raw_amount/1e18*matic_price) as median_usd_volume,
    avg (raw_amount/1e18) as average_matic_volume,
    avg (raw_amount/1e18*matic_price) as average_usd_volume,
    max (raw_amount/1e18) as max_matic_volume,
    max (raw_amount/1e18*matic_price) as max_usd_volume
    from polygon.core.fact_token_transfers a
    join price_tab b
    on a.block_timestamp::date = b.date
    where from_address = '0x0000000000000000000000000000000000000000'
    and contract_address =lower('0x3aD736904E9e65189c3000c7DD2c8AC8bB7cD4e3') -- superfluid.finance Matic (PoS)
    group by 1
    ),
    stmatic as (
    select block_timestamp::date as date ,
    count (distinct tx_hash) as total_transaction,
    count (distinct origin_from_address) as total_users,
    sum (raw_amount/1e18) as total_matic,
    sum (raw_amount/1e18*matic_price) as total_usd_volume,
    min (raw_amount/1e18) as min_matic_volume,
    Run a query to Download Data