Query editor
with raw_result AS(SELECT http_get('https://arbitrum-size-api.integral.link/api/v5/graph?network=Arbitrum'||'&tokenInAddress=0x82af49447d8a07e3bd95bd0d56f35241523fbab1'||'&tokenOutAddress=0xaf88d065e77c8cc2239327c5edb3a432268e5831&timeframe=1d') as raw_json),parsed_data AS (SELECT json_extract(json_parse(raw_json), '$.data') as parsed_json from raw_result),prices as(SELECT from_iso8601_timestamp(cast(json_extract(price_feeds, '$.timestamp') as varchar)) as datetime,cast(cast(json_extract(price_feeds, '$.twap') as varchar) as uint256) as twap_price,cast(cast(json_extract(price_feeds, '$.spot') as varchar) as uint256) as spot_priceFROM parsed_data,UNNEST(CAST(parsed_json AS array(json))) t(price_feeds)),trades as(select block_time,token_pair,amount_usd,taker,maker,tx_hash FROM dex.tradesWHERE blockchain = 'arbitrum'and project='integral'and token_bought_address=0xaf88d065e77c8cc2239327c5edb3a432268e5831and token_sold_address=0x82af49447d8a07e3bd95bd0d56f35241523fbab1and block_time>= NOW() - INTERVAL '24' hour)select trades.*,p.twap_price,p.spot_pricefrom tradesinner join prices pon date_trunc('minute',block_time)=date_trunc('minute',cast(datetime as timestamp))