connorhPolygon Plasma Bridge
    Updated 2021-10-07
    -- Bridged Amounts to Polygon
    select DATE(block_timestamp) AS balance_date,
    CASE
    WHEN from_address = '0x401f6c983ea34274ec46f84d70b31c151321188b' THEN 'LeavingPolygon'
    ELSE 'EnteringPolygon'
    END AS direction,
    --LOWER(COALESCE(event_inputs:depositReceiver,event_inputs:exitor)) AS user_address,
    SUM(CASE
    WHEN from_address = '0x401f6c983ea34274ec46f84d70b31c151321188b' THEN amount_usd*-1
    ELSE amount_usd
    END) AS amount_usd
    from ethereum.udm_events
    where
    --event_name IN ('Transfer') AND
    (to_address = '0x401f6c983ea34274ec46f84d70b31c151321188b' OR from_address = '0x401f6c983ea34274ec46f84d70b31c151321188b') AND
    block_timestamp >= CURRENT_DATE - 360
    GROUP BY 1,2

    Run a query to Download Data