boomer77140 terra
    Updated 2022-01-31
    --terra1dzhzukyezv0etz22ud940z7adyv7xgcjkahuun beth
    --terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp bluna

    select date_trunc('day', block_timestamp) as dt, currency, case
    when currency = 'terra1dzhzukyezv0etz22ud940z7adyv7xgcjkahuun' then 'bETH'
    when currency = 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp' then 'bLUNA'
    else null end as bAssets,
    sum(amount) as basset_amount,
    sum(amount_usd) as usd_amount,
    count(distinct tx_id) as tx_count,
    count(distinct sender) as sender_count
    from anchor.collateral
    where event_type = 'provide' and block_timestamp >= CURRENT_DATE - 90
    group by 1,2
    Run a query to Download Data