Rodolfo-LimaFERT / AVAX (Dual)
    Updated 2024-12-27
    -- forked from FEED / AVAX (DUAL) @ https://flipsidecrypto.xyz/edit/queries/6c877046-89b7-4b14-a328-950958ec4932

    --FERT / AVAX (DUAL Rewards) 0x8a9a93D2deA7DEc5340DE4CdAFffb57a398E488b
    -- JLP is the LP token from Trader Joe, in this case, it is the FEED-WAVAX
    WITH out_tab AS (
    -- Tokens getting out of the pool
    SELECT
    DATE_TRUNC('{{Period}}',block_timestamp) AS date,
    tr.contract_address,
    SUM(amount_precise) AS amount_out
    FROM
    avalanche.core.ez_token_transfers tr
    WHERE
    from_address = LOWER('0x8a9a93D2deA7DEc5340DE4CdAFffb57a398E488b')
    AND contract_address IN (
    LOWER('0x3B90A467f58631369903c2005457a3d28d47f3E5')
    )
    GROUP BY 1,2
    ),

    in_tab AS (
    -- Tokens getting into of the pool
    SELECT
    DATE_TRUNC('{{Period}}',block_timestamp) AS date,
    tr.contract_address,
    SUM(amount_precise) AS amount_in
    FROM
    avalanche.core.ez_token_transfers tr
    WHERE
    to_address = LOWER('0x8a9a93D2deA7DEc5340DE4CdAFffb57a398E488b')
    AND contract_address IN (
    LOWER('0x3B90A467f58631369903c2005457a3d28d47f3E5')
    Last run: 3 months ago
    DATE
    CONTRACT_ADDRESS
    TOKEN
    AMOUNT_OUT
    AMOUNT_IN
    NET_AMOUNT
    TOKEN_BALANCE
    1
    2022-12-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP61788.638578605113374.39436874551585.7557901451585.75579014
    2
    2023-01-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP64907.22393449644410.264178503-20496.95975599331088.796034147
    3
    2023-02-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP13378.24100957611659.400188476-1718.840821129369.955213047
    4
    2023-03-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP9302.9525653038166.648670969-1136.30389433428233.651318713
    5
    2023-04-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP6317.30522378622005.01957082715687.7143470443921.365665754
    6
    2023-05-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP3517.0276146327585.8948461074068.86723147647990.232897229
    7
    2023-06-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP7425.2822202388326.767896406901.48567616848891.718573397
    8
    2023-07-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP2021.6325154224522.0014348662500.36891944451392.087492842
    9
    2023-08-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP10595.8999074586065.147494079-4530.75241337846861.335079464
    10
    2023-09-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP3065.1485603723820.341193199755.19263282747616.527712291
    11
    2023-10-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP2910.0339387045639.0899734572729.05603475350345.583747044
    12
    2023-11-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP70840.92871853767535.220861551-3305.70785698647039.875890058
    13
    2023-12-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP23557.7223840118145.588505415-5412.13387859541627.742011462
    14
    2024-01-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP17496.9025338417167.07693107-10329.82560277131297.916408691
    15
    2024-02-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP13285.98537917228352.7064169515066.72103777846364.63744647
    16
    2024-03-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP12161.9109758652769.941746037-9391.96922982836972.668216642
    17
    2024-04-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP1180.3567877891594.813096572414.45630878337387.124525425
    18
    2024-05-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP8569.580064156012.913437962-2556.66662618834830.457899237
    19
    2024-06-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP7578.34050943612250.4754547814672.13494534639502.592844582
    20
    2024-07-01 00:00:00.0000x3b90a467f58631369903c2005457a3d28d47f3e5JLP01264.1858353791264.18583537940766.778679961
    25
    3KB
    10s