adriaparcerisasmore markets supply and withdraw
    Updated 2025-04-09
    WITH supply AS (
    SELECT
    tx_hash,
    date_trunc('week', block_timestamp) as week,
    block_timestamp,
    origin_from_address as wallet,
    utils.udf_hex_to_int(data) / pow(10, CASE
    WHEN topic_2 IN ('0x000000000000000000000000d10cd10260e87efdf36618621458eeaa996b8267','0x00000000000000000000000002bf4bd075c1b7c8d85f54777eaaa3638135c059','0x000000000000000000000000ad412305cf8ad9545759466f3d889438598f773f') THEN 18
    ELSE 6
    END) as amount,
    CASE
    WHEN topic_2 ='0x000000000000000000000000d10cd10260e87efdf36618621458eeaa996b8267' THEN 'ankrFLOWEVM'
    WHEN topic_2='0x00000000000000000000000002bf4bd075c1b7c8d85f54777eaaa3638135c059' THEN 'WFLOW'
    WHEN topic_2='0x000000000000000000000000e43fe00aea059f3a756cf556655b5a27faf9bec5' THEN 'USDF'
    WHEN topic_2='0x00000000000000000000000049c6b2799af2db7404b930f24471dd961cfe18b7' THEN 'stgUSDC'
    WHEN topic_2='0x000000000000000000000000ad412305cf8ad9545759466f3d889438598f773f' THEN 'WETH'
    END as token
    FROM flow.core_evm.fact_event_logs
    WHERE origin_function_signature in ('0x617ba037','0x474cf53d')
    AND tx_succeeded='TRUE'
    AND topic_0='0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
    AND topic_2 IN (
    '0x000000000000000000000000d10cd10260e87efdf36618621458eeaa996b8267',
    '0x00000000000000000000000002bf4bd075c1b7c8d85f54777eaaa3638135c059',
    '0x000000000000000000000000e43fe00aea059f3a756cf556655b5a27faf9bec5',
    '0x00000000000000000000000049c6b2799af2db7404b930f24471dd961cfe18b7',
    '0x000000000000000000000000ad412305cf8ad9545759466f3d889438598f773f'
    )
    ),

    withdraw AS (
    SELECT
    tx_hash,
    date_trunc('week', block_timestamp) as week,
    block_timestamp,
    origin_from_address as wallet,
    QueryRunArchived: QueryRun has been archived