CryptoIcicle157.Terra-State of the State - Top 10
    Updated 2022-03-05
    -- Payout 0.59 LUNA
    -- Grand Prize 1.77 LUNA
    -- Level Beginner


    -- Question 157: Many bounties come from Terra clients. This time, Flipside is the client!
    -- Review the existing Terra Console for accuracy: https://consoles.flipsidecrypto.com/terra/overview/index
    -- Accuracy: Are there any data errors you can identify?
    -- Usefulness: Is there anything missing that would be critical for new users to Terra?
    -- For Definition, describe the process you used to check the data.
    -- For Completeness, make your case for what needs to be included that is currently lacking.

    with top_10_rewards as (
    select
    validator_address_label,
    sum(event_amount_usd) as rewards,
    avg(event_amount_usd) as avg_rewards,
    count(delegator) as n_delegators
    from terra.reward
    where block_timestamp >= CURRENT_DATE - 30
    and validator_address_label is not null
    group by validator_address_label
    order by rewards desc
    limit 10
    )

    select * from top_10_rewards
    Run a query to Download Data