zakkisyed1. Anchor Collateralisation in USD
    Updated 2022-01-31
    select (CASE currency
    WHEN 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp' THEN 'bluna'
    WHEN 'terra1dzhzukyezv0etz22ud940z7adyv7xgcjkahuun' THEN 'beth'

    END) as currency,
    event_type,
    sum(amount_usd)
    FROM
    anchor.collateral
    where

    -- block_timestamp >= CURRENT_DATE-90
    -- and
    currency = 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp' --as 'bluna' --bluna

    or currency = 'terra1dzhzukyezv0etz22ud940z7adyv7xgcjkahuun' --as 'beth'--beth

    and event_type ='provide'
    or event_type ='withdraw'

    /*CASE when currency='terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp' then 'bLUNA'
    ELSE 'bETH'*/
    group by 1,2

    Run a query to Download Data