Diako999Aurora_block_stats
    Updated 2023-02-27
    with
    transactions as (
    select
    date_trunc('day', block_timestamp) as date,
    count(distinct (tx_hash)) as transactions,
    tx_hash
    from
    near.core.fact_transactions
    where
    block_timestamp >= '2023-02-5'
    group by
    date,
    tx_hash
    order by
    date desc
    ),
    transfers as (
    select
    date_trunc('day', b.block_timestamp) as date,
    b.tx_hash as transaction
    from
    near.core.fact_transfers b
    join transactions on b.tx_hash = transactions.tx_hash
    ),
    swaps as (
    select
    date_trunc('day', c.block_timestamp) as swaped_date,
    c.tx_hash as tx_swap,
    c.block_id as block
    from
    transfers
    join near.core.ez_dex_swaps c on transfers.transaction = c.tx_hash
    where
    c.token_in = 'AURORA'
    or c.token_out = 'AURORA'
    group by