mlhWhat percentage of lenders farm their lending position for extra yield?
    Updated 2022-07-20
    WITH lender_count AS (
    select count(depositor) as lenders_count
    from (select distinct depositor
    from ethereum.sushi.ez_lending
    where action = 'Deposit'
    )
    ),

    staker_count as (
    select count(distinct origin_from_address) as stakers_count
    from ethereum.core.fact_event_logs tx
    where origin_from_address IN (SELECT *
    from (select distinct depositor
    from ethereum.sushi.ez_lending
    where action = 'Deposit'
    )
    )
    and origin_to_address = '0xc2edad668740f1aa35e4d8f227fb8e17dca888cd'
    and contract_name ilike '%MasterChef%'
    and event_name ilike '%deposit%'
    )

    select (stakers_count/lenders_count)*100 as restaking
    from lender_count, staker_count
    Run a query to Download Data