alirsalgo price
    Updated 2022-07-14
    WITH App_Calls AS
    (
    SELECT
    case
    when app_id in (776179559,776176449,752770929,751285119,747239433,747237154,743685742,743679535,696044550,694464549,694405065,686876641,
    686875498,686862190,686860954,686501760,686500844,686500029,686498781) then 'Folks finance'
    when app_id in (705663269,705657303,674527132,661247364,661207804,661204747,661199805,661193019,661192413,659678644,659677335,658337046,658336870,
    647785804,647785158,641500474,641499935,639747739,639747119,611869320,553866305,482625868,465814222,465814065,674526408,637795072,637793356,
    635866213,635864509,635863793,635860537,635813909,635812850,611867642,611804624,611801333,605753404,553869413,482608867,465818260,465814318,
    465814278,465814149,465814103) then 'algoFi'
    when app_id in (649588853 ,350338509,552635992) then 'Tinyman'
    when app_id in (354073718 ,354073834 ) then 'AlgoDEX'
    else
    'Other Defi Apps'
    end as App_Type
    ,block_timestamp::date as DAY, fee,tx_id,tx_group_id
    FROM
    flipside_prod_db.algorand.application_call_transaction
    WHERE
    block_timestamp::date >= '2022-04-01' AND
    ( app_id in (776179559,776176449,752770929,751285119,747239433,747237154,743685742,743679535,696044550,694464549,694405065,686876641,
    686875498,686862190,686860954,686501760,686500844,686500029,686498781) or
    app_id in (705663269,705657303,674527132,661247364,661207804,661204747,661199805,661193019,661192413,659678644,659677335,658337046,658336870,
    647785804,647785158,641500474,641499935,639747739,639747119,611869320,553866305,482625868,465814222,465814065,674526408,637795072,637793356,
    635866213,635864509,635863793,635860537,635813909,635812850,611867642,611804624,611801333,605753404,553869413,482608867,465818260,465814318,
    465814278,465814149,465814103)or
    app_id in (649588853 ,350338509,552635992) or
    app_id in (354073718 ,354073834 ) )
    ), join_tx as(
    select block_timestamp::date as date, tx.tx_id as j_tx_id,app_type
    from flipside_prod_db.algorand.transactions tx join app_calls apc using(tx_group_id))
    select date, price_usd as Algo_Price,count(DISTINCT j_tx_id) as Trasactions_count, sum(price_usd)as price from join_tx join flipside_prod_db.algorand.prices_swap sw on join_tx.date=sw.BLOCK_HOUR
    Run a query to Download Data