connorhCompound COMP Paid Out
    Updated 2022-05-03
    -- COMP is paid out by the Comptroller to Users and Suppliers of the protocol
    -- let's look at how much is paid out each day in explicit 'Claim's vs other distributions

    SELECT
    DATE(block_timestamp) AS date,
    CASE WHEN origin_function_name = 'claimComp' THEN 'COMP Claimed' ELSE 'Distributed' END AS label,
    COUNT(1) AS n_txns,
    SUM(amount) AS claimed_comp,
    SUM(amount_usd) AS claimed_comp_usd
    FROM ethereum.udm_events
    WHERE block_timestamp >= CURRENT_DATE - 40
    AND contract_address = '0xc00e94cb662c3520282e6f5717214004a7f26888' -- COMP
    AND from_address = '0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b' -- comptroller
    --AND origin_function_name = 'claimComp' -- event corresponding to claiming comp https://compound.finance/docs/comptroller#claim-comp
    GROUP BY 1,2
    ORDER BY 1,2 DESC
    Run a query to Download Data