c2ctrader02 - Borrow: Algo, gAlgo3, USDC, USDT, goETH (No. and Volume of Transactions)
    Updated 2022-06-26
    --Number and Volume of borrow transactions
    with deposit_algo as (
    select date_trunc('day',BLOCK_TIMESTAMP) day, sum(amount) vol, count(*) Ntx
    from flipside_prod_db.algorand.transfers
    where asset_sender = 'AV6PFVXWDQ7RVNQYOEXCWXCLXVJ5V57WVMVQZ2TWH4EKTB7GSWKUIAUPXQ' and amount > 0
    group by day, asset_sender
    order by day
    ),

    algo_price_usd as (
    select date_trunc('day',BLOCK_HOUR) day, avg(price_usd) price
    from flipside_prod_db.algorand.prices_swap
    where price_usd > 0 and
    asset_id = 0
    group by day
    order by day
    ),

    algo as (
    select deposit_algo.day, deposit_algo.vol * algo_price_usd.price vol, deposit_algo.Ntx
    from deposit_algo
    join algo_price_usd on deposit_algo.day = algo_price_usd.day
    ),

    deposit_usdc as (
    select date_trunc('day',BLOCK_TIMESTAMP) day, sum(amount) vol, count(*) Ntx
    from flipside_prod_db.algorand.transfers
    where asset_sender = 'ILER7WB5L46KQ5XV4QXT2WLWV4OOVDKSOEK6PSJ5YQYNQ6ZFRM2SJH54UY' and amount > 0
    group by day, asset_sender
    order by day
    ),

    deposit_usdt as (
    select date_trunc('day',BLOCK_TIMESTAMP) day, sum(amount) vol, count(*) Ntx
    from flipside_prod_db.algorand.transfers
    where asset_sender = 'CO73GSVE53EEHFAKFTVKIJKKYZ52SJ24EJUKCH5ZUMHVIQYLAT7W5QQ2Y4' and amount > 0
    Run a query to Download Data