pavlyshyn2023-04-27 12:59 PM
    select
    validator_index,
    validator_pubkey,
    delegator,
    contract,
    activation_epoch,
    last_epoch_rewards,
    multiIf (
    contract = '0x55032650b14df07b85bf18a3a3ec8e0af2e028d5',
    'Lido',
    contract = '0x00000000219ab540356cBB839Cbe05303d7705Fa',
    'evertake_pool',
    contract = '0x6fd52c731826775aA15E7852A2f805cC189e2874',
    'Everstake_B2B',
    'B2C'
    ) as
    type,
    'ETH' AS currency,
    balance,
    balance_lag,
    multiIf(
    balance - balance_lag > 0,
    balance - balance_lag,
    balance - balance_lag < 0
    and withdrawal_lag != 0,
    balance - balance_lag + withdrawal_lag,
    balance - balance_lag + withdrawal_amount < 0,
    balance - balance_lag + withdrawal_lag,
    0
    ) as amount,
    withdrawal_amount,
    withdrawal_lag,
    Date,
    toDateTime(epoch_end) as created_at
    from
    (
    Run a query to Download Data