SocioAnalyticainflow-- outflow
    Updated 2025-02-09


    with inflow as (
    SELECT
    'inflow' as type,
    date_trunc('d', block_timestamp) as date,
    sum(amount_usd) as volume
    FROM avalanche.core.ez_token_transfers
    WHERE to_address IN (SELECT address FROM avalanche.core.dim_labels where project_name ilike '%beefy%'
    )
    AND date >= dateadd('month', -12, current_date)
    GROUP BY date
    UNION
    SELECT
    'inflow' as type,
    date_trunc('d', block_timestamp) as date,
    sum(amount_usd) as volume
    FROM avalanche.core.ez_native_transfers
    WHERE to_address IN (SELECT address FROM avalanche.core.dim_labels where project_name ilike '%beefy%'
    )
    AND date >= dateadd('month', -12, current_date)
    GROUP BY date
    )
    ,
    outflow as (
    SELECT
    'outflow' as type,
    date_trunc('d', block_timestamp) as date,
    -1 * sum(amount_usd) as volume
    FROM avalanche.core.ez_token_transfers
    WHERE from_address IN (SELECT address FROM avalanche.core.dim_labels where project_name ilike '%beefy%'
    )
    AND date >= dateadd('month', -12, current_date)
    GROUP BY date
    UNION
    SELECT
    Last run: 3 months ago
    TYPE
    DATE
    VOLUME
    1
    inflow2024-06-12 00:00:00.000100293.425029309
    2
    inflow2024-07-17 00:00:00.00076.27
    3
    outflow2024-08-31 00:00:00.000-10492.49
    4
    outflow2024-03-11 00:00:00.000-45016.09
    5
    inflow2024-02-21 00:00:00.000113844.38
    6
    outflow2024-06-10 00:00:00.000-556894.913374797
    7
    inflow2024-07-26 00:00:00.000101793.225193965
    8
    outflow2024-08-04 00:00:00.000-35685.84
    9
    outflow2025-02-08 00:00:00.000-1.28
    10
    outflow2024-10-07 00:00:00.000-455561.079251759
    11
    outflow2024-03-23 00:00:00.000-29148.62
    12
    outflow2024-02-10 00:00:00.000-5508039.61335567
    13
    outflow2024-12-13 00:00:00.000-138589.764592716
    14
    outflow2024-04-09 00:00:00.000-5110027.77466194
    15
    outflow2024-03-01 00:00:00.000-3972330.58029442
    16
    outflow2024-07-19 00:00:00.000-1613.26
    17
    inflow2024-10-18 00:00:00.00082717.171919842
    18
    inflow2024-09-27 00:00:00.000213058.621777432
    19
    outflow2025-01-27 00:00:00.000-65308.722798301
    20
    outflow2024-06-09 00:00:00.000-4379.68
    ...
    1462
    72KB
    24s