MeirHolders Old and New
    Updated 2023-06-28
    with rsr_contracts as (
    select
    lower('{{rsr_current}}') as contract_address ,
    'rsr_current' as name
    union all
    select
    lower('{{rsr_old}}') as contract_address,
    'rsr_old' as name
    ),


    current_holders as (
    SELECT
    CURRENT_BAL,
    USER_ADDRESS,
    USD_VALUE_NOW,
    'current' as view
    FROM ethereum.core.ez_current_balances
    WHERE CONTRACT_ADDRESS = lower('{{rsr_current}}')
    AND CURRENT_BAL > {{minimum_bal}}
    ),

    old_holders as (
    SELECT
    CURRENT_BAL,
    USER_ADDRESS,
    USD_VALUE_NOW,
    'old' as view
    FROM ethereum.core.ez_current_balances
    WHERE CONTRACT_ADDRESS = lower('{{rsr_old}}')
    AND CURRENT_BAL > {{minimum_bal}}
    ),

    token_transfers as (
    SELECT *
    FROM ethereum.core.fact_token_transfers
    Run a query to Download Data