adriaparcerisasStablecoins on Osmosis 2
    Updated 2023-02-02
    WITH
    transactions as (
    SELECT
    block_timestamp,
    currency as token, tx_id, amount/pow(10,decimal) as volume, sender, receiver
    from osmosis.core.fact_transfers where tx_succeeded='TRUE' and block_timestamp>='2023-01-01'
    )
    SELECT --distinct project_name
    trunc(block_timestamp,'day') as date,
    project_name,
    count(distinct tx_id) as transfers,
    count(distinct sender) as transferrers,
    count(distinct receiver) as receptors,
    sum(volume)*avg(price) as volume_transferred
    from transactions x
    join osmosis.core.dim_labels y on x.token=y.address
    join osmosis.core.ez_prices z on y.address=z.currency and trunc(block_timestamp,'day')=trunc(recorded_hour,'day')
    where project_name in('USDC.grv','axlUSDC','USDT','DAI','DAI.grv','axlDAI','BUSD','EEUR','FRAX','USDC','USDT.grv','USDX','USK','USTC')
    group by 1,2
    order by 1 asc

    Run a query to Download Data