Moefffllllwww10*
    Updated 2023-01-11
    with prices as (select date(TIMESTAMP) date ,TOKEN_CONTRACT ID,
    avg(PRICE_USD) as price
    from
    flow.core.fact_prices
    where
    TIMESTAMP between '2022-12-01' and CURRENT_DATE -1

    group by 1,2

    )

    -- select
    -- 'Bridge out' as type ,
    -- date_trunc('day', BLOCK_TIMESTAMP)::date AS DAY,
    -- monthname(BLOCK_TIMESTAMP) AS Month,
    -- -1*sum(AMOUNT*price) AS Volume,
    -- -1*avg(AMOUNT*price) AS avg_Volume,
    -- -1*count(distinct FLOW_WALLET_ADDRESS) as Bridger,
    -- -1*count(distinct TX_ID) as txns
    -- from flow.core.ez_bridge_transactions s , prices p
    -- where direction ilike '%out%'
    -- and block_timestamp::date = date
    -- and TOKEN_CONTRACT = ID
    -- group by 2,3

    -- union all

    select
    monthname(BLOCK_TIMESTAMP) AS Month,
    sum(AMOUNT*price) AS Volume,
    avg(AMOUNT*price) AS avg_Volume,
    count(distinct FLOW_WALLET_ADDRESS) as Bridger,
    count(distinct TX_ID) as txns,
    Run a query to Download Data