MLDZMNAurory1
    Updated 2022-07-20
    with tb1 as (select
    BLOCK_TIMESTAMP::date as day,
    sum(SALES_AMOUNT) as vol_sale,
    count(tx_id) as number_sale,
    count(distinct PURCHASER) as number_purchaser

    from solana.core.fact_nft_sales x join solana.core.dim_nft_metadata y on x.mint=y.mint
    where CONTRACT_NAME='Aurory'
    and SUCCEEDED='TRUE'
    group by 1),

    tb2 as (with tx as (
    SELECT
    date(HOUR) as dt1,
    avg(PRICE) as price
    from ethereum.core.fact_hourly_token_prices p
    where SYMBOL='USDC'
    and dt1>=CURRENT_DATE-90
    group by 1
    ),

    tx2 as (select
    date_trunc('day',BLOCK_TIMESTAMP) as dt2,
    sum(SWAP_TO_AMOUNT)/sum(SWAP_FROM_AMOUNT) as usdc
    from flipside_prod_db.solana.fact_swaps
    where SUCCEEDED='TRUE'
    and SWAP_TO_MINT='EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
    and SWAP_FROM_MINT='AURYydfxJib1ZkTir1Jn1J9ECYUtjb6rKQVmtYaixWPP'
    and BLOCK_TIMESTAMP>=CURRENT_DATE-90
    group by 1)

    select
    tx2.dt2 as day,
    usdc,
    price,
    usdc*price as price_aurory
    Run a query to Download Data