afonsoWeekly average volume of outflow transactions
    Updated 2023-04-13
    select
    date_trunc('week', block_timestamp)::date as week,
    case
    when currency in ('terra1rcmvfsn77pd6m04ctqj3wcu66pvrw9p265cdl72w4zarfup2rv7qjxhkzl', 'ibc/CBF67A2BCF6CAE343FDF251E510C8E18C361FC02B23430C121116E0811835DEF') then 'axlUSDT'
    when currency in ('terra1uc3r74qg44csdrl8hrm5muzlue9gf7umgkyv569pgazh7tudpr4qdtgqh6', 'ibc/B3504E092456BA618CC28AC671A71FB08C6CA0FD0BE7C8A5B5A3E2DD933CC9E4') then 'axlUSDC'
    end as token,
    count(distinct tx_id) as txn_count,
    count(distinct sender) as users_count,
    sum(amount::number/pow(10, 6)) as total_amount,
    avg(amount::number/pow(10, 6)) as average_amount,
    median(amount::number/pow(10, 6)) as median_amount
    from terra.core.ez_transfers
    where 1 = 1
    and transfer_type = 'IBC_Transfer_Off'
    and currency in (
    'terra1uc3r74qg44csdrl8hrm5muzlue9gf7umgkyv569pgazh7tudpr4qdtgqh6',
    'ibc/CBF67A2BCF6CAE343FDF251E510C8E18C361FC02B23430C121116E0811835DEF',
    'ibc/B3504E092456BA618CC28AC671A71FB08C6CA0FD0BE7C8A5B5A3E2DD933CC9E4',
    'terra1rcmvfsn77pd6m04ctqj3wcu66pvrw9p265cdl72w4zarfup2rv7qjxhkzl'
    )
    and tx_succeeded = 1
    group by week, token
    order by week asc
    Run a query to Download Data