Skip to content

Commit

Permalink
Merge pull request #5 from galacticcouncil/rename-timestamp
Browse files Browse the repository at this point in the history
rename timestamp
  • Loading branch information
green-jay authored Aug 14, 2023
2 parents 1986929 + 6cae46a commit 03241f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions queries/hydradx-ui/v1/stats/tvl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ src_data AS (
lrna_every_block leb, launch
)
SELECT
s.start as interval,
s.start as timestamp,
round(sum(oa.hub_reserve/10^12 * src.last_lrna_price)) as tvl_usd
FROM
src_data src
Expand All @@ -52,4 +52,5 @@ WHERE
GROUP BY
s.start
ORDER BY
s.start;
s.start
LIMIT 60;
8 changes: 4 additions & 4 deletions queries/hydradx-ui/v1/stats/volume.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Returns 30 rows with volume in USD, one daily for last 30d, last record is for y

WITH CombinedQuery AS (
SELECT
timestamp::date as datetime,
timestamp::date as timestamp,
round(sum(volume_usd)/2) as volume_usd,
'daily' as type
FROM
Expand All @@ -27,7 +27,7 @@ WITH CombinedQuery AS (
GROUP BY 1
UNION ALL
SELECT
date_trunc('hour', timestamp) as datetime,
date_trunc('hour', timestamp) as timestamp,
round(sum(volume_usd)/2) as volume_usd,
'hourly' as type
FROM
Expand All @@ -44,7 +44,7 @@ WITH CombinedQuery AS (
GROUP BY 1
)
SELECT
datetime,
timestamp,
volume_usd
FROM
CombinedQuery
Expand All @@ -54,4 +54,4 @@ WHERE
ELSE 'daily'
END
ORDER BY
datetime;
timestamp;

0 comments on commit 03241f0

Please sign in to comment.