AnalyticSagesInflow, Outflow and Netflow
    Updated 2024-02-18
    with pricet as (
    SELECT
    HOUR::date as datex,
    TOKEN_ADDRESS,
    avg(price) as prices
    from ethereum.price.ez_hourly_token_prices
    where HOUR::date >= '2023-02-01'
    GROUP by 1,2),

    eth_to_starknet as (
    SELECT
    distinct tx_hash as txs,
    BLOCK_TIMESTAMP::date as date,
    --symbol,
    origin_from_address as users,
    AMOUNT_USD as volume
    from ethereum.core.ez_token_transfers
    --join pricet on BLOCK_TIMESTAMP::date = datex and TOKEN_ADDRESS = CONTRACT_ADDRESS
    where ORIGIN_TO_ADDRESS in (
    '0x9f96fe0633ee838d0298e8b8980e6716be81388d','0x659a00c33263d9254fed382de81349426c795bb6', --Dai
    '0xf6080d9fbeebcd44d89affbfd42f098cbff92816', --USDC
    '0xbb3400f107804dfb482565ff1ec8d8ae66747605', --USDT
    '0x283751a21eafbfcd52297820d27c1f1963d9b5b4' --WBTC
    )
    and ORIGIN_FUNCTION_SIGNATURE in ('0xe2bbb158','0xb6b55f25')

    UNION

    SELECT
    distinct tx_hash as txs,
    BLOCK_TIMESTAMP::date as date,
    --'ETH' as symbol,
    eth_from_address as users,
    AMOUNT_USD as volume
    from ethereum.core.ez_eth_transfers
    where ETH_TO_ADDRESS= '0xae0ee0a63a2ce6baeeffe56e7714fb4efe48d419'
    Last run: about 1 year ago
    DATE
    Eth to starknet users
    Eth to starknet txs
    Eth to starknet Volume
    starknet to Eth users
    starknet to Eth txs
    starknet to Eth Volume
    Net Flow Volume
    1
    2022-03-21 00:00:00.0001229.04
    2
    2022-04-26 00:00:00.0002558.78
    3
    2022-04-27 00:00:00.0002344.04
    4
    2022-04-28 00:00:00.0003717.37
    5
    2022-04-30 00:00:00.000115.5
    6
    2022-05-01 00:00:00.00037247.06
    7
    2022-05-04 00:00:00.000110.29
    8
    2022-05-05 00:00:00.0001387.6
    9
    2022-05-06 00:00:00.000111.1
    10
    2022-05-07 00:00:00.0001253.36
    11
    2022-05-08 00:00:00.0003331.19
    12
    2022-05-09 00:00:00.00025026711254.38
    13
    2022-05-10 00:00:00.0001581164075292.8
    14
    2022-05-11 00:00:00.00075677031937.859118
    15
    2022-05-12 00:00:00.00025428312373.738574
    16
    2022-05-13 00:00:00.000968101239433.42
    17
    2022-05-14 00:00:00.0001109117635905.86
    18
    2022-05-15 00:00:00.00063066718066.35
    19
    2022-05-16 00:00:00.0001404150251834.07
    20
    2022-05-17 00:00:00.000137139886.29
    ...
    662
    51KB
    58s