KaskoazulUser Behaviour over time by tokens
    Updated 2022-06-20
    with swaps as (
    select block_timestamp::date as fecha,
    case token_in_contract
    when 'A.b19436aae4d94622.FiatToken' then 'USDC'
    when 'A.1654653399040a61.FlowToken' then 'FLOW'
    when 'A.cfdd90d4a00f7b5b.TeleportedTetherToken' then 'USDT'
    when 'A.d01e482eb680ec9f.REVV' then 'REVV'
    when 'A.3c5959b568896393.FUSD' then 'FUSD'
    when 'A.0f9df91c9121c460.BloctoToken' then 'BLT'
    when 'A.142fa6570b62fd97.StarlyToken' then 'STARLY'
    when 'A.475755d2c9dccc3a.TeleportedSportiumToken' then 'SPRT'
    end as token_for,
    count(tx_id) as swaps,
    sum(swaps) over (partition by token_for order by fecha) as cum_swaps
    from flow.core.fact_swaps
    group by 1,2
    order by 2 desc
    ),

    nft_sales as (
    select block_timestamp::date as fecha,
    count(tx_id) as nft_sales,
    sum(nft_sales) over (order by fecha) as cum_sales
    from flow.core.fact_nft_sales
    group by 1
    order by 1 desc
    ),

    event_borrows as (
    select block_timestamp::date as fecha,
    count(distinct tx_id) as txs,
    sum (txs) over (order by fecha) as cum_txs
    from flow.core.fact_events
    where (event_type = 'Borrow' or event_type = 'RepayBorrow')
    and tx_succeeded = TRUE
    group by 1
    Run a query to Download Data