scottincryptoLido stETH APR
    Updated 2023-01-28
    select
    block_timestamp
    , date_trunc('day', block_timestamp) as block_day
    , block_number
    , event_inputs:postTotalPooledEther / 1e18 as postTotalPooledEther
    , event_inputs:preTotalPooledEther / 1e18 as preTotalPooledEther
    , event_inputs:timeElapsed as timeElapsed
    , event_inputs:totalShares / 1e18 as totalShares
    , (postTotalPooledEther - preTotalPooledEther) * (86400 * 365) / (preTotalPooledEther * timeElapsed) as protocol_apr
    , 1000 / 10000 as lidoFeeAsFraction
    , protocol_apr * (1 - lidoFeeAsFraction) as user_apr
    from ethereum.core.fact_event_logs
    where 1=1
    and contract_address = lower('0x442af784A788A5bd6F42A01Ebe9F287a871243fb')
    and block_timestamp > current_date - interval '90 days'
    and event_name = 'PostTotalShares'
    order by block_number


    Run a query to Download Data