kakamoraTransfers
    Updated 2022-07-11
    with celsius as (
    SELECT
    *
    FROM flipside_prod_db.crosschain.address_labels
    WHERE address_name ilike '%celsius%'
    ),
    swaps as (
    SELECT
    date_trunc(day, block_timestamp) as date,
    blockchain,
    symbol_in,
    symbol_out,
    symbol_in || '->' || symbol_out as pair,
    count(distinct tx_hash) as txns,
    sum(amount_out_usd) as volume
    FROM flipside_prod_db.crosschain.ez_swaps
    WHERE ORIGIN_FROM_ADDRESS IN (SELECT ADDRESS FROM celsius)
    and platform ='sushiswap'
    and block_timestamp >= CURRENT_DATE - 60
    GROUP BY date, blockchain, symbol_in, symbol_out
    ),

    borrowing as (
    SELECT
    *
    /*date_trunc(day, block_timestamp) as date,
    blockchain,
    action,
    ASSET,
    platform, */
    from flipside_prod_db.crosschain.ez_lending
    where depositor IN (SELECT ADDRESS FROM celsius)
    --and block_timestamp >= CURRENT_DATE - 60
    ),
    Run a query to Download Data