Yousefi_1994Rebase rewards
    Updated 2022-07-03
    with all_rebase_rewards as (
    select
    from_address as wallet_address,
    count(distinct tx_hash) as number_of_tx,
    sum((tx_json:receipt:logs[2]:decoded:inputs:value::float)/1e9) as amount
    from ethereum.core.fact_transactions
    where origin_function_signature = '0xaf14052c'
    and to_address = '0x759c6de5bca9ade8a1a2719a31553c4b7de02539'
    and status = 'SUCCESS'
    group by wallet_address
    having amount is not null
    order by amount desc
    ),
    stake as (
    select
    from_address as wallet_address,
    count(distinct tx_hash) as number_of_stake,
    sum((tx_json:receipt:logs[0]:decoded:inputs:value::float)/1e9) as stake_amount
    from ethereum.core.fact_transactions
    where origin_function_signature = '0xd866c9d8'
    and to_address = '0x759c6de5bca9ade8a1a2719a31553c4b7de02539'
    and status = 'SUCCESS'
    and block_timestamp::date >= current_date - 90
    group by wallet_address
    having stake_amount is not null
    order by stake_amount desc
    ),
    unstake as (
    select
    from_address as wallet_address,
    count(distinct tx_hash) as number_of_unstake,
    sum((tx_json:receipt:logs[1]:decoded:inputs:value::float)/1e9) as unstake_amount
    from ethereum.core.fact_transactions
    where origin_function_signature = '0x990966d5'
    and to_address = '0x759c6de5bca9ade8a1a2719a31553c4b7de02539'
    and status = 'SUCCESS'
    Run a query to Download Data