Title
#users-market-data
Nick Guber

Nick Guber

03/24/2022, 6:19 AM
SELECT time_bucket('1 day', time) AS day,
  first(price, time) AS open,
  last(price, time) AS close,
  max(price) AS high,
  min(price) AS low,
  sum(volume) AS volume
FROM prices
WHERE asset_code = 'TIMS'
  AND time > NOW() - interval '30d'
GROUP BY day
ORDER BY day ASC;
Pei

Pei

03/24/2022, 9:18 AM
SebastiƔn Torrealba

SebastiƔn Torrealba

03/24/2022, 4:37 PM
SAMPLE BY 1M
to the magic @Nick Guber
Nick Guber

Nick Guber

03/25/2022, 6:05 AM
Thanks