kidaConnext LP Activities
    Updated 2023-01-05
    with
    weth_prices as (
    select
    date(block_timestamp) as date,
    replace(feed_name, ' / USD') as symbol,
    median(coalesce(latest_answer_adj, latest_answer_unadj / pow(10,8))) as price --using median cause there will be some nulls / zeroes
    from ethereum.chainlink.ez_oracle_feeds
    where feed_category = 'Cryptocurrency (USD pairs)'
    and feed_name in ('ETH / USD')
    group by 1,2
    order by 1
    ),
    bnb_prices as (
    select
    date(block_timestamp) as date,
    replace(feed_name, ' / USD') as symbol,
    median(coalesce(latest_answer_adj, latest_answer_unadj / pow(10,8))) as price --using median cause there will be some nulls / zeroes
    from ethereum.chainlink.ez_oracle_feeds
    where feed_category = 'Cryptocurrency (USD pairs)'
    and feed_name in ('BNB / USD')
    group by 1,2
    order by 1
    ),
    matic_prices as (
    select
    date(block_timestamp) as date,
    replace(feed_name, ' / USD') as symbol,
    median(coalesce(latest_answer_adj, latest_answer_unadj / pow(10,8))) as price --using median cause there will be some nulls / zeroes
    from ethereum.chainlink.ez_oracle_feeds
    where feed_category = 'Cryptocurrency (USD pairs)'
    and feed_name in ('MATIC / USD')
    group by 1,2
    order by 1
    ),
    Run a query to Download Data