Afonso_Diaz2023-04-06 06:30 PM
    Updated 2023-04-06
    with
    t1 as (
    select
    recorded_at::date as date,
    symbol,
    address as currency,
    avg(price) as price_usd
    from osmosis.core.dim_prices
    join osmosis.core.dim_tokens
    on project_name = symbol
    group by 1, 2, 3
    ),

    t2 as (
    select
    a.block_timestamp,
    symbol,
    tx_id,
    sender,
    receiver,
    parse_json(attribute_value):amount/pow(10, decimal) as amount,
    price_usd * parse_json(attribute_value):amount/pow(10, decimal) as amount_usd
    from osmosis.core.fact_transfers a
    join osmosis.core.fact_msg_attributes b
    using(tx_id)
    join t1
    on date = date_trunc('day', a.block_timestamp)
    and a.currency = t1.currency
    where transfer_type = 'IBC_TRANSFER_OUT'
    and receiver like 'quasar%'
    and attribute_key = 'packet_data'
    )

    select
    sender,
    count(distinct tx_id) as transactions,
    Run a query to Download Data