patryk-czmochowskiPRISM farm - rewards claimed per type over time
    Updated 2022-07-07
    SELECT
    block_timestamp :: datetime,
    CASE
    WHEN event_attributes : claim_type :: string = 'Prism'
    THEN event_attributes : "to" :: string
    WHEN event_attributes : claim_type :: string = 'Xprism'
    THEN event_attributes : "1_to" :: string
    WHEN event_attributes : claim_type :: string = 'Amps'
    THEN event_attributes : "user" :: string
    ELSE NULL
    END as farmer_wallet_address,
    event_attributes : claim_type :: string as claim_type,
    event_attributes : prism_reward_claimed :: integer /1000000 as prism_reward_claimed
    FROM terra.msg_events
    WHERE chain_id = 'columbus-5'
    AND block_id > 7135000
    AND event_attributes : prism_reward_claimed :: integer > 0
    ORDER BY tx_id ASC, event_index ASC


    /*

    SELECT
    block_id,
    block_timestamp,
    tx_id,
    msg_value : sender :: string as sender,
    msg_value : contract :: string as contract,
    msg_value : execute_msg :: string as execute_msg,
    msg_value : execute_msg : claim_withdrawn_rewards : claim_type :: string as claim_type
    FROM terra.msgs
    WHERE chain_id = 'columbus-5'
    AND msg_value : contract :: string = 'terra1ns5nsvtdxu53dwdthy3yxs6x3w2hf3fclhzllc' -- PRISM farming contract
    AND msg_value : execute_msg :: string LIKE '%claim_withdrawn_rewards%'
    --LIMIT 100
    Run a query to Download Data