pine_samidaily fees
    Updated 2022-12-09
    with axlPrice as(
    SELECT
    median(open) as axlPrice
    FROM crosschain.core.fact_hourly_prices LEFT outer JOIN crosschain.core.dim_asset_metadata ON crosschain.core.fact_hourly_prices.id LIKE crosschain.core.dim_asset_metadata.id
    WHERE symbol ilike '%axl%'
    and RECORDED_HOUR>=CURRENT_DATE-60)
    select date_trunc('day',t1.BLOCK_TIMESTAMP) as datee,
    attribute_value as chain,
    sum(t2.FEE) as fee,
    sum(t2.FEE*(select axlPrice from axlPrice)) as usd
    FROM axelar.core.fact_msg_attributes t1 join axelar.core.fact_transactions t2 on t1.TX_ID=t2.TX_ID
    WHERE attribute_key = 'destinationChain'
    and t1.TX_SUCCEEDED='TRUE'
    and t1.BLOCK_TIMESTAMP>=CURRENT_DATE-60
    GROUP BY datee, chain
    Run a query to Download Data