CryptoIcicleTerra - 11. 2.Back to Basics: Account Activity - 2. Top Active
    Updated 2023-01-29
    -- The question of “active wallets” faces every ecosystem. Let’s investigate this question for Terra —
    -- and go beyond the “one transaction in 30 days” approach!
    -- Define what an active, high quality user looks like and how it can be measured.
    -- Assess how many active users exist on Terra, according to your definition.
    -- Additionally, provide a few brief, specific ideas to attract additional users, as well as an assessment of what it would cost to implement these ideas.
    -- What is the acquisition cost for a high-value user, according to your recommendations?
    -- Basis of Payment:
    -- To be eligible for payment.
    -- The submission must be sent before the deadline indicated on the bounty page.
    -- The submission must score a minimum of 6 points according to the Evaluation Criteria.
    -- LUNA Payouts:
    -- First place 400$ in LUNA
    -- Second place 150$ in LUNA
    -- Third place 150$ in LUNA
    -- 4th through 15th place 75$ in LUNA
    -- 16th through 21st place 50$ in LUNA
    -- Payments are issued on the Terra mainnet network.

    with stakers as(
    select
    date_trunc('{{date_range}}',block_timestamp) as date,
    'staker' as type,
    delegator_address as wallet,
    count(distinct tx_id) as n_txns,
    sum(amount) as token_amount,
    sum(n_txns) over (partition by wallet order by date asc rows between unbounded preceding and current row) as cum_n_txns,
    sum(token_amount) over (partition by wallet order by date asc rows between unbounded preceding and current row) as cum_token_amount
    from terra.core.ez_staking
    where action = 'Delegate'
    and block_timestamp >= CURRENT_DATE - {{n_days_before}}

    group by date, wallet
    order by date desc
    ),
    swappers as (
    select
    Run a query to Download Data