Eman-RazTotal Number of Repayers
    Updated 2023-05-15
    select count(distinct origin_from_address) as Repayer_count, case
    when contract_address='0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9' then 'sUSD'
    when contract_address='0x7f5c764cbc14f9669b88837ca1490cca17c31607' then 'USDC' --6
    when contract_address='0xfe8b128ba8c78aabc59d4c64cee7ff28e9379921' then 'BAL'
    when contract_address='0x8700daec35af8ff88c16bdf0418774cb3d7599b4' then 'SNX'
    when contract_address='0xda10009cbd5d07dd0cecc66161fc93d7c9000da1' then 'DAI'
    when contract_address='0x4200000000000000000000000000000000000042' then 'OP'
    when contract_address='0x94b008aa00579c1307b0ef2c499ad98a8ce58e58' then 'USDT' --6
    when contract_address='0x68f180fcce6836688e9084f035309e29bf0a2095' then 'WBTC' --8
    end as token
    from optimism.core.fact_event_logs
    where (ORIGIN_FUNCTION_SIGNATURE='0x573ade81' and origin_to_address='0x8fd4af47e4e63d1d2d45582c3286b4bd9bb95dfe'
    and event_name='Transfer' and event_inputs:from=origin_from_address) -- Repay
    group by 2
    order by 1
    Run a query to Download Data