kidaMultichain Volume by Category (Avalanche)
    Updated 2023-01-04
    with
    weth_prices as (
    select
    date(hour) as date,
    decimals,
    symbol,
    token_address,
    avg(price) as price
    from ethereum.core.fact_hourly_token_prices
    where symbol = 'WETH'
    group by date, decimals, symbol, token_address
    ),
    vaults as (
    select distinct
    tx_json:to as vault_address
    from avalanche.core.fact_transactions
    where
    from_address = lower('0xfa9da51631268a30ec3ddd1ccbf46c65fad99251')
    and left(tx_json:input, 10) = '0x2ebe3fbb' -- init vault
    ),

    prices as (
    select
    date(block_timestamp) as date,
    token_in as token_address,
    symbol_in as symbol,
    avg(amount_in_usd / amount_in) as price
    from avalanche.sushi.ez_swaps
    group by 1, 2, 3
    ),

    sourceTxHashes as (
    select distinct
    tx_hash
    from avalanche.core.fact_event_logs
    Run a query to Download Data