Query editor
-- with price_paprika as (-- -- minute level sol price from coinpaprika-- select-- timestamp as ts,-- symbol as ccy,-- price as price_coinpaprika-- from prices.minute-- where-- blockchain = 'solana' and timestamp >= now() - INTERVAL '1' day --timestamp '2024-01-01'-- and symbol = 'SOL' and contract_address = 0x0000000000000000000000000000000000000000-- and source = 'coinpaprika'-- )with price_paprika as (-- minute level btc price from coinpaprikaselecttimestamp as ts,symbol as ccy,price as price_coinpaprikafrom prices.minutewhereblockchain = 'bitcoin' and timestamp >= now() - INTERVAL '1' day --timestamp '2024-01-01'and symbol = 'BTC' and contract_address = 0x0000000000000000000000000000000000000000and source = 'coinpaprika'), price_dex as (select-- date_trunc('minute', ts) as ms,ts,segment,project,ts as ms,operation,token_pair,token_bought_symbol,token_bought_amount,token_sold_symbol,token_sold_amount,price_stablecoin as price_dex,volume_usd,tx_idfrom query_6897361 -- cbbtc/wbtc - usdc/usdt trades on solana dex, from 2024-01-01wherets >= now() - INTERVAL '1' day--timestamp '2024-01-01'), price_combined as (selectdate_trunc('hour', pp.ts) as time_interval,pp.*,psd.segment,psd.project,psd.operation,psd.token_pair,psd.price_dex,psd.volume_usd as volume_dex,abs(price_dex - price_coinpaprika) as price_difffrom price_paprika ppjoin price_dex psd on pp.ts = psd.ts