ArioAvax Price Vs Net BTC Bridge
    Updated 2023-02-18
    with mint as (
    select
    BLOCK_TIMESTAMP,
    tx_hash,
    TO_ADDRESS,
    RAW_AMOUNT/pow(10, 8) as BTC_amount
    from avalanche.core.fact_token_transfers
    where 1=1
    and CONTRACT_ADDRESS = '0x152b9d0fdc40c096757f570a51e494bd4b943e50'
    and from_address = '0x0000000000000000000000000000000000000000'
    ),
    burn as (
    select
    BLOCK_TIMESTAMP,
    tx_hash,
    FROM_ADDRESS,
    RAW_AMOUNT/pow(10, 8) as BTC_amount
    from avalanche.core.fact_token_transfers
    where 1=1
    and CONTRACT_ADDRESS = '0x152b9d0fdc40c096757f570a51e494bd4b943e50'
    and to_address = '0x0000000000000000000000000000000000000000'
    ),
    BTC_price as (
    select
    date_trunc(day, HOUR)::date as date,
    avg(PRICE) as Price
    from ethereum.core.fact_hourly_token_prices
    where 1=1
    and symbol = 'WBTC'
    and HOUR >= '2022-01-01'
    group by 1
    ),
    avax_price as (
    select
    date_trunc(day, HOUR) as date,
    avg(PRICE) as "AVAX Price",
    Run a query to Download Data