nimasadjadiBridge destinations events
    Updated 2022-07-30
    WITH eth_user AS
    (
    SELECT
    ORIGIN_FROM_ADDRESS,
    TX_HASH,
    EVENT_NAME,
    BLOCK_TIMESTAMP
    FROM ethereum.core.fact_event_logs
    WHERE ORIGIN_TO_ADDRESS = '0xa0c68c638235ee32657e8f720a23cec1bfc77c77'
    ),
    First_destination AS (
    SELECT
    BLOCK_TIMESTAMP,
    CONTRACT_NAME,
    EVENT_NAME,
    TX_HASH,
    ORIGIN_FROM_ADDRESS,
    ORIGIN_TO_ADDRESS
    FROM polygon.core.fact_event_logs
    ),
    combine AS (
    SELECT
    a.origin_from_address,
    b.tx_hash,
    b.event_name,
    b.contract_name,
    b.origin_to_address,
    b.block_timestamp
    FROM eth_user a INNER JOIN First_destination b ON a.origin_from_address = b.origin_from_address
    WHERE b.block_timestamp > a.block_timestamp

    ),
    rank AS (
    SELECT
    date_trunc('day', block_timestamp) as day,
    event_name,
    Run a query to Download Data