Mrfti2023-06-14 06:28 PM
    Updated 2023-11-07
    with
    alltbl1 AS (
    with
    alltbl AS (
    with
    general as (
    with
    tbl1 as (
    select
    date_trunc(day, block_timestamp) as date,
    tx_hash,
    contract_address,
    event_name
    from
    polygon.core.ez_decoded_event_logs
    where
    contract_address = lower('0xba12222222228d8ba445958a75a0704d566bf2c8') --balancer contract
    and block_timestamp >= '2023-05-01'
    and event_name = 'PoolBalanceChanged'
    and decoded_log:poolId = '0xf0ad209e2e969eaaa8c882aac71f02d8a047d5c2000200000000000000000b49' -- gyroscope eclp contract
    ),
    tbl2 as (
    SELECT
    date_trunc(day, block_timestamp) as date,
    from_address,
    symbol,
    amount,
    amount_usd
    from
    polygon.core.ez_token_transfers
    WHERE
    tx_hash in (
    select
    tx_hash
    FROM
    tbl1
    Run a query to Download Data