amir007-Q63RX1USDC Transfers - Osmosis
    Updated 2022-11-21
    with price as
    (
    select recorded_at::date as date
    , avg(price) as avg_price
    from osmosis.core.dim_prices
    where recorded_at::date > current_date() - interval '{{TimePeriod}} {{PeriodType}}'
    and symbol = 'axlUSDC'
    group by 1
    ), raw_data as
    (
    select block_timestamp::date as date
    , sender
    , receiver
    , (amount / pow(10, decimal)) as amount
    , (amount / pow(10, decimal)) * avg_price as amount_usd
    from osmosis.core.fact_transfers trn
    join price prc on trn.block_timestamp::date = prc.date
    where block_timestamp::date > current_date() - interval '{{TimePeriod}} {{PeriodType}}'
    and currency = 'ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858' -- axlUSDC
    )
    select sum(amount_usd) as "Sum Amount ($)"
    , avg(amount_usd) as "Average Amount ($)"
    , count(distinct sender) as "Count of Wallet (#)"
    from raw_data

    Run a query to Download Data