vendetta5 - In - depth analysis of type Bridge coins copy
    Updated 2023-02-24
    -- forked from 961118a7-9667-4207-a8d6-9223bdf20a72

    with meta_address AS
    (
    SELECT
    TRADER AS unique_trader
    , min(BLOCK_TIMESTAMP)::date as min_date
    FROM
    osmosis.core.fact_swaps
    WHERE
    BLOCK_TIMESTAMP::date >= '2022-12-01'
    GROUP BY
    unique_trader
    )

    SELECT
    min_date

    , sum( os_price.price ) AS total_price
    , CASE
    when os_tokens.project_name = 'AVAX' then 'AVAX'
    when os_tokens.project_name = 'BNB' then 'BNB'
    when os_tokens.project_name = 'BUSD' then 'BUSD'
    END
    AS coin

    , count( DISTINCT os_swap.trader ) AS total_trader
    , sum( total_trader ) over ( PARTITION BY coin ORDER BY min_date ASC) as cumulative_trader

    , count( DISTINCT os_swap.tx_id ) AS total_swap
    , sum( total_swap ) over ( PARTITION BY coin ORDER BY min_date ASC) as cumulative_swap

    FROM
    osmosis.core.fact_swaps AS os_swap

    INNER JOIN
    Run a query to Download Data