Skip to content

Commit 4401c8c

Browse files
author
sam
committed
2 parents ba65246 + fc6aae4 commit 4401c8c

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

.github/workflows/autoformat.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Formatting queries"
1+
name: "Autoformat SQL"
22
on: # rebuild any PRs and master branch changes
33
pull_request:
44
push:

README.md

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1-
# Dune Snippets
1+
<img src="https://i.imgur.com/RURn3Pa.png" align="center" width="350">
22

3-
> Snippets of both Dune user submissions and my own
43

5-
<img src="https://i.imgur.com/RURn3Pa.png" align="center" width="450">
4+
## Dune Snippets
5+
6+
<br />
7+
8+
![Autoformat SQL](https://github.com/sambacha/dune-snippets/workflows/Autoformat%20SQL/badge.svg)
9+
10+
11+
> Snippets of both Dune user submissions and my own. All queries are linted through a GitHub Actions CI workflow
612
713
<br />
14+
815
[source from Dune Analytics HackMD](https://hackmd.io/k71ZUSTxQVKGqOcvR6OXnw)
9-
<br />
16+
1017

1118
### Contents
1219

dune/base/_price.sql

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
(
2+
SELECT date_trunc('day', minute) AS day, contract_address AS token, AVG(price) AS price
3+
FROM prices.usd
4+
GROUP BY 1, 2
5+
6+
union all
7+
8+
select date_trunc('day', hour) AS day, contract_address AS token, AVG(median_price) AS price
9+
FROM dex.view_token_prices
10+
GROUP BY 1, 2
11+
) as prices on b.day = prices.day

0 commit comments

Comments
 (0)