diff --git a/.gitbook/assets/0 b/.gitbook/assets/0 new file mode 100644 index 0000000..f1c844f Binary files /dev/null and b/.gitbook/assets/0 differ diff --git a/.gitbook/assets/1 b/.gitbook/assets/1 new file mode 100644 index 0000000..3a6d573 Binary files /dev/null and b/.gitbook/assets/1 differ diff --git a/.gitbook/assets/2 b/.gitbook/assets/2 new file mode 100644 index 0000000..04f92af Binary files /dev/null and b/.gitbook/assets/2 differ diff --git a/.gitbook/assets/2021-11-01 14-30-33.gif b/.gitbook/assets/2021-11-01 14-30-33.gif new file mode 100644 index 0000000..a2ffa4e Binary files /dev/null and b/.gitbook/assets/2021-11-01 14-30-33.gif differ diff --git a/.gitbook/assets/2021-11-01 14-45-28.gif b/.gitbook/assets/2021-11-01 14-45-28.gif new file mode 100644 index 0000000..6fff2f2 Binary files /dev/null and b/.gitbook/assets/2021-11-01 14-45-28.gif differ diff --git a/.gitbook/assets/2021-11-02 18-39-01.gif b/.gitbook/assets/2021-11-02 18-39-01.gif new file mode 100644 index 0000000..e761404 Binary files /dev/null and b/.gitbook/assets/2021-11-02 18-39-01.gif differ diff --git a/.gitbook/assets/2021-11-03 16-59-42 (1).gif b/.gitbook/assets/2021-11-03 16-59-42 (1).gif new file mode 100644 index 0000000..851303d Binary files /dev/null and b/.gitbook/assets/2021-11-03 16-59-42 (1).gif differ diff --git a/.gitbook/assets/2021-11-03 16-59-42 (2).gif b/.gitbook/assets/2021-11-03 16-59-42 (2).gif new file mode 100644 index 0000000..851303d Binary files /dev/null and b/.gitbook/assets/2021-11-03 16-59-42 (2).gif differ diff --git a/.gitbook/assets/2021-11-03 16-59-42.gif b/.gitbook/assets/2021-11-03 16-59-42.gif new file mode 100644 index 0000000..851303d Binary files /dev/null and b/.gitbook/assets/2021-11-03 16-59-42.gif differ diff --git a/.gitbook/assets/2021-11-03 17-55-41 (1).gif b/.gitbook/assets/2021-11-03 17-55-41 (1).gif new file mode 100644 index 0000000..9803ad9 Binary files /dev/null and b/.gitbook/assets/2021-11-03 17-55-41 (1).gif differ diff --git a/.gitbook/assets/2021-11-03 17-55-41.gif b/.gitbook/assets/2021-11-03 17-55-41.gif new file mode 100644 index 0000000..9803ad9 Binary files /dev/null and b/.gitbook/assets/2021-11-03 17-55-41.gif differ diff --git a/.gitbook/assets/2021-11-04 12-34-39.gif b/.gitbook/assets/2021-11-04 12-34-39.gif new file mode 100644 index 0000000..39fc168 Binary files /dev/null and b/.gitbook/assets/2021-11-04 12-34-39.gif differ diff --git a/.gitbook/assets/2021-11-09 13-17-41.gif b/.gitbook/assets/2021-11-09 13-17-41.gif new file mode 100644 index 0000000..69a708d Binary files /dev/null and b/.gitbook/assets/2021-11-09 13-17-41.gif differ diff --git a/.gitbook/assets/2021-11-09 13-20-39.gif b/.gitbook/assets/2021-11-09 13-20-39.gif new file mode 100644 index 0000000..5bc2496 Binary files /dev/null and b/.gitbook/assets/2021-11-09 13-20-39.gif differ diff --git a/.gitbook/assets/2021-11-18 16-23-05.gif b/.gitbook/assets/2021-11-18 16-23-05.gif new file mode 100644 index 0000000..15661a8 Binary files /dev/null and b/.gitbook/assets/2021-11-18 16-23-05.gif differ diff --git a/.gitbook/assets/2021-11-19 01-22-49.gif b/.gitbook/assets/2021-11-19 01-22-49.gif new file mode 100644 index 0000000..8561816 Binary files /dev/null and b/.gitbook/assets/2021-11-19 01-22-49.gif differ diff --git a/.gitbook/assets/2021-11-26 13-08-16.gif b/.gitbook/assets/2021-11-26 13-08-16.gif new file mode 100644 index 0000000..bd0f3ec Binary files /dev/null and b/.gitbook/assets/2021-11-26 13-08-16.gif differ diff --git a/.gitbook/assets/2021-11-26 17-25-04.gif b/.gitbook/assets/2021-11-26 17-25-04.gif new file mode 100644 index 0000000..f41a9a4 Binary files /dev/null and b/.gitbook/assets/2021-11-26 17-25-04.gif differ diff --git a/.gitbook/assets/2021-12-06 14-55-04.gif b/.gitbook/assets/2021-12-06 14-55-04.gif new file mode 100644 index 0000000..7660564 Binary files /dev/null and b/.gitbook/assets/2021-12-06 14-55-04.gif differ diff --git a/.gitbook/assets/2021-12-08 22-33-19.gif b/.gitbook/assets/2021-12-08 22-33-19.gif new file mode 100644 index 0000000..6426d3e Binary files /dev/null and b/.gitbook/assets/2021-12-08 22-33-19.gif differ diff --git a/.gitbook/assets/2021-12-08 22-44-18.gif b/.gitbook/assets/2021-12-08 22-44-18.gif new file mode 100644 index 0000000..9a2f910 Binary files /dev/null and b/.gitbook/assets/2021-12-08 22-44-18.gif differ diff --git a/.gitbook/assets/2021-12-10 15-39-28.mp4 b/.gitbook/assets/2021-12-10 15-39-28.mp4 new file mode 100644 index 0000000..beb121b Binary files /dev/null and b/.gitbook/assets/2021-12-10 15-39-28.mp4 differ diff --git a/.gitbook/assets/2021-12-10 15-41-07.gif b/.gitbook/assets/2021-12-10 15-41-07.gif new file mode 100644 index 0000000..a2dd3bc Binary files /dev/null and b/.gitbook/assets/2021-12-10 15-41-07.gif differ diff --git a/.gitbook/assets/Dune-logo-Full.zip b/.gitbook/assets/Dune-logo-Full.zip new file mode 100644 index 0000000..310a803 Binary files /dev/null and b/.gitbook/assets/Dune-logo-Full.zip differ diff --git a/.gitbook/assets/Screen Shot 2022-01-03 at 14.43.07.png b/.gitbook/assets/Screen Shot 2022-01-03 at 14.43.07.png new file mode 100644 index 0000000..f6e82c9 Binary files /dev/null and b/.gitbook/assets/Screen Shot 2022-01-03 at 14.43.07.png differ diff --git a/.gitbook/assets/Screen Shot 2022-01-03 at 15.46.22 (1).png b/.gitbook/assets/Screen Shot 2022-01-03 at 15.46.22 (1).png new file mode 100644 index 0000000..cfa941f Binary files /dev/null and b/.gitbook/assets/Screen Shot 2022-01-03 at 15.46.22 (1).png differ diff --git a/.gitbook/assets/Screen Shot 2022-01-03 at 15.46.22.png b/.gitbook/assets/Screen Shot 2022-01-03 at 15.46.22.png new file mode 100644 index 0000000..cfa941f Binary files /dev/null and b/.gitbook/assets/Screen Shot 2022-01-03 at 15.46.22.png differ diff --git a/.gitbook/assets/Screen Shot 2022-01-03 at 16.02.19.png b/.gitbook/assets/Screen Shot 2022-01-03 at 16.02.19.png new file mode 100644 index 0000000..493fd99 Binary files /dev/null and b/.gitbook/assets/Screen Shot 2022-01-03 at 16.02.19.png differ diff --git a/.gitbook/assets/Screen Shot 2022-01-03 at 16.05.07.png b/.gitbook/assets/Screen Shot 2022-01-03 at 16.05.07.png new file mode 100644 index 0000000..edb294a Binary files /dev/null and b/.gitbook/assets/Screen Shot 2022-01-03 at 16.05.07.png differ diff --git a/.gitbook/assets/column chunk minmax.png b/.gitbook/assets/column chunk minmax.png new file mode 100644 index 0000000..3e4d1a3 Binary files /dev/null and b/.gitbook/assets/column chunk minmax.png differ diff --git a/.gitbook/assets/column oriented database.png b/.gitbook/assets/column oriented database.png new file mode 100644 index 0000000..7bdf1b3 Binary files /dev/null and b/.gitbook/assets/column oriented database.png differ diff --git a/.gitbook/assets/dune-horizontal-logo-cover (1).png b/.gitbook/assets/dune-horizontal-logo-cover (1).png new file mode 100644 index 0000000..536e9d2 Binary files /dev/null and b/.gitbook/assets/dune-horizontal-logo-cover (1).png differ diff --git a/.gitbook/assets/dune-horizontal-logo-cover.png b/.gitbook/assets/dune-horizontal-logo-cover.png new file mode 100644 index 0000000..ee2582d Binary files /dev/null and b/.gitbook/assets/dune-horizontal-logo-cover.png differ diff --git a/.gitbook/assets/dune-horizontal-logo-dark.svg b/.gitbook/assets/dune-horizontal-logo-dark.svg new file mode 100644 index 0000000..d803f4b --- /dev/null +++ b/.gitbook/assets/dune-horizontal-logo-dark.svg @@ -0,0 +1,18 @@ + diff --git a/.gitbook/assets/dune-horizontal-logo-dark@2x.png b/.gitbook/assets/dune-horizontal-logo-dark@2x.png new file mode 100644 index 0000000..67fad1a Binary files /dev/null and b/.gitbook/assets/dune-horizontal-logo-dark@2x.png differ diff --git a/.gitbook/assets/dune-horizontal-logo.svg b/.gitbook/assets/dune-horizontal-logo.svg new file mode 100644 index 0000000..c091e6f --- /dev/null +++ b/.gitbook/assets/dune-horizontal-logo.svg @@ -0,0 +1,18 @@ + diff --git a/.gitbook/assets/dune-horizontal-logo@2x.png b/.gitbook/assets/dune-horizontal-logo@2x.png new file mode 100644 index 0000000..e006e65 Binary files /dev/null and b/.gitbook/assets/dune-horizontal-logo@2x.png differ diff --git a/.gitbook/assets/dune-icon-only (1).png b/.gitbook/assets/dune-icon-only (1).png new file mode 100644 index 0000000..b7daa24 Binary files /dev/null and b/.gitbook/assets/dune-icon-only (1).png differ diff --git a/.gitbook/assets/dune-icon-only.png b/.gitbook/assets/dune-icon-only.png new file mode 100644 index 0000000..b7daa24 Binary files /dev/null and b/.gitbook/assets/dune-icon-only.png differ diff --git a/.gitbook/assets/dune-icon-only.svg b/.gitbook/assets/dune-icon-only.svg new file mode 100644 index 0000000..cfd7337 --- /dev/null +++ b/.gitbook/assets/dune-icon-only.svg @@ -0,0 +1,4 @@ + diff --git a/.gitbook/assets/dune-icon-only@2x (1).png b/.gitbook/assets/dune-icon-only@2x (1).png new file mode 100644 index 0000000..de96172 Binary files /dev/null and b/.gitbook/assets/dune-icon-only@2x (1).png differ diff --git a/.gitbook/assets/dune-icon-only@2x.png b/.gitbook/assets/dune-icon-only@2x.png new file mode 100644 index 0000000..de96172 Binary files /dev/null and b/.gitbook/assets/dune-icon-only@2x.png differ diff --git a/.gitbook/assets/dune-standard-logo (1).svg b/.gitbook/assets/dune-standard-logo (1).svg new file mode 100644 index 0000000..4e53158 --- /dev/null +++ b/.gitbook/assets/dune-standard-logo (1).svg @@ -0,0 +1,18 @@ + diff --git a/.gitbook/assets/dune-standard-logo-cover.png b/.gitbook/assets/dune-standard-logo-cover.png new file mode 100644 index 0000000..6bc0b41 Binary files /dev/null and b/.gitbook/assets/dune-standard-logo-cover.png differ diff --git a/.gitbook/assets/dune-standard-logo-dark (1).svg b/.gitbook/assets/dune-standard-logo-dark (1).svg new file mode 100644 index 0000000..650b901 --- /dev/null +++ b/.gitbook/assets/dune-standard-logo-dark (1).svg @@ -0,0 +1,18 @@ + diff --git a/.gitbook/assets/dune-standard-logo-dark.svg b/.gitbook/assets/dune-standard-logo-dark.svg new file mode 100644 index 0000000..df1fcaf --- /dev/null +++ b/.gitbook/assets/dune-standard-logo-dark.svg @@ -0,0 +1,9 @@ + diff --git a/.gitbook/assets/dune-standard-logo-dark@2x (1).png b/.gitbook/assets/dune-standard-logo-dark@2x (1).png new file mode 100644 index 0000000..388a63d Binary files /dev/null and b/.gitbook/assets/dune-standard-logo-dark@2x (1).png differ diff --git a/.gitbook/assets/dune-standard-logo-dark@2x.png b/.gitbook/assets/dune-standard-logo-dark@2x.png new file mode 100644 index 0000000..5477197 Binary files /dev/null and b/.gitbook/assets/dune-standard-logo-dark@2x.png differ diff --git a/.gitbook/assets/dune-standard-logo.svg b/.gitbook/assets/dune-standard-logo.svg new file mode 100644 index 0000000..5ead416 --- /dev/null +++ b/.gitbook/assets/dune-standard-logo.svg @@ -0,0 +1,9 @@ + diff --git a/.gitbook/assets/dune-standard-logo@2x (1).png b/.gitbook/assets/dune-standard-logo@2x (1).png new file mode 100644 index 0000000..c40f7e2 Binary files /dev/null and b/.gitbook/assets/dune-standard-logo@2x (1).png differ diff --git a/.gitbook/assets/dune-standard-logo@2x.png b/.gitbook/assets/dune-standard-logo@2x.png new file mode 100644 index 0000000..f2980e9 Binary files /dev/null and b/.gitbook/assets/dune-standard-logo@2x.png differ diff --git a/.gitbook/assets/dune-vertical-logo (1).svg b/.gitbook/assets/dune-vertical-logo (1).svg new file mode 100644 index 0000000..a339a8b --- /dev/null +++ b/.gitbook/assets/dune-vertical-logo (1).svg @@ -0,0 +1,9 @@ + diff --git a/.gitbook/assets/dune-vertical-logo-cover (1).png b/.gitbook/assets/dune-vertical-logo-cover (1).png new file mode 100644 index 0000000..15ef379 Binary files /dev/null and b/.gitbook/assets/dune-vertical-logo-cover (1).png differ diff --git a/.gitbook/assets/dune-vertical-logo-cover.png b/.gitbook/assets/dune-vertical-logo-cover.png new file mode 100644 index 0000000..dd721b6 Binary files /dev/null and b/.gitbook/assets/dune-vertical-logo-cover.png differ diff --git a/.gitbook/assets/dune-vertical-logo-dark (1).svg b/.gitbook/assets/dune-vertical-logo-dark (1).svg new file mode 100644 index 0000000..6df6d01 --- /dev/null +++ b/.gitbook/assets/dune-vertical-logo-dark (1).svg @@ -0,0 +1,25 @@ + diff --git a/.gitbook/assets/dune-vertical-logo-dark.svg b/.gitbook/assets/dune-vertical-logo-dark.svg new file mode 100644 index 0000000..4e7a2d5 --- /dev/null +++ b/.gitbook/assets/dune-vertical-logo-dark.svg @@ -0,0 +1,9 @@ + diff --git a/.gitbook/assets/dune-vertical-logo-dark@2x (1).png b/.gitbook/assets/dune-vertical-logo-dark@2x (1).png new file mode 100644 index 0000000..1cf2837 Binary files /dev/null and b/.gitbook/assets/dune-vertical-logo-dark@2x (1).png differ diff --git a/.gitbook/assets/dune-vertical-logo-dark@2x.png b/.gitbook/assets/dune-vertical-logo-dark@2x.png new file mode 100644 index 0000000..66d984a Binary files /dev/null and b/.gitbook/assets/dune-vertical-logo-dark@2x.png differ diff --git a/.gitbook/assets/dune-vertical-logo.svg b/.gitbook/assets/dune-vertical-logo.svg new file mode 100644 index 0000000..0a55262 --- /dev/null +++ b/.gitbook/assets/dune-vertical-logo.svg @@ -0,0 +1,25 @@ + diff --git a/.gitbook/assets/dune-vertical-logo@2x (1).png b/.gitbook/assets/dune-vertical-logo@2x (1).png new file mode 100644 index 0000000..960c44d Binary files /dev/null and b/.gitbook/assets/dune-vertical-logo@2x (1).png differ diff --git a/.gitbook/assets/dune-vertical-logo@2x.png b/.gitbook/assets/dune-vertical-logo@2x.png new file mode 100644 index 0000000..fbe2fb2 Binary files /dev/null and b/.gitbook/assets/dune-vertical-logo@2x.png differ diff --git a/.gitbook/assets/image (1).png b/.gitbook/assets/image (1).png new file mode 100644 index 0000000..ababac9 Binary files /dev/null and b/.gitbook/assets/image (1).png differ diff --git a/.gitbook/assets/image (10).png b/.gitbook/assets/image (10).png new file mode 100644 index 0000000..e1a714d Binary files /dev/null and b/.gitbook/assets/image (10).png differ diff --git a/.gitbook/assets/image (11).png b/.gitbook/assets/image (11).png new file mode 100644 index 0000000..637f520 Binary files /dev/null and b/.gitbook/assets/image (11).png differ diff --git a/.gitbook/assets/image (12).png b/.gitbook/assets/image (12).png new file mode 100644 index 0000000..d264edd Binary files /dev/null and b/.gitbook/assets/image (12).png differ diff --git a/.gitbook/assets/image (13) (1) (1).png b/.gitbook/assets/image (13) (1) (1).png new file mode 100644 index 0000000..31ff57d Binary files /dev/null and b/.gitbook/assets/image (13) (1) (1).png differ diff --git a/.gitbook/assets/image (13) (1) (2).png b/.gitbook/assets/image (13) (1) (2).png new file mode 100644 index 0000000..31ff57d Binary files /dev/null and b/.gitbook/assets/image (13) (1) (2).png differ diff --git a/.gitbook/assets/image (13) (1).png b/.gitbook/assets/image (13) (1).png new file mode 100644 index 0000000..31ff57d Binary files /dev/null and b/.gitbook/assets/image (13) (1).png differ diff --git a/.gitbook/assets/image (13) (2).png b/.gitbook/assets/image (13) (2).png new file mode 100644 index 0000000..ea310e6 Binary files /dev/null and b/.gitbook/assets/image (13) (2).png differ diff --git a/.gitbook/assets/image (13).png b/.gitbook/assets/image (13).png new file mode 100644 index 0000000..d787a2f Binary files /dev/null and b/.gitbook/assets/image (13).png differ diff --git a/.gitbook/assets/image (14).png b/.gitbook/assets/image (14).png new file mode 100644 index 0000000..881fbdd Binary files /dev/null and b/.gitbook/assets/image (14).png differ diff --git a/.gitbook/assets/image (15).png b/.gitbook/assets/image (15).png new file mode 100644 index 0000000..17d8f37 Binary files /dev/null and b/.gitbook/assets/image (15).png differ diff --git a/.gitbook/assets/image (16).png b/.gitbook/assets/image (16).png new file mode 100644 index 0000000..33ab982 Binary files /dev/null and b/.gitbook/assets/image (16).png differ diff --git a/.gitbook/assets/image (17).png b/.gitbook/assets/image (17).png new file mode 100644 index 0000000..d77a392 Binary files /dev/null and b/.gitbook/assets/image (17).png differ diff --git a/.gitbook/assets/image (18) (1).png b/.gitbook/assets/image (18) (1).png new file mode 100644 index 0000000..93b4023 Binary files /dev/null and b/.gitbook/assets/image (18) (1).png differ diff --git a/.gitbook/assets/image (18).png b/.gitbook/assets/image (18).png new file mode 100644 index 0000000..982bfb8 Binary files /dev/null and b/.gitbook/assets/image (18).png differ diff --git a/.gitbook/assets/image (19) (1).png b/.gitbook/assets/image (19) (1).png new file mode 100644 index 0000000..6387e29 Binary files /dev/null and b/.gitbook/assets/image (19) (1).png differ diff --git a/.gitbook/assets/image (19) (2).png b/.gitbook/assets/image (19) (2).png new file mode 100644 index 0000000..6387e29 Binary files /dev/null and b/.gitbook/assets/image (19) (2).png differ diff --git a/.gitbook/assets/image (19).png b/.gitbook/assets/image (19).png new file mode 100644 index 0000000..6387e29 Binary files /dev/null and b/.gitbook/assets/image (19).png differ diff --git a/.gitbook/assets/image (2).png b/.gitbook/assets/image (2).png new file mode 100644 index 0000000..dc768ef Binary files /dev/null and b/.gitbook/assets/image (2).png differ diff --git a/.gitbook/assets/image (20).png b/.gitbook/assets/image (20).png new file mode 100644 index 0000000..2b31a1d Binary files /dev/null and b/.gitbook/assets/image (20).png differ diff --git a/.gitbook/assets/image (21).png b/.gitbook/assets/image (21).png new file mode 100644 index 0000000..0847a0c Binary files /dev/null and b/.gitbook/assets/image (21).png differ diff --git a/.gitbook/assets/image (22).png b/.gitbook/assets/image (22).png new file mode 100644 index 0000000..4b57374 Binary files /dev/null and b/.gitbook/assets/image (22).png differ diff --git a/.gitbook/assets/image (23).png b/.gitbook/assets/image (23).png new file mode 100644 index 0000000..8d09af5 Binary files /dev/null and b/.gitbook/assets/image (23).png differ diff --git a/.gitbook/assets/image (24).png b/.gitbook/assets/image (24).png new file mode 100644 index 0000000..d287bb7 Binary files /dev/null and b/.gitbook/assets/image (24).png differ diff --git a/.gitbook/assets/image (25).png b/.gitbook/assets/image (25).png new file mode 100644 index 0000000..0e47ef0 Binary files /dev/null and b/.gitbook/assets/image (25).png differ diff --git a/.gitbook/assets/image (26).png b/.gitbook/assets/image (26).png new file mode 100644 index 0000000..6be33db Binary files /dev/null and b/.gitbook/assets/image (26).png differ diff --git a/.gitbook/assets/image (27).png b/.gitbook/assets/image (27).png new file mode 100644 index 0000000..b923849 Binary files /dev/null and b/.gitbook/assets/image (27).png differ diff --git a/.gitbook/assets/image (28) (1).png b/.gitbook/assets/image (28) (1).png new file mode 100644 index 0000000..b923849 Binary files /dev/null and b/.gitbook/assets/image (28) (1).png differ diff --git a/.gitbook/assets/image (28).png b/.gitbook/assets/image (28).png new file mode 100644 index 0000000..b923849 Binary files /dev/null and b/.gitbook/assets/image (28).png differ diff --git a/.gitbook/assets/image (29).png b/.gitbook/assets/image (29).png new file mode 100644 index 0000000..3c848f7 Binary files /dev/null and b/.gitbook/assets/image (29).png differ diff --git a/.gitbook/assets/image (3).png b/.gitbook/assets/image (3).png new file mode 100644 index 0000000..e8f03fc Binary files /dev/null and b/.gitbook/assets/image (3).png differ diff --git a/.gitbook/assets/image (30) (1).png b/.gitbook/assets/image (30) (1).png new file mode 100644 index 0000000..b923849 Binary files /dev/null and b/.gitbook/assets/image (30) (1).png differ diff --git a/.gitbook/assets/image (30).png b/.gitbook/assets/image (30).png new file mode 100644 index 0000000..fd2a27e Binary files /dev/null and b/.gitbook/assets/image (30).png differ diff --git a/.gitbook/assets/image (31).png b/.gitbook/assets/image (31).png new file mode 100644 index 0000000..8dcbd54 Binary files /dev/null and b/.gitbook/assets/image (31).png differ diff --git a/.gitbook/assets/image (32).png b/.gitbook/assets/image (32).png new file mode 100644 index 0000000..8dcbd54 Binary files /dev/null and b/.gitbook/assets/image (32).png differ diff --git a/.gitbook/assets/image (33).png b/.gitbook/assets/image (33).png new file mode 100644 index 0000000..6d1ec07 Binary files /dev/null and b/.gitbook/assets/image (33).png differ diff --git a/.gitbook/assets/image (34).png b/.gitbook/assets/image (34).png new file mode 100644 index 0000000..ae1038c Binary files /dev/null and b/.gitbook/assets/image (34).png differ diff --git a/.gitbook/assets/image (35).png b/.gitbook/assets/image (35).png new file mode 100644 index 0000000..076c4c2 Binary files /dev/null and b/.gitbook/assets/image (35).png differ diff --git a/.gitbook/assets/image (36).png b/.gitbook/assets/image (36).png new file mode 100644 index 0000000..400ed65 Binary files /dev/null and b/.gitbook/assets/image (36).png differ diff --git a/.gitbook/assets/image (37).png b/.gitbook/assets/image (37).png new file mode 100644 index 0000000..853a757 Binary files /dev/null and b/.gitbook/assets/image (37).png differ diff --git a/.gitbook/assets/image (38).png b/.gitbook/assets/image (38).png new file mode 100644 index 0000000..e304524 Binary files /dev/null and b/.gitbook/assets/image (38).png differ diff --git a/.gitbook/assets/image (39).png b/.gitbook/assets/image (39).png new file mode 100644 index 0000000..8c42f7e Binary files /dev/null and b/.gitbook/assets/image (39).png differ diff --git a/.gitbook/assets/image (4).png b/.gitbook/assets/image (4).png new file mode 100644 index 0000000..995b018 Binary files /dev/null and b/.gitbook/assets/image (4).png differ diff --git a/.gitbook/assets/image (40).png b/.gitbook/assets/image (40).png new file mode 100644 index 0000000..06a5fd7 Binary files /dev/null and b/.gitbook/assets/image (40).png differ diff --git a/.gitbook/assets/image (41).png b/.gitbook/assets/image (41).png new file mode 100644 index 0000000..9626494 Binary files /dev/null and b/.gitbook/assets/image (41).png differ diff --git a/.gitbook/assets/image (42).png b/.gitbook/assets/image (42).png new file mode 100644 index 0000000..da2655e Binary files /dev/null and b/.gitbook/assets/image (42).png differ diff --git a/.gitbook/assets/image (43).png b/.gitbook/assets/image (43).png new file mode 100644 index 0000000..e236886 Binary files /dev/null and b/.gitbook/assets/image (43).png differ diff --git a/.gitbook/assets/image (44).png b/.gitbook/assets/image (44).png new file mode 100644 index 0000000..a13fa43 Binary files /dev/null and b/.gitbook/assets/image (44).png differ diff --git a/.gitbook/assets/image (45).png b/.gitbook/assets/image (45).png new file mode 100644 index 0000000..682f8f7 Binary files /dev/null and b/.gitbook/assets/image (45).png differ diff --git a/.gitbook/assets/image (46).png b/.gitbook/assets/image (46).png new file mode 100644 index 0000000..b6f9923 Binary files /dev/null and b/.gitbook/assets/image (46).png differ diff --git a/.gitbook/assets/image (47).png b/.gitbook/assets/image (47).png new file mode 100644 index 0000000..7c5bea4 Binary files /dev/null and b/.gitbook/assets/image (47).png differ diff --git a/.gitbook/assets/image (48).png b/.gitbook/assets/image (48).png new file mode 100644 index 0000000..4a9f021 Binary files /dev/null and b/.gitbook/assets/image (48).png differ diff --git a/.gitbook/assets/image (49).png b/.gitbook/assets/image (49).png new file mode 100644 index 0000000..7f276cd Binary files /dev/null and b/.gitbook/assets/image (49).png differ diff --git a/.gitbook/assets/image (5).png b/.gitbook/assets/image (5).png new file mode 100644 index 0000000..cde4cd8 Binary files /dev/null and b/.gitbook/assets/image (5).png differ diff --git a/.gitbook/assets/image (50).png b/.gitbook/assets/image (50).png new file mode 100644 index 0000000..d733507 Binary files /dev/null and b/.gitbook/assets/image (50).png differ diff --git a/.gitbook/assets/image (51).png b/.gitbook/assets/image (51).png new file mode 100644 index 0000000..0922ac1 Binary files /dev/null and b/.gitbook/assets/image (51).png differ diff --git a/.gitbook/assets/image (52).png b/.gitbook/assets/image (52).png new file mode 100644 index 0000000..711e243 Binary files /dev/null and b/.gitbook/assets/image (52).png differ diff --git a/.gitbook/assets/image (53).png b/.gitbook/assets/image (53).png new file mode 100644 index 0000000..6afc456 Binary files /dev/null and b/.gitbook/assets/image (53).png differ diff --git a/.gitbook/assets/image (54).png b/.gitbook/assets/image (54).png new file mode 100644 index 0000000..e710688 Binary files /dev/null and b/.gitbook/assets/image (54).png differ diff --git a/.gitbook/assets/image (55).png b/.gitbook/assets/image (55).png new file mode 100644 index 0000000..2a6de60 Binary files /dev/null and b/.gitbook/assets/image (55).png differ diff --git a/.gitbook/assets/image (56).png b/.gitbook/assets/image (56).png new file mode 100644 index 0000000..0ef68d4 Binary files /dev/null and b/.gitbook/assets/image (56).png differ diff --git a/.gitbook/assets/image (57).png b/.gitbook/assets/image (57).png new file mode 100644 index 0000000..a520271 Binary files /dev/null and b/.gitbook/assets/image (57).png differ diff --git a/.gitbook/assets/image (58).png b/.gitbook/assets/image (58).png new file mode 100644 index 0000000..f277d60 Binary files /dev/null and b/.gitbook/assets/image (58).png differ diff --git a/.gitbook/assets/image (59).png b/.gitbook/assets/image (59).png new file mode 100644 index 0000000..556e67b Binary files /dev/null and b/.gitbook/assets/image (59).png differ diff --git a/.gitbook/assets/image (6).png b/.gitbook/assets/image (6).png new file mode 100644 index 0000000..dcd5088 Binary files /dev/null and b/.gitbook/assets/image (6).png differ diff --git a/.gitbook/assets/image (60).png b/.gitbook/assets/image (60).png new file mode 100644 index 0000000..d3ecf45 Binary files /dev/null and b/.gitbook/assets/image (60).png differ diff --git a/.gitbook/assets/image (61).png b/.gitbook/assets/image (61).png new file mode 100644 index 0000000..2cc5381 Binary files /dev/null and b/.gitbook/assets/image (61).png differ diff --git a/.gitbook/assets/image (62).png b/.gitbook/assets/image (62).png new file mode 100644 index 0000000..54d6111 Binary files /dev/null and b/.gitbook/assets/image (62).png differ diff --git a/.gitbook/assets/image (7).png b/.gitbook/assets/image (7).png new file mode 100644 index 0000000..35e8efa Binary files /dev/null and b/.gitbook/assets/image (7).png differ diff --git a/.gitbook/assets/image (8).png b/.gitbook/assets/image (8).png new file mode 100644 index 0000000..9856e18 Binary files /dev/null and b/.gitbook/assets/image (8).png differ diff --git a/.gitbook/assets/image (9).png b/.gitbook/assets/image (9).png new file mode 100644 index 0000000..759c710 Binary files /dev/null and b/.gitbook/assets/image (9).png differ diff --git a/.gitbook/assets/image.png b/.gitbook/assets/image.png new file mode 100644 index 0000000..12bdbd9 Binary files /dev/null and b/.gitbook/assets/image.png differ diff --git a/.gitbook/assets/minmax schema.JPG b/.gitbook/assets/minmax schema.JPG new file mode 100644 index 0000000..bda0889 Binary files /dev/null and b/.gitbook/assets/minmax schema.JPG differ diff --git a/.gitbook/assets/opening up profile.gif b/.gitbook/assets/opening up profile.gif new file mode 100644 index 0000000..c93c7e4 Binary files /dev/null and b/.gitbook/assets/opening up profile.gif differ diff --git a/.gitbook/assets/parquet file schema.png b/.gitbook/assets/parquet file schema.png new file mode 100644 index 0000000..5657c58 Binary files /dev/null and b/.gitbook/assets/parquet file schema.png differ diff --git a/.gitbook/assets/row based database (1).png b/.gitbook/assets/row based database (1).png new file mode 100644 index 0000000..f7ca8b3 Binary files /dev/null and b/.gitbook/assets/row based database (1).png differ diff --git a/.gitbook/assets/row based database.png b/.gitbook/assets/row based database.png new file mode 100644 index 0000000..f7ca8b3 Binary files /dev/null and b/.gitbook/assets/row based database.png differ diff --git a/README.md b/README.md index f4ba226..3679d50 100644 --- a/README.md +++ b/README.md @@ -1 +1,81 @@ -# docs-zh-cn +--- +description: Welcome to Dune +--- + +# Introduction to Dune + +## Introduction + +**Dune is a powerful tool for blockchain research. Dune gives you all the tools to query, extract, and visualize vast amounts of data from the blockchain. Dune is unlocking the power of public blockchain data by making it accessible to everyone. This documentation will help you answer questions like:** + +[How much volume flows through Uniswap each day?](https://dune.xyz/queries/3) + +[Which Dex has the highest volume?](https://dune.xyz/queries/1847) + +[How are important Stablecoins behaving today?](https://dune.xyz/hagaetc/stablecoins) + +## Dune Basics + +#### Dune App + +While navigating Dune, it helps to have a good understanding of [queries](./#queries), [visualizations](duneapp/visualizations/), and [dashboards](duneapp/dashboards.md). These are the basic building blocks that act as your portal to the world's blockchain information. As a blockchain analyst, you can create custom queries to fetch data, visualize the results of these queries, and then tell stories with your data using dashboards. + +#### Data available on Dune + +Behind the scenes, Dune transforms difficult-to-access data into human-readable tables. Using SQL queries, you can query for exactly the information you need. + +Dune has raw blockchain data and decoded blockchain data available. Decoded data is only available if somebody signaled to us before that a contract needs to be decoded. You can signal a decoding request to us via our [website](https://dune.xyz/contracts/new).\ +\ +You can currently query data from **Ethereum, Polygon, Binance Smart Chain, Optimism** and **Gnosis Chain**. + +Dune picks up events and internal calls from the blockchains we index, we don't have state/storage data. + +## Queries + +Dune aggregates blockchain data into SQL databases that can be easily queried. Queries are used to specify what data from the blockchain should be returned. + +Maybe you want to know _all the Dex trades that happened today_, or the _total value of stablecoins minted this year_. Whatever the question, the answer likely starts with a Dune query. + +Queries return rows and columns of data (same as traditional SQL queries) that can later be visualized and presented. + +![Screen Shot 2021-04-22 at 9 56 34 AM](https://user-images.githubusercontent.com/76178256/115726979-357d1380-a351-11eb-83ee-16f0d57c6ecb.png) + +There are a few ways that a blockchain analyst (ie. you!) can get started running queries: + +1. Use Dune _abstractions_ to query commonly used data tables. This is the simplest and most common way to use Dune. Some popular abstractions include `dex.trades`, `lending.borrow`, and `stablecoin.transfer` (you can find a complete list of abstractions [here](https://github.com/duneanalytics/abstractions)) +2. Query the raw ethereum data including blocks, logs, and transactions. +3. It is also possible to query centralized exchange data. Use `prices.usd` to quickly return the price of almost any cryptoasset + +## Visualizations + +Data presented in table form (rows and columns) can be difficult to read. Visualizations take the results of a query and present the information in a clear & precise way. + +You can use visualizations to begin to tell a story with your data. With Dune visualizations it is easy to transform this: + +![Screen Shot 2021-04-22 at 10 59 48 AM](https://user-images.githubusercontent.com/76178256/115737269-fa331280-a359-11eb-9a31-c0dfe4b038e6.png) + +Into this: + +![Screen Shot 2021-04-22 at 11 01 02 AM](https://user-images.githubusercontent.com/76178256/115737692-5b5ae600-a35a-11eb-8145-bdcf9396cd03.png) + +The bar chart visualization makes it clear that April 19th had the highest transfer volume, and helps the audience see the trend over time. + +Dune offers a variety of visualizations that you can use to visually present data including bar charts, area charts, line charts, pie charts, and more. + +## Dashboards + +Using carefully planned visuals, a clever blockchain analyst can tell a story about a particular group of data. For example, in the below[ dashboard](https://dune.xyz/hagaetc/dex-metrics) it is clear at the top that 'Dex' as a category is growing. Below, the audience sees which dex's are the most popular by volume, and finally can view a stacked bar chart that shows changes over time. By just looking at this single dashboard, the audience sees a clear picture of the entire DEX market. + +![Screen Shot 2021-04-23 at 10 51 25 AM](https://user-images.githubusercontent.com/76178256/115889404-e7841080-a421-11eb-9e30-8d43e58e28f4.png) + +## Dune is a collaborative effort + +On Dune, all queries and datasets are public by default. + +This introduces an interesting dynamic in which you, the user, can fork and remix the queries of other creators with ease and build on top of their knowledge. On the other side, every time you write a new query, you contribute to the collection of queries that help people query for data on dune. That way, the Dune Community succeeds together through an ever improving range of queries that allow you to easily query for just the stats you need. + +If you do need Privacy for your Queries, the [pro Plan](https://dune.xyz/pricing) has got you covered. + +Join our [Community Discord](https://discord.gg/BJBHFR6sdy) to get world class support from our team and the community. + +If you have any feedback, whether feature requests or bug reports, you can submit it [here](https://feedback.dune.xyz/). diff --git a/SUMMARY.md b/SUMMARY.md new file mode 100644 index 0000000..8c30513 --- /dev/null +++ b/SUMMARY.md @@ -0,0 +1,100 @@ +# Table of contents + +* [Introduction to Dune](README.md) + +## About Dune + +* [Use Cases](about/usecases/README.md) + * [Project Dashboards](about/usecases/project-dashboards.md) + * [Sector Dashboards](about/usecases/sector-dashboards.md) + * [Ecosystem Dashboards](about/usecases/ecosystem-dashboards.md) +* [Tutorials](about/tutorials/README.md) + * [Our Network course](about/tutorials/our-network-course.md) + * [Dune Guides](about/tutorials/dune-guides/README.md) + * [Tips for querying](about/tutorials/dune-guides/tips.md) + * [SQL guides](about/tutorials/sql-guides.md) + * [Video Series](about/tutorials/video-series.md) + * [Query templates](about/tutorials/queries/README.md) + * [ETH Balance of a wallet](about/tutorials/queries/eth-balance-of-a-wallet.md) + * [raw transactions per wallet](about/tutorials/queries/tx-wallet.md) + * [gas metrics per wallet](about/tutorials/queries/gas-metrics-per-wallet.md) + * [price queries](about/tutorials/queries/price-queries.md) + * [total supply over time of a token](about/tutorials/queries/supply.md) + * [Users and amount over a trailing period](about/tutorials/queries/untitled-6.md) + * [USD value of token utilised for an event](about/tutorials/queries/untitled-3.md) + * [USD price for a token from Uniswap](about/tutorials/queries/untitled-2.md) + * [Token (and USD value) per token over time for an address](about/tutorials/queries/untitled-1.md) + +## Data Tables + +* [Data tables](data-tables/data-tables/README.md) + * [nft.trades](data-tables/data-tables/nft.trading.md) + * [Raw Data](data-tables/data-tables/raw-data/README.md) + * [Ethereum data](data-tables/data-tables/raw-data/ethereum-data.md) + * [xDai Data](data-tables/data-tables/raw-data/xdai-data.md) + * [Decoded Data](data-tables/data-tables/decoded-data.md) + * [Token standards](data-tables/data-tables/special-tables.md) + * [ERC-20 balances](data-tables/data-tables/erc-20-balances.md) + * [Abstractions](data-tables/data-tables/abstractions.md) + * [User Generated](data-tables/data-tables/user-generated.md) + * [Prices](data-tables/data-tables/prices.md) + * [Labels](data-tables/data-tables/labels.md) + * [Solana Data](data-tables/data-tables/solana-data/README.md) + * [Changelog](data-tables/data-tables/solana-data/changelog.md) + * [Third Party Data](data-tables/data-tables/community-data/README.md) + * [Flashbots](data-tables/data-tables/community-data/flashbots.md) + +## Dune Engine V2 (beta) + +* [Dune V2 Intro](dune-engine-v2-beta/dunes-new-query-engine.md) +* [Query Engine](dune-engine-v2-beta/query-engine.md) +* [Abstractions in Dune V2](dune-engine-v2-beta/abstractions-in-dunev2.md) + +## Dune App + +* [Query Editor](duneapp/query-editor.md) +* [Visualizations](duneapp/visualizations/README.md) + * [Graphs](duneapp/visualizations/graphs.md) + * [Counters](duneapp/visualizations/counters.md) + * [Pie Charts](duneapp/visualizations/pie-charts.md) +* [Dashboards](duneapp/dashboards.md) +* [Parameters](duneapp/parameters.md) +* [Adding new contracts](duneapp/adding-new-contracts.md) + +## Onboarding + +* [Onboarding to Dune](onboarding/onboarding-to-dune.md) + +## Bounties + +* [Wizard Request Program](bounties/wizard-request-program.md) + +## Dune Charts across the web + +* [Attribution](sharing/attribution.md) +* [Embeds](sharing/embeds/README.md) + * [Discord](sharing/embeds/discord.md) + * [Twitter](sharing/embeds/twitter.md) + * [Webpages](sharing/embeds/webpages.md) + * [Mirror.xyz](sharing/embeds/mirror.xyz.md) + * [Known Issues](sharing/embeds/known-issues.md) + +## Resources + +* [Press Kit](resources/press-kit.md) + +## FAQ + +* [How does Dune get it's data ?](faq/how-does-dune-get-its-data.md) +* [Does Dune have an API?](faq/does-dune-have-an-api.md) +* [Does Dune have a Token?](faq/does-dune-have-a-token.md) +* [How are results refreshing?](faq/how-are-results-refreshing.md) + +## Changelog + +* [Changes to Dune](changelog/dune-changes/README.md) + * [March 2021](changelog/dune-changes/march-2021.md) + * [August 2020](changelog/dune-changes/august-2020.md) + * [March 2020](changelog/dune-changes/march-2020.md) + * [January 2020](changelog/dune-changes/january-2020.md) + * [October 2019](changelog/dune-changes/october-2019.md) diff --git a/about/tutorials/README.md b/about/tutorials/README.md new file mode 100644 index 0000000..eb7bc74 --- /dev/null +++ b/about/tutorials/README.md @@ -0,0 +1,44 @@ +# Tutorials + +## How to get started + +**Dune is made for technical and non-technical users alike.** \ +Whether you are a seasoned SQL developer or just starting out, you can use our platform to start analyzing Blockchain data in an instant. + +The Dune Team and several of our community members have produced great content to aid you in your journey of becoming a Dune Wizard. + +You can either start out by watching our video series [here](video-series.md) or looking through written tutorials [here](dune-guides/).\ +If you are entirely unfamiliar with SQL, it might be good to start off by learning some SQL with the guides listed [here](sql-guides.md). + +{% content-ref url="video-series.md" %} +[video-series.md](video-series.md) +{% endcontent-ref %} + +{% content-ref url="sql-guides.md" %} +[sql-guides.md](sql-guides.md) +{% endcontent-ref %} + +{% content-ref url="dune-guides/" %} +[dune-guides](dune-guides/) +{% endcontent-ref %} + +## What do you need to know? + +#### SQL knowledge + +A fundamental understanding of SQL is needed to be able to successfully query for data on Dune.\ +PostgreSQL Database Systems are widely used across almost all walks of life and you can find a lot of non Dune specific documentation about it. This often times helps with answering query related questions since most answers can easily be found in the internet. The official [PostgreSQL documentation](https://www.postgresql.org/docs/12/index.html) is quite helpful as well. Dune runs on PostgreSQL 12.2. + +#### Ethereum Virtual Machine data + +The data you will find on chain and therefore in Dune's databases is in many ways connected to understanding how the Ethereum Virtual Machine works as a whole and then in more specific terms understanding how the specific smart contracts work. If you are able to read most of the data in Etherscan, you are already well on your way to being able to query for things on dune.\ +Unfortunately there really isn't one great resource we can point you to currently as each smart contract has it's own rules. We have written up a few words on this in our [Section "decoded data"](../../data-tables/data-tables/decoded-data.md). + +#### Business Understanding + +This is something that might come as a surprise to some of you, but actually understanding what kinds of data is interesting for your project or topic is a fundamental part of becoming a great wizard. \ +\ +Ask yourself: **What Data is interesting and needed for my project to make better decisions ?** + +There is a thousand ways to go about finding what metrics are interesting to your project, but talking to the community of the project or the founders usually yields good results. + diff --git a/about/tutorials/dune-guides/README.md b/about/tutorials/dune-guides/README.md new file mode 100644 index 0000000..54a80a7 --- /dev/null +++ b/about/tutorials/dune-guides/README.md @@ -0,0 +1,36 @@ +# Dune Guides + +Some of our Community Members have produced great written tutorials for Dune: + +[Andrew Hong](https://twitter.com/andrewhong5297) + +* [Your guide to basic SQL while learning Ethereum at the same time](https://towardsdatascience.com/your-guide-to-basic-sql-while-learning-ethereum-at-the-same-time-9eac17a05929) (Part 1) +* [Your guide to intermediate SQL while learning Ethereum at the same time](https://towardsdatascience.com/your-guide-to-intermediate-sql-while-learning-ethereum-at-the-same-time-7b25119ef1e2?source=user\_profile---------6----------------------------) (Part 2) +* [Learning SQL and Ethereum](https://towardsdatascience.com/learning-sql-and-ethereum-part-3-5422f080ad36) (Part 3) +* [SQL on Ethereum: How to Work With All the Data from a Transaction](https://ath.mirror.xyz/mbR1n\_CvflL1KIKCTG42bnM4HpfGBqDPNndH8mu2eJw) + +[Alex Manuskin](https://twitter.com/amanusk\_) + +* [How to get started with querying on Dune Analytics](https://dune.xyz/blog/get-started-guide) + +[Paul Pivat](https://twitter.com/paulapivat) + +* [Lean foundational Ethereum topics with SQL](https://ethereum.org/en/developers/tutorials/learn-foundational-ethereum-topics-with-sql/) + +[Alex Kroeger](https://twitter.com/alex\_kroeger) + +* [How to use Dune Analytics like a degen](https://mirror.xyz/0x7B542178633f16940a131F8F6d670ffdbBe6b2Ab/0C3EQBtFqAK4k2TAGPZhg0JMY-upfTAxuTD-o91vBPc) + +[Chuxin](https://twitter.com/chuxin\_h) + +* [Select \* from web3](https://www.chuxinhuang.com/blog/select-from-web3/) + +[Gracelily](https://twitter.com/\_grace\_lily) + +* [PostgreSQL Query Optimization Tricks - How to Make Queries Faster in Dune Analytics](https://gracelily.medium.com/postgresql-query-optimization-tricks-6d5b7358d7fa) + + + +These guides are all great and we recommend reading all of them.\ +\ +Big **thank you** to the authors of these guides, you are amazing! diff --git a/about/tutorials/dune-guides/tips.md b/about/tutorials/dune-guides/tips.md new file mode 100644 index 0000000..8f64ca4 --- /dev/null +++ b/about/tutorials/dune-guides/tips.md @@ -0,0 +1,104 @@ +# Tips for querying + +You can interact with the data tables through our interface at [dune.xyz](https://www.dune.xyz/). + +To create a new query you simply click `New Query` in the top right corner + +![](https://i.imgur.com/dMHavC8.png) + +On your left you can select which database you want to use in the dropdown list and then see the data tables in the window. Just search for the project you are interested in working with. + +## Use abstractions + +The easiest way to do great analysis with Dune Analytics is to use prepared [abstractions](../../../data-tables/data-tables/abstractions.md) tables like `dex.trades`. All tables are cleaned and contains data and metadata (like human readable token symbols) that make them very straight forward to query. + +## Using Inline Ethereum addresses + +In Dune Ethereum addresses are stored as postgres bytearrays which are encoded with the `\x` prefix. This differs from the customary `0x` prefix. If you’d like to use an inline address, say to filter for a given token, you would do + +```sql +WHERE token = '\x6b175474e89094c44da98b954eedeac495271d0f' +``` + +which is simply short for + +```sql +WHERE token = '\x6b175474e89094c44da98b954eedeac495271d0f'::bytea +``` + +## Quote camel case column and table names + +Column and table names are mostly taken directly from smart contract ABIs, with no modification. Since most smart contracts are written in Solidity, and written with a camelCased naming convention, so is many of Dune’s table and column names. Postgres requires you to quote columns and tablenames that are case sensitive: + +```sql +SELECT “columnName” +FROM projectname.”contractName_evt_EventName” +LIMIT 10 +``` + +In Postgres, double quotes are reserved for tables and columns, whereas single quotes are reserved for values: + +```sql +SELECT “columnName” +FROM projectname.”contratName_evt_eventName” +WHERE contract_address = '\x6B175474E89094C44Da98b954EedeAC495271d0F' +LIMIT 10 +``` + +Schemas are always lowercase in Dune. + +## Remove decimals + +Ether transfers and most ERC-20 tokens have 18 decimal places. To get a more human readable number you need to remove all the decimals. The table `erc20.tokens` gives you contract address, symbol and number of decimals for popular tokens. Token value transfers are then divided by 10 to the power of decimals from this table: + +`transfer_value / 10^erc20.tokens.decimals` + +## Use `date_trunc` to get time + +We’ve added `evt_block_time` to decoded event tables for your convenience. A neat way to use it is with the `date_trunc` function like this + +```sql +SELECT date_trunc('week', evt_block_time) AS time +``` + +Here you can use minute, day, week, month. + +## How to get USD price + +To get the USD volume of onchain activity you typically want to join the smart contract event you are looking at with the usd price and join on minute. Also make sure that asset matches asset. + +```sql +LEFT JOIN prices.usd p +ON p.minute = date_trunc('minute', evt_block_time) +AND event."asset" = p.contract_address +``` + +Then you can simply multiply the value or amount from the smart contract event with the usd price in your `SELECT` statement: `* p.price`. + +## Token symbols + +You often want to group your results by token address. For instance you want to see volume on a DEX grouped by token. However, a big list of token addresses are abstract and hard to digest. + +Therefore you often want to use the token symbol instead. Simply join the table `erc20.tokens` with your event table where asset = token address. You then select symbol in your select statement instead of token address. + +**NB** The `erc20.tokens` table cointains a selection of popular tokens. If you are working with more obscure tokens you should be careful with joining with this table because tokens that are not in the coincap table might be excluded from your results. + +## Filter queries and dashboards with parameters + +Parameters can turn your query or dashboard into an app for blockchain data. + +Click `Add parameter` in the bottom right of the SQL editor on the query editor page + +![](https://i.imgur.com/rYJVSqA.png) + +Double curly bracets will appear in your query `{{}}`. Inside these you put the name of your paramter like `token symbol` or `holder address`. + +Note that you need to put single quotes if you want to use the parameter in your query `WHERE token = '{{token symbol}}'`. + +To save the user from having to put in `\x` for the address a useful formatting of addresses is this one: + +```sql +WHERE contract_address = CONCAT('\x', substring('{{token address}}' from 3))::bytea +``` + +This let’s a user of your query simply paste in `0xc00e94cb662c3520282e6f5717214004a7f26888` instead of `\xc00e94cb662c3520282e6f5717214004a7f26888` when they filter. diff --git a/about/tutorials/our-network-course.md b/about/tutorials/our-network-course.md new file mode 100644 index 0000000..2e530ce --- /dev/null +++ b/about/tutorials/our-network-course.md @@ -0,0 +1,13 @@ +# Our Network course + +Our friends from OurNetwork have created a course in cooperation with Dune Analytics that taught 30 people web3 data in 30 days. + +The course consists of presentations around all important topics that you need to become a Dune Creator and is available for free to everyone. It was hosted by some of the best creators we have on Dune nowadays and is currently the place to start your Dune Journey. + +More details and course materials can be found here: + +[https://ournetwork.mirror.xyz/gP16wLY-9BA1E\_ZuOSv1EUAgYGfK9mELNza8cfgMWPQ](https://ournetwork.mirror.xyz/gP16wLY-9BA1E\_ZuOSv1EUAgYGfK9mELNza8cfgMWPQ) + + + +Please consider buying an edition of the mirror post to support the teachers of this course. diff --git a/about/tutorials/queries/README.md b/about/tutorials/queries/README.md new file mode 100644 index 0000000..68ab646 --- /dev/null +++ b/about/tutorials/queries/README.md @@ -0,0 +1,40 @@ +# Query templates + +**In our experience, you are best off looking around Dune and finding queries that you might find interesting and looking at the source code of those to learn.** + +Dune is a collaborative endeavour that is shared by it's users. The compounded knowledge of all analysts will allow you to get to results the fastest way.\ +Seeing the queries live and in action does allow you to more intuitively engage with the content and learn faster. + +**Find great query creators and fork their queries for maximum efficiency.** + +**Some of our best creators are these:** + +* [https://dune.xyz/hagaetc](https://dune.xyz/hagaetc) +* [https://dune.xyz/rchen8](https://dune.xyz/rchen8) +* [https://dune.xyz/kroeger0x](https://dune.xyz/kroeger0x) +* \*\*\*\*[https://dune.xyz/eliasimos](https://dune.xyz/eliasimos) +* [https://dune.xyz/0xBoxer](https://dune.xyz/0xBoxer) +* \*\*\*\*[https://dune.xyz/Siang513](https://dune.xyz/Siang513) +* [https://dune.xyz/keeganead](https://dune.xyz/keeganead) + +**Nevertheless we have collected some queries here for a simple introduction:** + +{% content-ref url="untitled-6.md" %} +[untitled-6.md](untitled-6.md) +{% endcontent-ref %} + +{% content-ref url="supply.md" %} +[supply.md](supply.md) +{% endcontent-ref %} + +{% content-ref url="untitled-3.md" %} +[untitled-3.md](untitled-3.md) +{% endcontent-ref %} + +{% content-ref url="untitled-2.md" %} +[untitled-2.md](untitled-2.md) +{% endcontent-ref %} + +{% content-ref url="untitled-1.md" %} +[untitled-1.md](untitled-1.md) +{% endcontent-ref %} diff --git a/about/tutorials/queries/eth-balance-of-a-wallet.md b/about/tutorials/queries/eth-balance-of-a-wallet.md new file mode 100644 index 0000000..22bc42a --- /dev/null +++ b/about/tutorials/queries/eth-balance-of-a-wallet.md @@ -0,0 +1,38 @@ +# ETH Balance of a wallet + +This Query yields the ETH balance of a wallet over time. + +```sql +Select sum(transfer) over (order by day asc), day +from ( + +SELECT date_trunc('day', block_time) as day, sum(-value/1e18) as transfer + FROM ethereum."traces" + WHERE "from" = '\xb66284947F9A35bD9FA893D444F19033FeBdA4A1' --optimism bridge + AND (LOWER(call_type) NOT IN ('delegatecall', 'callcode', 'staticcall') or call_type is null) + AND "tx_success" = true + AND success = true + GROUP BY 1 + + UNION all + + SELECT + date_trunc('day', block_time) as day, sum(value/1e18) as transfer + FROM ethereum."traces" + WHERE "to" = '\xb66284947F9A35bD9FA893D444F19033FeBdA4A1' --optimism bridge + AND (LOWER(call_type) NOT IN ('delegatecall', 'callcode', 'staticcall') or call_type is null) + AND "tx_success" = true + AND success = true + GROUP BY 1 + + UNION ALL --gas costs + + SELECT + date_trunc('day', block_time) as day, -SUM(gas_price*"gas_used")/1e18 as transfer + FROM ethereum."transactions" + WHERE "from" = '\xb66284947F9A35bD9FA893D444F19033FeBdA4A1' --optimism bridge + GROUP BY 1 + ) as x +``` + +Original author: [https://twitter.com/MSilb7](https://twitter.com/MSilb7) diff --git a/about/tutorials/queries/gas-metrics-per-wallet.md b/about/tutorials/queries/gas-metrics-per-wallet.md new file mode 100644 index 0000000..ecf3ad8 --- /dev/null +++ b/about/tutorials/queries/gas-metrics-per-wallet.md @@ -0,0 +1,180 @@ +# gas metrics per wallet + +### Running Total of Gas Paid in USD + +```sql +with alltransactions +AS ( +SELECT + block_time, + success, + gas_price/10^9 AS gas_prices, + gas_used, + (gas_price*gas_used)/10^18 AS eth_paid_for_tx, + hash +FROM ethereum.transactions +WHERE "from" = CONCAT('\x', substring('{{1. Eth Address}}' from 3))::bytea +AND block_time >= '{{2. Start Date}}' +AND block_time < '{{3. End Date}}') + +SELECT + date_trunc('minute', block_time), + SUM(eth_paid_for_tx*price) over (ORDER BY date_trunc('minute', block_time)) AS "Total Gas Fees Paid in USD" +FROM alltransactions +LEFT JOIN + (SELECT + minute, + price + FROM prices.usd + WHERE + symbol = 'WETH' AND + minute > '{{2. Start Date}}') AS prices +ON date_trunc('minute', block_time) = minute +ORDER BY block_time DESC +``` + +### Running Total of Gas Paid in ETH + +```sql +with alltransactions +AS ( + +SELECT + block_time, + success, + gas_price/10^9 AS gas_prices, + gas_used, + (gas_price*gas_used)/10^18 AS eth_paid_for_tx, + hash +FROM ethereum.transactions +WHERE "from" = CONCAT('\x', substring('{{1. Eth Address}}' from 3))::bytea +AND block_time >= '{{2. Start Date}}' +AND block_time < '{{3. End Date}}') + +SELECT + block_time, + SUM(eth_paid_for_tx) over (ORDER BY block_time ASC) as "ETH Paid" +FROM alltransactions +ORDER BY block_time DESC +``` + +### Average Gas Price Paid + +```sql +with alltransactions +AS ( + +SELECT + block_time, + success, + gas_price/10^9 AS gas_prices, + gas_used, + (gas_price*gas_used)/10^18 AS eth_paid_for_tx, + hash +FROM ethereum.transactions +WHERE "from" = CONCAT('\x', substring('{{1. Eth Address}}' from 3))::bytea +AND block_time >= '{{2. Start Date}}' +AND block_time < '{{3. End Date}}') + +SELECT + AVG(gas_prices) as "Average Gas Prices" +FROM alltransactions +``` + +### Average Gas Fee in USD + +```sql +with alltransactions +AS ( + +SELECT + block_time, + success, + gas_price/10^9 AS gas_prices, + gas_used, + (gas_price*gas_used)/10^18 AS eth_paid_for_tx, + hash +FROM ethereum.transactions +WHERE "from" = CONCAT('\x', substring('{{1. Eth Address}}' from 3))::bytea +AND block_time >= '{{2. Start Date}}' +AND block_time < '{{3. End Date}}') + +SELECT + AVG(eth_paid_for_tx*price) AS "AVG Gas Fee per TX Paid in USD" +FROM alltransactions +LEFT JOIN + (SELECT + minute, + price + FROM prices.usd + WHERE + symbol = 'WETH' AND + minute > '{{2. Start Date}}') AS prices +ON date_trunc('minute', block_time) = minute +``` + +### Highest Gas Fee Paid in USD + +```sql +with alltransactions +AS ( + +SELECT + block_time, + success, + gas_price/10^9 AS gas_prices, + gas_used, + (gas_price*gas_used)/10^18 AS eth_paid_for_tx, + hash +FROM ethereum.transactions +WHERE "from" = CONCAT('\x', substring('{{1. Eth Address}}' from 3))::bytea +AND block_time >= '{{2. Start Date}}' +AND block_time < '{{3. End Date}}') + +SELECT + MAX(eth_paid_for_tx*price) AS "Higest Gas Fee Paid (USD)" +FROM alltransactions +LEFT JOIN + (SELECT + minute, + price + FROM prices.usd + WHERE + symbol = 'WETH' AND + minute > '{{2. Start Date}}') AS prices +ON date_trunc('minute', block_time) = minute +``` + +### Gas Fees Paid by Month in USD + +```sql +with alltransactions +AS ( +SELECT + block_time, + success, + gas_price/10^9 AS gas_prices, + gas_used, + (gas_price*gas_used)/10^18 AS eth_paid_for_tx, + hash +FROM ethereum.transactions +WHERE "from" = CONCAT('\x', substring('{{1. Eth Address}}' from 3))::bytea +AND block_time >= '{{2. Start Date}}' +AND block_time < '{{3. End Date}}') + +SELECT + date_trunc('month', block_time), + SUM(eth_paid_for_tx*price) AS "Total Gas Fees Paid in USD" +FROM alltransactions +LEFT JOIN + (SELECT + minute, + price + FROM prices.usd + WHERE + symbol = 'WETH' AND + minute > '{{2. Start Date}}') AS prices +ON date_trunc('month', block_time) = minute +GROUP BY 1 + +``` diff --git a/about/tutorials/queries/price-queries.md b/about/tutorials/queries/price-queries.md new file mode 100644 index 0000000..2577baf --- /dev/null +++ b/about/tutorials/queries/price-queries.md @@ -0,0 +1,110 @@ +# price queries + +### Centralized exchange price data + +```sql +Select + minute, + price, + symbol +from prices.usd + +WHERE symbol = '{{1. Symbol}}' + +and minute > now() - interval '1hour' +``` + +### Decentralized exchange price data + +```sql +Select + hour, + median_price, + d."contract_address" +from dex."view_token_prices" d +left join erc20.tokens e on d.contract_address = e.contract_address +WHERE symbol = '{{1. Symbol}}' + +and hour > now() - interval '1000hour' +``` + +This Query depends on the erc20.tokens table and can have gaps when there are no trades that been committed in that hour. + +For a better but more complicated to navigate version use this: + +```sql +with dex_trades AS ( + SELECT + token_a_address as contract_address, + usd_amount/token_a_amount as price, + block_time + FROM dex.trades + WHERE 1=1 + AND usd_amount > 0 + AND category = 'DEX' + AND token_a_amount > 0 + AND token_a_address = CONCAT('\x', substring('{{1. token_address}}' from 3))::bytea + + UNION ALL + + SELECT + token_b_address as contract_address, + usd_amount/token_b_amount as price, + block_time + FROM dex.trades + WHERE 1=1 + AND usd_amount > 0 + AND category = 'DEX' + AND token_b_amount > 0 + AND token_b_address = CONCAT('\x', substring('{{1. token_address}}' from 3))::bytea + + ), + + + rawdata as ( + + SELECT + date_trunc('hour', block_time) as hour, + d.contract_address, + e.symbol as asset, + (PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY price)) AS price, + count(1) AS sample_size + FROM dex_trades d + left join erc20.tokens e on e.contract_address = d.contract_address + GROUP BY 1, 2, 3 + + ) + + ,leaddata as + ( + SELECT + hour, + contract_address, + asset, + price, + sample_size, + lead(hour, 1, now() ) OVER (PARTITION BY contract_address ORDER BY hour asc) AS next_hour + from rawdata + where sample_size > 3 + ) + + ,hours AS + ( + SELECT + generate_series('2020-01-01'::TIMESTAMP, date_trunc('hour', NOW()), '1 hour') AS hour + ) + + + + SELECT + d.hour as hour, + contract_address, + asset, + price, + sample_size + from leaddata b + INNER JOIN hours d ON b.hour <= d.hour + AND d.hour < b.next_hour -- Yields an observation for every hour after the first transfer until the next hour with transfer +``` + +This will return the price by hour according to dex trading data and fill in gaps where there have been no trades commited. You can adjust the sample size of trades required to carry the price data forward in line 53. This can help ammend edge cases where arbritrage bots get weird prices on dexes. If you have issues with this, please reach out to us on Discord. diff --git a/about/tutorials/queries/supply.md b/about/tutorials/queries/supply.md new file mode 100644 index 0000000..c5ad313 --- /dev/null +++ b/about/tutorials/queries/supply.md @@ -0,0 +1,44 @@ +# total supply over time of a token + + + +You can either use that token's specific tables as long as they are [decoded](../../../data-tables/data-tables/decoded-data.md): + +```sql +SELECT +week, +SUM(transfer) over (order by week) +FROM + ( + SELECT + date_trunc('week', evt_block_time) as week, + sum(amount/1e18) as transfer + FROM ptokens."pBTC_evt_Minted" tr + GROUP BY 1 +UNION + SELECT + date_trunc('week', evt_block_time) as week, + sum(-amount/1e18) as transfer + FROM ptokens."pBTC_evt_Burned" tr + GROUP BY 1 +) as net; +``` + +Or you can use a more general purpose query like this one: + +(Please note that while this works for most tokens, some tokens do have slight changes in their structure that break this query) + +```sql +Select + sum(amount), + day + +from erc20."view_token_balances_daily" +where token_address = '\x429881672B9AE42b8EbA0E26cD9C73711b891Ca5' +and wallet_address != '\x0000000000000000000000000000000000000000' --mint address +and wallet_address != '\x000000000000000000000000000000000000dead' --burn address +group by 2 + +--mint and burn address are not standardized, make sure to query for the right ones +``` + diff --git a/about/tutorials/queries/tx-wallet.md b/about/tutorials/queries/tx-wallet.md new file mode 100644 index 0000000..761d488 --- /dev/null +++ b/about/tutorials/queries/tx-wallet.md @@ -0,0 +1,76 @@ +# raw transactions per wallet + +### Total # of Transactions + +```sql +with alltransactions +AS ( + +SELECT + block_time, + success, + gas_price/10^9 AS gas_prices, + gas_used, + (gas_price*gas_used)/10^18 AS eth_paid_for_tx, + hash +FROM ethereum.transactions +WHERE "from" = CONCAT('\x', substring('{{1. Eth Address}}' from 3))::bytea +AND block_time >= '{{2. Start Date}}' +AND block_time < '{{3. End Date}}') + +SELECT + count(*) +FROM alltransactions + +``` + +### Transaction Success Rate + +```sql +with alltransactions +AS ( + +SELECT + block_time, + success, + gas_price/10^9 AS gas_prices, + gas_used, + (gas_price*gas_used)/10^18 AS eth_paid_for_tx, + hash +FROM ethereum.transactions +WHERE "from" = CONCAT('\x', substring('{{1. Eth Address}}' from 3))::bytea +AND block_time >= '{{2. Start Date}}' +AND block_time < '{{3. End Date}}') + +SELECT + success, + count(success)*100/sum(count(*)) over () +FROM alltransactions +GROUP by success +ORDER BY success DESC +``` + +### Running Total of # of Transactions + +```sql +with alltransactions +AS ( + +SELECT + block_time, + success, + gas_price/10^9 AS gas_prices, + gas_used, + (gas_price*gas_used)/10^18 AS eth_paid_for_tx, + hash +FROM ethereum.transactions +WHERE "from" = CONCAT('\x', substring('{{1. Eth Address}}' from 3))::bytea +AND block_time >= '{{2. Start Date}}' +AND block_time < '{{3. End Date}}') + +SELECT + block_time, + COUNT(block_time) over (ORDER BY block_time ASC) AS "Total # of Transactions" +FROM alltransactions +``` + diff --git a/about/tutorials/queries/untitled-1.md b/about/tutorials/queries/untitled-1.md new file mode 100644 index 0000000..6ed74f4 --- /dev/null +++ b/about/tutorials/queries/untitled-1.md @@ -0,0 +1,81 @@ +# Token (and USD value) per token over time for an address + +Note that this query can get very heavy when there are many tokens and transfers over a long period of time. + +```sql +WITH transfers AS ( + + SELECT day, + address, + token_address, + sum(amount) AS amount -- Net inflow or outflow per day + FROM + + ( + SELECT date_trunc('day', evt_block_time) AS day, + "to" AS address, + tr.contract_address AS token_address, + value AS amount + FROM erc20."ERC20_evt_Transfer" tr + WHERE "to" = '\x70c730465dff5447a12bae37090446745c9edccc' --Filter for holding address + -- AND contract_address = '\xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' -- Filter for token address if you only want to see a specific token + + UNION ALL + + SELECT date_trunc('day', evt_block_time) AS day, + "from" AS address, + tr.contract_address AS token_address, + -value AS amount + FROM erc20."ERC20_evt_Transfer" tr + WHERE "from" = '\x70c730465dff5447a12bae37090446745c9edccc' --Filter for holding address + -- AND contract_address = '\xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' -- Filter for token address if you only want to see a specific token + ) t + GROUP BY 1, 2, 3 + ) + +, balances_with_gap_days AS ( + SELECT t.day, + address, + t.token_address, + SUM(amount) OVER (PARTITION BY token_address, address ORDER BY t.day) AS balance, -- balance per day with a transfer + lead(day, 1, now()) OVER (PARTITION BY token_address, address ORDER BY t.day) AS next_day -- the day after a day with a transfer + FROM transfers t + ) + + , days AS ( + SELECT generate_series('2020-07-01'::timestamp, date_trunc('day', NOW()), '1 day') AS day -- Generate all days since the first contract + ) + +, balance_all_days AS ( + SELECT d.day, + address, + erc.symbol, + b.token_address, + SUM(balance/10^decimals) AS balance + FROM balances_with_gap_days b + INNER JOIN days d ON b.day <= d.day AND d.day < b.next_day -- Yields an observation for every day after the first transfer until the next day with transfer + INNER JOIN erc20.tokens erc ON b.token_address = erc.contract_address + GROUP BY 1, 2, 3, 4 + ORDER BY 1, 2, 3, 4 + ) + +SELECT b.day, + b.symbol, + b.token_address, + SUM(balance) AS token_balance, + SUM(balance*p.price) AS balance_usd_value +FROM balance_all_days b +LEFT JOIN ( + SELECT date_trunc('day', p.minute) as day, + contract_address, + symbol, + decimals, + AVG(p.price) as price + FROM prices."usd" p + GROUP BY 1, 2, 3, 4 + ) p ON b.day = p.day AND b.token_address = p.contract_address +GROUP BY 1,2,3 +ORDER BY 1,2,3 +; + +``` diff --git a/about/tutorials/queries/untitled-2.md b/about/tutorials/queries/untitled-2.md new file mode 100644 index 0000000..993836d --- /dev/null +++ b/about/tutorials/queries/untitled-2.md @@ -0,0 +1,51 @@ +# USD price for a token from Uniswap + +The most common and easiest way to get token USD prices on Dune Analytics is with the `prices.usd` table. However, this data is fetched from centralised exchanges so for a long tail of tokens the best approach is to get prices from Uniswap. + +This query uses WETH pairs, which is used to map to USD price. The query can be modified to work with any token that has a price in `prices.usd` + +You can find this query on Dune [here](https://explore.dune.xyz/queries/11050/source?p\_Token%20address=0xeb4c2781e4eba804ce9a9803c67d0893436bb27d). + +```sql +WITH weth_pairs AS ( -- Get exchange contract address and "other token" for WETH + SELECT cr."pair" AS contract, + CASE WHEN cr."token0" = '\xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' then '0' ELSE '1' END AS eth_token, + CASE WHEN cr."token1" = '\xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' then cr."token0" ELSE cr."token1" END AS other_token + FROM uniswap_v2."Factory_evt_PairCreated" cr + WHERE token0 = '\xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' OR token1 = '\xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' + ) + +, swap AS ( -- Get all trades on the pair last 14 days + SELECT + CASE WHEN eth_token = '0' then sw."amount0In" + sw."amount0Out" ELSE sw."amount1In" + sw."amount1Out" + END/1e18 AS eth_amt, + CASE WHEN eth_token = '1' then sw."amount0In" + sw."amount0Out" ELSE sw."amount1In" + sw."amount1Out" + END/power(10, tok."decimals") AS other_amt, -- If the token is not in the erc20.tokens list you can manually divide by 10^decimals + tok."symbol", + tok."contract_address", + date_trunc('hour', sw."evt_block_time") AS hour + FROM uniswap_v2."Pair_evt_Swap" sw + JOIN weth_pairs ON sw."contract_address" = weth_pairs."contract" + JOIN erc20."tokens" tok ON weth_pairs."other_token" = tok."contract_address" + WHERE other_token = '\xeb4c2781e4eba804ce9a9803c67d0893436bb27d' --renBTC example + -- To allow users to submit token address in the Dune UI you can use the below line: + -- WHERE other_token = CONCAT('\x', substring('{{Token address}}' from 3))::bytea -- Allow user to input 0x... format and convert to \x... format + AND sw.evt_block_time >= now() - interval '14 days' + ) + +, eth_prcs AS ( + SELECT avg(price) eth_prc, date_trunc('hour', minute) AS hour + FROM prices.layer1_usd_eth + WHERE minute >= now() - interval '14 days' + group by 2 + ) + +SELECT + AVG((eth_amt/other_amt)*eth_prc) AS usd_price, + swap."symbol" AS symbol, + swap."contract_address" AS contract_address, + eth_prcs."hour" AS hour +FROM swap JOIN eth_prcs ON swap."hour" = eth_prcs."hour" +GROUP BY 2,3,4 +; +``` diff --git a/about/tutorials/queries/untitled-3.md b/about/tutorials/queries/untitled-3.md new file mode 100644 index 0000000..1a13f47 --- /dev/null +++ b/about/tutorials/queries/untitled-3.md @@ -0,0 +1,15 @@ +# USD value of token utilised for an event + +### + +```sql +SELECT +date_trunc('week', evt_block_time), +SUM(amount/1e18 * p.price) AS staked +FROM numerai."SimpleGriefing_evt_StakeAdded" s --Replace with relevant event +LEFT JOIN prices.usd p ON p.minute = date_trunc('minute', evt_block_time) +WHERE p.symbol = 'NMR' --Replace with relevant token +-- WHERE p.contract_address = s.token_address --In case different tokens +GROUP BY 1; +``` + diff --git a/about/tutorials/queries/untitled-6.md b/about/tutorials/queries/untitled-6.md new file mode 100644 index 0000000..ebe8bfb --- /dev/null +++ b/about/tutorials/queries/untitled-6.md @@ -0,0 +1,12 @@ +# Users and amount over a trailing period + +```sql +SELECT date_trunc('day', evt_block_time), + COUNT (DISTINCT buyer), + SUM(eth_bought / 1e18) +FROM uniswap."Exchange_evt_EthPurchase" p +WHERE evt_block_time > now() - interval '7 days' +GROUP BY 1 +ORDER BY 1; +``` + diff --git a/about/tutorials/sql-guides.md b/about/tutorials/sql-guides.md new file mode 100644 index 0000000..f1697ff --- /dev/null +++ b/about/tutorials/sql-guides.md @@ -0,0 +1,16 @@ +# SQL guides + +**General PostgreSQL Tutorials** + +To be a successful Dune Wizard you need to have a good understanding of PostgreSQL to be able to query data from our database. + +We have compiled a few resources that we think are helpful in your journey to becoming a Dune Wizard. + +[FreecodeCamp.org](https://www.youtube.com/watch?v=qw--VYLpxG4) Video Playlist (FREE) + +[Amigoscode](https://www.youtube.com/watch?v=5hzZtqCNQKk) Youtube Video (FREE) + +[UDEMY Course SQL & PostgreSQL for Beginners](https://www.udemy.com/course/sql-and-postgresql-for-beginners/?ranMID=39197\&ranEAID=JVFxdTr9V80\&ranSiteID=JVFxdTr9V80-nnMsdWXzWeu9lqxtbEa72g\&utm\_source=aff-campaign\&LSNPUBID=JVFxdTr9V80\&utm\_medium=udemyads) ($10) + +[Mode SQL Tutorial](https://mode.com/sql-tutorial/) (FREE) + diff --git a/about/tutorials/video-series.md b/about/tutorials/video-series.md new file mode 100644 index 0000000..d5114e2 --- /dev/null +++ b/about/tutorials/video-series.md @@ -0,0 +1,34 @@ +# Video Series + +We have produced a video tutorial series on our [Youtube Channel](https://www.youtube.com/channel/UCPrm9d2hLd\_YxSExH7oRyAg). + +## Dune Analytics 5 Minute Intro + +This Video is the quickest and best way to get an introduction to Dune, be sure to check it out. + +{% embed url="https://www.youtube.com/watch?v=S-cctFmR828" %} + +## Intro to the Course + +This Video serves as an overview and intro to the whole course. + +{% embed url="https://youtu.be/USTIesVPk68" %} + +## Episode 1: Usecases and Applications + +This Video explains the basics of Dune and what it can be used for. + +{% embed url="https://www.youtube.com/watch?v=IHC8HAZvw_Q" %} + +## Episode 2: The database + +This Video goes over the Data tables in Dune and how the database works. + +{% embed url="https://youtu.be/UDu23Eyvo_Y" %} + +## Episode 3.1: Simple Queries and recreating Fees.wtf in Dune + +This Video is a great introduction to querying inside of Dune. Our Community Manager Boxer recreates Fees.wtf inside of Dune, so the Video mostly focuses on gas transactions. + +{% embed url="https://youtu.be/ez3VfcfNwvc" %} + diff --git a/about/usecases/README.md b/about/usecases/README.md new file mode 100644 index 0000000..e3afc81 --- /dev/null +++ b/about/usecases/README.md @@ -0,0 +1,40 @@ +--- +description: >- + Leverage Dune to generate Insights for yourself, your project or your + organisation. +--- + +# Use Cases + +## Dune is an open platform + +Dune is a data analytics platform that surfaces blockchain data turns on chain data into human readable data available to users for free. Users can query on chain data using PostgreSQL and create dashboards that group queries together to tell a story. Queries on Dune are public goods and are available for anyone to view and fork with the exception of private queries, which are available to users who have the pro plan subscription. + +## **What is Dune used for?** + +Since pretty much everything is possible on Dune, there really aren't any limitations as to what you can query in regards to on-chain data. There still is some distinct Use Cases we can establish: + +{% content-ref url="sector-dashboards.md" %} +[sector-dashboards.md](sector-dashboards.md) +{% endcontent-ref %} + +{% content-ref url="project-dashboards.md" %} +[project-dashboards.md](project-dashboards.md) +{% endcontent-ref %} + +{% content-ref url="ecosystem-dashboards.md" %} +[ecosystem-dashboards.md](ecosystem-dashboards.md) +{% endcontent-ref %} + +\ +What type of content is generated on Dune? +------------------------------------------ + +To get more insights into how people use Dune, you can follow our Twitter account where we retweet the most interesting things that happen on Dune.\ +\ +Just click through the last few tweets and see what people are up to on Dune currently! + +{% embed url="https://twitter.com/DuneAnalytics" %} + +\ +\\ diff --git a/about/usecases/ecosystem-dashboards.md b/about/usecases/ecosystem-dashboards.md new file mode 100644 index 0000000..0ca7efc --- /dev/null +++ b/about/usecases/ecosystem-dashboards.md @@ -0,0 +1,23 @@ +# Ecosystem Dashboards + +**Since Dune has all the data in one place you can also check more general metrics.** + +## Gas Prices + +[https://dune.xyz/kroeger0x/gas-prices](https://dune.xyz/kroeger0x/gas-prices) + +You can easily assemble the data on average gas spent per tx, gas limit, gas spent in total in a block etc. using Dune. + +![](<../../.gitbook/assets/image (13) (2).png>) + +![](<../../.gitbook/assets/image (21).png>) + +Data on gas spent and similar metrics can also be relevant to certain protocols, so do keep this in mind. + +## **DeFi Adoption** + +[Richard Chen](https://twitter.com/richardchen39) has compiled the user numbers of all important DeFi Protocols and compiled them in one Dashboard. + +![](<../../.gitbook/assets/image (22).png>) + +[https://dune.xyz/rchen8/defi-users-over-time](https://dune.xyz/rchen8/defi-users-over-time) diff --git a/about/usecases/project-dashboards.md b/about/usecases/project-dashboards.md new file mode 100644 index 0000000..d328b04 --- /dev/null +++ b/about/usecases/project-dashboards.md @@ -0,0 +1,26 @@ +--- +description: Project Dashboards are a great way to track the metrics of your project. +--- + +# Project Dashboards + +**Project Dashboard allow you to easily assemble data on your favorite project in one place.**\ +**Without having to maintain infrastructure or overhead, you can simply query for the data you desire and assemble it on a Dashboard to make a Datahub for your project Reality.** + +**Let's explore this with an example:** + +\*\*\*\*[**https://dune.xyz/poma/tornado-cash\_1**](https://dune.xyz/poma/tornado-cash\_1)\*\*\*\* + +This is the dashboard from Tornado Cash on which someone assembled all the important metrics in one place. + +![](<../../.gitbook/assets/image (18).png>) + +We can see that the creator is showing us a few "on a glance" counters which tell us the most important information in simple numbers. + +![](<../../.gitbook/assets/image (18) (1).png>) + +He follows this up with some interesting historical data points which show the growth in users and volume. The Dashboard continues, but you can clearly already see how much value these stats and charts can produce for your project. + +Having all these stats in one place greatly helps to manage your project and help it succeed. + +You can find many other great dashboard on our [Projects Page](https://dune.xyz/projects). diff --git a/about/usecases/sector-dashboards.md b/about/usecases/sector-dashboards.md new file mode 100644 index 0000000..b2e2610 --- /dev/null +++ b/about/usecases/sector-dashboards.md @@ -0,0 +1,49 @@ +# Sector Dashboards + +**Sector Dashboards allow you to glance at an entire sector of our new Economy and analyse what's happening in real time.** + +Let's explore this with some examples: + +## Dex Metrics + +[**https://dune.xyz/hagaetc/dex-metrics**](https://dune.xyz/hagaetc/dex-metrics) + +This Dashboard allows you to take a look at the entirety of decentralized exchanges at once. + +You can see Dex Volume, Market share, Total Volume across all exchanges and many more stats all on one glance. This allows you to compare the performance of different dexes with each other and at the same time evaluate the performance of the entire sector. + +All of this updates in real time and is maintained by the community, if a new dex wants to be on this dashboard, all they have to do is submit their code to our public github. More on this in [abstractions](../../data-tables/data-tables/abstractions.md). + +![](<../../.gitbook/assets/image (7).png>) + +![](<../../.gitbook/assets/image (8).png>) + +![](<../../.gitbook/assets/image (9).png>) + +## Indices + +[**https://dune.xyz/0xBoxer/indices-products**](https://dune.xyz/0xBoxer/indices-products) + +Another interesting Dashboard we have is a dashboard on decentralized indices. + +Here again, you can evaluate the entire state of a sector in one glance, being able to compare different products and projects to each other with ease. + +![](<../../.gitbook/assets/image (10).png>) + +![](<../../.gitbook/assets/image (11).png>) + +![](<../../.gitbook/assets/image (12).png>) + +## Lending + +The same applies for lending protocols, it allows you to easily check the state of lending protocols and compare them to each other with ease. + +![](<../../.gitbook/assets/image (13).png>) + +![](<../../.gitbook/assets/image (14).png>) + +## Summary + +Sector Dashboards allow your audience to make assumptions on a whole sector of this nascent Industry. This is very useful for comparing different products with each other and trying to spot trends. + +Most Sector Dashboards are relying on one or many [abstraction](../../data-tables/data-tables/abstractions.md) tables which make it easy to query for vast amounts of data and standardizing between the different protocols. diff --git a/bounties/wizard-request-program.md b/bounties/wizard-request-program.md new file mode 100644 index 0000000..dd09cc6 --- /dev/null +++ b/bounties/wizard-request-program.md @@ -0,0 +1,36 @@ +# Wizard Request Program + +#### For projects looking for Wizards + +If you're a project looking to have more/better dashboards on Dune, we've created this program for you. This is how it works: + +1. Project fills out [this form](https://bounties.dune.xyz) explaining what they're all about and the kind of insights they'd like to see surfaced on Dune and how much they're willing to pay for it.\\ +2. We share this with our community and interested wizards get in touch with you.\\ +3. Project screens wizards and chooses who to work with.\\ +4. The data flows. + +As opposed to more traditional bounty programs, the Wizard Request program is meant to unlock long-lasting relationships/collaborations between the analysts and the projects at large. + +#### For Wizards looking for :moneybag::moneybag::moneybag: + +If you are a wizard looking for bounties, make sure to join [our Discord](https://discord.gg/ErrzwBz), go to our “freelancer-listing” channel and click on the flying dollar bill emoji there. Also follow the [bounty bot](https://twitter.com/Dune\_Bounties) on Twitter. + +**FAQs about the program** + +_- I need a lot of data, how many requests should I post?_ + +Think of every request as a dashboard. If you’d like to see all of your information in just one dashboard, then just one request. If, on the other hand, you’d like to see three different dashboards we recommend you create three requests. Creating three requests doesn’t necessarily mean working with three different analysts, that will be up to you to decide. + +\ +_- I’m an analyst. How do I enroll?_ + +For the moment the only thing you need to do is join [our Discord](https://discord.gg/dunecom), go to our “freelancer-listing” channel and click on the flying dollar bill emoji there, this way you’ll get notified when new requests arrive. Oh and you should definitely follow the [bounty bot](https://twitter.com/Dune\_Bounties) on Twitter. + +\ +_- I want to create a requests but I don’t know how much should I pay/offer for it_ + +Well, that really depends on how much work/complexity your request entails but to the extent that you can, we encourage you to be generous. If you ain’t sure you can always ask on our Discord! + +_- Does Dune take a cut?_ + +No we don’t. In fact, Dune does not take part in closing the deal or following up over time, this is strictly between the wizard and the project. diff --git a/changelog/dune-changes/README.md b/changelog/dune-changes/README.md new file mode 100644 index 0000000..0cfb8ba --- /dev/null +++ b/changelog/dune-changes/README.md @@ -0,0 +1,2 @@ +# Changes to Dune + diff --git a/changelog/dune-changes/august-2020.md b/changelog/dune-changes/august-2020.md new file mode 100644 index 0000000..b698c9f --- /dev/null +++ b/changelog/dune-changes/august-2020.md @@ -0,0 +1,41 @@ +# August 2020 + + + +#### Price Provider Switch + +We’ve changed price providers from Coincap to Coinpaprika, and in turn now have prices for 230+ assets in the `prices.usd` and `prices.layer1_usd` tables! A slight caveat is that while previously we had prices for all minutes up to current time, we now have prices up to 5 minutes before current time. + +**New table prices.layer1\_usd** + +We’ve moved all assets that are not tokens on Ethereum to their own table `prices.layer1_usd`. This table is partitioned on `symbol` and has `(symbol, minute)` as primary key as before. + +``` + Column │ Type +────────┼────────────────────────── + minute │ timestamp with time zone + price │ double precision + symbol │ text +``` + +#### Changes to prices schema + +**New column decimals on prices.usd** + +We’ve added a new column `decimals` to `prices.usd` so that you can avoid the additional join with `erc20.tokens` for calculating correct volumes. + +**New primary key for prices.usd** + +Previously `prices.usd` was partitioned on the token `symbol`, and it’s primary key was `(symbol, minute)`. In this release we’ve made a change to this scheme to allow for multiple `contract_address`es to map to the same `symbol`. This could happen e.g. in times where a token migration is happening. `prices.usd` is now partitioned on `contract_address` and it’s primary key is `(contract_address, minute)`. + +Note that this might yield some weird results for queries that rely on doing `SELECT minute, price FROM prices.usd WHERE symbol='x'` in certain cases where there are two contracts mapped to the symbol `x` in a time window. You may then receive several rows per minute. It is better to then use the primary key `contract_address` for filtering and joining. + +``` + Column │ Type +──────────────────┼───────────────────────── + minute │ timestamp with time zone + price │ double precision + decimals │ smallint + contract_address │ bytea + symbol │ text +``` diff --git a/changelog/dune-changes/january-2020.md b/changelog/dune-changes/january-2020.md new file mode 100644 index 0000000..fd62f32 --- /dev/null +++ b/changelog/dune-changes/january-2020.md @@ -0,0 +1,116 @@ +# January 2020 + +## Postgres 12.1 + +We’ve upgraded the database from postgres 11 to postgres 12.1. This should result in performance improvements across the board. + +## ERC20 Transfer and Approval tables + +You can now query the `erc20."ERC20_evt_Transfer"` and `erc20."ERC20_evt_Approval"` tables to get decoded token transfers and approvals. These tables should include all events that could be decoded using the ABI of the ERC20 standard. This means that all transfers from all tokens can be queried through this table. The table is large (240M rows at time of writing), so please let us know your experience of the query performance. + +`erc20."ERC20_evt_Transfer"` schema: + +| Column | Type | +| ------------------ | --------- | +| `"from"` | `bytea` | +| `"to"` | `bytea` | +| `value` | `numeric` | +| `contract_address` | `bytea` | +| `evt_tx_hash` | `bytea` | +| `evt_index` | `bigint` | + +`erc20."ERC20_evt_Approval"` schema: + +| Column | Type | +| ------------------ | --------- | +| `owner` | `bytea` | +| `spender` | `bytea` | +| `value` | `numeric` | +| `contract_address` | `bytea` | +| `evt_tx_hash` | `bytea` | +| `evt_index` | `bigint` | + +Here `contract_address` refers to the contract emmitting the event, i.e. the token address, while `evt_tx_hash` and `evt_index` conveniently lets you join with `ethereum.logs` using a query like + +``` +SELECT * +FROM erc20."ERC20_evt_Approval" apps +INNER JOIN ethereum.logs +ON apps.evt_tx_hash = logs.tx_hash AND apps.evt_index = logs.index +LIMIT 100; +``` + +Also note that you can join these tables with `erc20.tokens` to get human readable token symbols and the number of decimals like + +``` +SELECT value/10^decimals, tr.* +FROM erc20."ERC20_evt_Transfer" tr +LEFT JOIN erc20.tokens t +ON t.contract_address = tr.contract_address +WHERE symbol = 'MKR' +LIMIT 10 +``` + +Note though that + +**Examples** + +**Top token holders** + +``` +WITH transfers AS ( + SELECT + evt_tx_hash AS tx_hash, + tr."from" AS address, + -tr.value AS amount + FROM erc20."ERC20_evt_Transfer" tr + WHERE contract_address = '\x6810e776880c02933d47db1b9fc05908e5386b96' --GNO +UNION ALL + SELECT + evt_tx_hash AS tx_hash, + tr."to" AS address, + tr.value AS amount + FROM erc20."ERC20_evt_Transfer" tr + WHERE contract_address = '\x6810e776880c02933d47db1b9fc05908e5386b96' --GNO +) +SELECT address, sum(amount/1e18) as balance +FROM transfers +GROUP BY 1 +ORDER BY 2 desc +LIMIT 10 +``` + +**Token Balances** + +``` +WITH transfers AS ( + SELECT + evt_tx_hash AS tx_hash, + contract_address AS token_address, + -tr.value AS amount + FROM erc20."ERC20_evt_Transfer" tr + WHERE tr."from" = '\xdeadbeef' -- insert real address here +UNION ALL + SELECT + evt_tx_hash AS tx_hash, + contract_address AS token_address, + tr.value AS amount + FROM erc20."ERC20_evt_Transfer" tr + WHERE tr."to" = '\xdeadbeef' -- insert real address here +) +SELECT token_address, sum(amount/1e18) as balance +FROM transfers +GROUP BY 1 +ORDER BY 2 desc; +``` + +## Fallback decoding + +The above tables are generated with a new feature we call “fallback decoding”. Essentially it breaks down to being able to decode logs regardless of the events contract address or contract bytecode. If you know other cases where this decoding can be useful feel free to let us know at [hello@dune.xyz](mailto:hello@dune.xyz) + +## Misc + +* Data for Gnosis sight, safe and dfusion can now be found in `gnosis_sight`, `gnosis_safe` and `gnosis_dfusion` schemas respectively. +* Synthetix token-contracts now have the correct name `Synthetix` and are found in the `synthetix` schema +* `prices.usd_dai` have been renamed to `prices.usd_sai`, and the symbol changed to `SAI` - we still don’t have `DAI` prices unfortunately, as our price provider has not listed it. +* `prices.usd_rep` now has the correct token address for `REP` for entries after the migration. Previsouly all entries had the old address. diff --git a/changelog/dune-changes/march-2020.md b/changelog/dune-changes/march-2020.md new file mode 100644 index 0000000..95ad1a8 --- /dev/null +++ b/changelog/dune-changes/march-2020.md @@ -0,0 +1,120 @@ +# March 2020 + + + +Big release on the data front this month. + +#### Denormalization of `block_time` and `block_number` + +We’ve added `block_time` and `block_number` to all decoded events and calls, with names `evt_block_time`, `evt_block_number` and `call_block_time`, `call_block_number` respectively. This will eliminate the most painful joins on the platform, joining with `ethereum.transactions` in order to get a time dimension into your queries. + +Where previously would need to do + +``` +SELECT date_trunc('day', tx.block_time), count(*) +FROM uniswap."Exchange_ev t_TokenPurchase" tp +INNER JOIN ethereum.transactions tx ON tp.evt_tx_hash = tx.hash +GROUP BY 1; +``` + +in order to get the number of daily `TokenPurchase`-events on Uniswap, you can now simply do + +``` +SELECT date_trunc('day', evt_block_time), count(*) +FROM uniswap."Exchange_evt_TokenPurchase" +GROUP BY 1; +``` + +eliminating a painful and costly join. Joining across two decoded tables can also be done without involving any of the `ethereum`-tables by using `evt_block_number` or `call_block_number`. + +#### Decoding events without parameters + +We’re also “decoding” events that are emitted without parameters. These events have their own tables, but only include Dune-added fields i.e.: + +| Column | Type | +| ------------------ | ------------- | +| `contract_address` | `bytea` | +| `evt_tx_hash` | `bytea` | +| `evt_index` | `bigint` | +| `evt_block_time` | `timestamptz` | +| `evt_block_number` | `bigint` | + +#### Decoding call outputs + +We’ve added function return values to decoded `call` tables. Whenever a function has a named return value it will be decoded into `output_{{name}}`, and when it is not named it will be decoded into `output_{{i}}` where `i` is a counter that starts at 0. Consider the following case, counting success and error codes for calls to the Compound CERC20 `mint` function: + +``` +SELECT output_0, count(*) +FROM compound_v2."cErc20_call_mint" +WHERE call_success +GROUP BY 1; +``` + +#### traces.success + +**TLDR**: we’ve added a `success` field to `ethereum.traces` that you can use to figure out if an exact call was successful. Useful for e.g. calculating balances. Here’s an example: + +``` +SELECT sum(amount) +FROM ( + SELECT address, sum(amount) / 1e18 as amount + FROM ( + SELECT "from" AS address, -value AS amount + FROM ethereum.traces + WHERE "from" = '\x390435245F2f95f7443eBb045357DA743E9A65a4' + and success = true + UNION ALL + SELECT "to" AS address, value AS amount + FROM ethereum.traces + WHERE "to" = '\x390435245F2f95f7443eBb045357DA743E9A65a4' + AND success = true + UNION ALL + SELECT "from" AS address, -gas_used * gas_price as amount + FROM ethereum.transactions + WHERE "from" = '\x390435245F2f95f7443eBb045357DA743E9A65a4' + ) t + group by 1 +) a +; +``` + +**Longer Story**: Dune ingests transaction traces from Parity OpenEthereum. OpenEthereum returns a tree-like datastructure of function call traces, where some can have a non-null `error` field. Where previously we ingested the traces more or less _as is_, today we’ve added a `success` field to `ethereum.traces`. This `success` field is `true` for a given trace if no trace above it in the trace hierarchy has a non-null `error` field. + +It came to our attention that if a _parent_ trace-entry has a non-null `error` field, the _child_ call is considered failed in the EVM as well. Previously in Dune, in order to correctly assess whether or not a given function call’s state change was included in the blockchain you would’ve needed to write a slightly complex query to check if any traces in the same branch of the trace tree had an error. With the addition of the `success` field today, this has become much easier. + +Note that the field `tx_success` field denotes the success of the transaction as a whole, and that a `true` `tx_success`-field, does not necessarily mean that every function call in the transaction has a `true` `success` field. Here are the potential combinations + +| tx\_success | sucess | +| ----------- | ------- | +| `true` | `true` | +| `true` | `false` | +| `false` | `false` | + +As you can see a call can be _not successful_ in a _successful_ transaction, but can not be _successful_ in a _not successful_ transaction… + +Also note that where previously the field `call_success` on decoded tables where calculated as `traces.tx_success && !traces.error`, it is now directly copied from `traces.success`. + +#### Postgresql 12.2 + +Upgraded the databases to postgresql 12.2. Changelog [here](https://www.postgresql.org/docs/current/release-12-2.html). + +#### Misc + +Renamed some curvefi-contracts: + +| schema | name | Address | +| ------- | ------------ | ------------------------------------------ | +| curvefi | compound | 0xe5fdbab9ad428bbb469dee4cb6608c0a8895cba5 | +| curvefi | usdt | 0x52ea46506b9cc5ef470c5bf89f17dc28bb35d85c | +| curvefi | y | 0x45f783cce6b7ff23b2ab2d70e416cdb7d6055f51 | +| curvefi | compound\_v2 | 0x2e60cf74d81ac34eb21eeff58db4d385920ef419 | +| curvefi | busd | 0x79a8c46dea5ada233abaffd40f3a0a2b1e5a4f27 | +| curvefi | compound\_v3 | 0xa2b47e3d5c44877cca798226b7b8118f9bfb7a56 | + +Moved onesplit contracts to their own schema. + +| schema | name | address | +| -------- | -------- | ------------------------------------------------------ | +| onesplit | OneSplit | 0x2ad672fda8a042c4c78c411bf9d4f1b320aa915a | +| onesplit | OneSplit | 0xdff2aa5689fcbc7f479d8c84ac857563798436dd | +| onesplit | OneSplit | 0x0a236b41add0073df05eac5fc8505ad745c\*\*\*\*\*\*7859d | diff --git a/changelog/dune-changes/march-2021.md b/changelog/dune-changes/march-2021.md new file mode 100644 index 0000000..12a7001 --- /dev/null +++ b/changelog/dune-changes/march-2021.md @@ -0,0 +1,71 @@ +--- +description: Dune Analytics version 2.0 +--- + +# March 2021 + +## Overview of changes + +* Queries + * Saving + * Running +* Refreshing +* Various other upgrades + +While all the core functionality you expect from Dune is available in Dune v2 the new version of Dune brings changes to how queries and refreshing work, both on the surface and under the hood. + +## Queries + +**Saving** + +By default, **new queries are not saved** to your queries so you can play around and test various ideas quickly. If you want to keep your work, remember to hit the **Save button** and give your query a name. + +This means that if you navigate away from a page without saving, your work is lost. If you allow notifications from [dune.xyz](http://dune.xyz/) in your browser, the app will notify you when you navigate away from unsaved content. + +The same applies to forks. A fork is not saved to your queries before you click the **Save button** and give your fork a name. + +**Running** + +We’ve merged the old save and execute buttons into a single button, **Run**. When you click **Run** on a saved query, any changes you’ve made to the query text is saved and the query is queued for execution. + +> _**Useful tip:**_ Press `CMD / CTRL + Enter` to run your query. + +**Running query snippets** + +If you mark parts of your query, the button changes to **Run selection**, and executes the part of the query that you’ve marked. This will updates the results and visualizations in the process but _**not save**_ the query. + +> _**Useful tip:**_ if you want to execute the whole query without saving it, select all of the query (CMD / CTRL + A) and then hit **Run selection**. + +## Refreshing + +There’s also changes to how results are refreshed. Over the last months we’ve been redesigning our entire query execution backend to bring large improvements to how Dune works. + +When a visualization is viewed, either on a query page or on a dashboard, the Dune backend will inspect the age of the most recent result. If the result is stale (currently defined as >3 hours old), Dune will automatically queue an execution for this query and run it in the background. + +This means that your dashboards will always be kept up to date when they are being viewed. + +Query creators does not need to set a refresh scheduele and the scheduling feature has been deprecated as it is no longer needed to keep results fresh. + +## Queues + +We’re also bringing changes to how queueing works in Dune. When you manually click **Run** on a query an execution is queued. Every user on Dune can queue 3 queries at the same time (pro users have more, see our [pricing](https://hackmd.io/YOP3YIgaRAejTPE190sOjw?view) page for more info). + +Automatically refreshed results (as we talked about above) does not use the query creators queuing credits nor the viewing user’s. + +## Other updates + +**A faster and better looking Dune** - the whole Dune app including all the charts have gotten a big facelift. The app is now also many times faster. + +**Query parameters** - what is probably Dune’s most underrated feature has gotten a major upgrade. It’s now super easy to filter any query or dashboard for a token, address or anything really. Meaning you can turn your queries and dashboards into interactive apps for onchain data. + +**See all content without having to log in** - simply copy and share the link from the page you are on. The exception is for paid users that make their content private, more details on our [pricing page](https://hackmd.io/YOP3YIgaRAejTPE190sOjw?view). + +**Errors show on the relevant line** - when running your queries you will see error messages directly on the relevant line in your code. + +**Click query title to go to query from a dashboard** + +We’d love to get your feedback on your experience with Dune v2 in the #feedback channel in our [Discord](https://discord.com/invite/ErrzwBz). You can also contact [support@dune.xyz](mailto:support@dune.xyz) if you face any issues. + +Happy querying! + +**PS.** There are a few visualisation types that are currently not supported in Dune v2: pivot, cohort, funnel, heatmap and bubble. We’ve emailed the users that are affected. If you have not been emailed all your queries and visualisations should work seamlessly in v2. diff --git a/changelog/dune-changes/october-2019.md b/changelog/dune-changes/october-2019.md new file mode 100644 index 0000000..6387652 --- /dev/null +++ b/changelog/dune-changes/october-2019.md @@ -0,0 +1,20 @@ +# October 2019 + +#### New data structure + +If you are forking old queries you need to be aware of these changes to you can replace old table and column names with new ones. + +#### USD price tables + +Previously the usd price table was named `coincap."tokens/usd"` this is now changed to `prices.usd` with the fields + +``` +symbol -- unchanged +contract_address -- previously "asset" +price -- previously "average" +minute -- previously "time" +``` + +#### Dune generated columns + +We add some data fields to all decoded tables for `calls` and `events`. These are now named `evt_index, evt_tx_hash, contract_address`. Previously these were simplt named `index, tx_hash, address` but we wanted to make it clear that these are added by Dune and not extracted directly from the blockchain. diff --git a/data-tables/data-tables/README.md b/data-tables/data-tables/README.md new file mode 100644 index 0000000..dba9768 --- /dev/null +++ b/data-tables/data-tables/README.md @@ -0,0 +1,52 @@ +--- +description: Data Tables are what makes Dune work. +--- + +# Data tables + + + +{% embed url="https://www.youtube.com/watch?v=UDu23Eyvo_Y" %} + +This video covers all important topics around data tables. + +## Dune's Table Structure + +Dune aggregates blockchain data into an accessilbe PostgreSQL database. The schema can be understood in the following way: + +1\) Low-level data (raw transaction data) provides detailed records of all activities on the blockchain + +2\) Decoded Data tables use the Application binary interface of the respective smart contract to turn the encoded data into decoded data. \ +You can signal to us that you need decoded data for a smart contract via this part of our [website](https://dune.xyz/contracts/new). Read more about contract submission in "[Adding new contracts](../../duneapp/adding-new-contracts.md)" + +3\) Abstractions are higher-level created tables that return aggregated/standarized data on sectors/topics. The scripts to generate these tables are available in this [github repository](https://github.com/duneanalytics/abstractions). + +\ +You can currently query data from **Ethereum, Polygon, Binance Smart Chain, Optimism** and **Gnosis Chain**. + +## How do I find the data I need? + +This section aims to guide you in the process of finding the right data tables to work on your project.\ +Different Use Cases of Dune require different data tables to pull data from, study these carefully and you'll recognize what significance each of the data table types has for your Queries and Dashboards. + +Most of the tables on Dune are populated by Dune and are just a translation of the blockchain data to SQL tables, but in the case of [abstractions ](abstractions.md)and dune\_user\_generated tables you can actually create your own tables that aggregate or modify the dataset to your need. + +{% content-ref url="raw-data/" %} +[raw-data](raw-data/) +{% endcontent-ref %} + +{% content-ref url="decoded-data.md" %} +[decoded-data.md](decoded-data.md) +{% endcontent-ref %} + +{% content-ref url="abstractions.md" %} +[abstractions.md](abstractions.md) +{% endcontent-ref %} + +{% content-ref url="prices.md" %} +[prices.md](prices.md) +{% endcontent-ref %} + +{% content-ref url="labels.md" %} +[labels.md](labels.md) +{% endcontent-ref %} diff --git a/data-tables/data-tables/abstractions.md b/data-tables/data-tables/abstractions.md new file mode 100644 index 0000000..c650359 --- /dev/null +++ b/data-tables/data-tables/abstractions.md @@ -0,0 +1,53 @@ +--- +description: >- + We construct customs tables which cover the entirety of a type of activity on + the blockchain and thereby enable you to effortlessly aggregate lots of data + with as little friction as possible. +--- + +# Abstractions + +## What are abstractions? + +Abstractions are custom tables that are maintained by Team Dune and our community. They allow you to gain access to more complex SQL operators like creating your own tables, looping through values or other operations that are more catered towards database administrators. This sometimes is necessary to aggregate the on-chain data or simplify the process of querying for data. + +This public [github repository](https://github.com/duneanalytics/abstractions) hosts the logic to construct the tables and views. + +\ +Which abstractions are there? +----------------------------- + +You can check for existing abstractions in our [public github repository](https://github.com/duneanalytics/abstractions). You can generally divide them into 2 distinct categories. + + + +### Sector Abstractions + +Sector Abstractions are tables like dex.trades, erc20.stablecoins, lending.borrow etc. + +These abstractions take in data from multiple contracts and projects, standardize the data across them and therefore make it very easy to query for this data and compare the metrics of different projects with each other. + +Most of the [sector](../../about/usecases/sector-dashboards.md) Dashboards depend on sector abstractions. This introduces an interesting dynamic in which projects can easily get their data into these dashboards by making a pull request to our public [github repo](https://github.com/duneanalytics/abstractions).\ +\ +Team Dune and the community are always improving on these sector abstractions, all new additions to existing ones are always welcome. + + + +### Project Abstractions + +Sometimes it can be useful for projects to assemble their data into one neat table that has all the data they need in one place. To do this, you can construct views or tables in our abstractions. + +The main advantage here over just constructing a view is that you are able to deal with bigger amounts of data in our abstractions since we can run them automatically in the background every few hours. + +### Lookup abstractions + +The most noticeable mentions for this abstraction is the `erc20.tokens` abstraction in which we map tokens to their decimals and symbols. There also is `erc20.stablecoins` or `compound.view_c_tokens.` + +## Contributing to abstractions + +Our abstractions are open to all teams and projects in general, but we do reserve the right to reject pull requests. + +If you do choose to contribute to abstractions please make sure your addition actually works and produces the intended results. Furthermore please give us a short summary about what you are trying to achieve and what your project does. + +If applicable please construct a view in which you show us that your addition produces the intended results. + diff --git a/data-tables/data-tables/community-data/README.md b/data-tables/data-tables/community-data/README.md new file mode 100644 index 0000000..1870c94 --- /dev/null +++ b/data-tables/data-tables/community-data/README.md @@ -0,0 +1,8 @@ +--- +description: >- + This section contains data that has been submitted and hosted on Dune by 3rd + party data providers +--- + +# Third Party Data + diff --git a/data-tables/data-tables/community-data/flashbots.md b/data-tables/data-tables/community-data/flashbots.md new file mode 100644 index 0000000..7a3d42f --- /dev/null +++ b/data-tables/data-tables/community-data/flashbots.md @@ -0,0 +1,126 @@ +--- +description: >- + Flashbots is a research and development organization formed with the goal of + making sure MEV incentives do not become opaque and undemocratic. +--- + +# Flashbots + +**Note:** mev-inspect-py, Flashbots’ open source engine for generating MEV data, is used to power dashboards such as mev-explore and Dune’s Flashbots integration. We’re always looking to improve, fix bugs, cover edge cases, and add protocol coverage to the best of our ability with the help of our community and contributors. We encourage researchers and developers to report and help correct any found bugs, or implement any new features! Feel free to consult the documentation and join the Flashbots discord for more information and updates on our data and mev-inspect + +**Docs:** [https://docs.flashbots.net/](https://docs.flashbots.net) + +**Discord:** [https://discord.gg/7hvTycdNcK](https://discord.gg/7hvTycdNcK) + +## **flashbots.mev\_summary** + +This table contains summary of all the classified transactions + +Query examples can be found here: [Miner Revenue from Liquidations and Arbitrages](https://dune.com/queries/625974/1167301) + +| **Column name** | **Type** | **Description** | +| ------------------------------------ | --------- | ------------------------------------------------------ | +| block\_timestamp | timestamp | Block timestamp | +| block\_number | bigint | Block number | +| base\_fee\_per\_gas | bigint | Base fee per gas | +| coinbase\_transfer | bigint | Direct transfer to miner’s address | +| error | string | Error if exists | +| gas\_price | bigint | Price of the gas | +| gas\_price\_with\_coinbase\_transfer | bigint | Amount of gas spent + direct transfer to miner address | +| gas\_used | bigint | Amount of gas used | +| gross\_profit\_usd | double | Total profit from the transaction in usd | +| miner\_address | string | Address of the miner | +| miner\_payment\_usd | double | Payment received by the miner in usd | +| protocol | string | Main interacted protocol | +| protocols | string | List of protocols involved in the transaction | +| transaction\_hash | string | Hash of the transaction | +| type | string | Type of the MEV (e.g. arbitrage) | +| timestamp | timestamp | Timestamp of the latest update of the file | + +## **flashbots.arbitrages** + +This table contains records with additional information about each arbitrage trade. + +Query examples can be found here: [Total Arb Protocols](https://dune.com/queries/626076/1167481) + +| **Column name** | **Type** | **Description** | +| ---------------------- | --------- | --------------------------------------------- | +| block\_number | bigint | Block number | +| account\_address | string | Address of the searcher | +| created\_at | string | Time of the record creation | +| end\_amount | bigint | Available amount after the arbitrage | +| error | string | Available amount after the arbitrage | +| id | string | Internal id of the arbitrage | +| profit\_amount | bigint | Profit amount after the arbitrage | +| profit\_token\_address | string | Address of the profit asset | +| protocols | string | List of protocols involved in the transaction | +| start\_amount | bigint | Available amount before the arbitrage | +| transaction\_hash | string | Hash of the transaction | +| timestamp | timestamp | Timestamp of the latest update of the file | + +## **flashbots.liquidations** + +Liquidation is another MEV strategy. This table contains details related to executed liquidations. + +Query examples can be found here: [Liquidations by Protocol](https://dune.com/queries/625715/1166880) + +| **Column name** | **Type** | **Description** | +| ------------------------ | --------- | ------------------------------------------------------------------------------------------------------------------- | +| created\_at | string | Time of the records creation | +| transaction\_hash | string | Transaction hash | +| trace\_address | string | Trace pattern related to the position of the transaction in the chain of all transactions related to the MEV trade. | +| debt\_token\_address | string | Underlying token address of the debt to pay | +| received\_amount | bigint | Amount received from the liquidation | +| protocol | string | Protocol name | +| liquidated\_user | string | Address of the liquidated user | +| liquidator\_user | string | Address of the liquidator user | +| received\_token\_address | string | Address of the received asset | +| block\_number | bigint | Block number | +| debt\_purchase\_amount | bigint | Amount of purchased debt | +| timestamp | timestamp | Timestamp of the latest update of the file | + +## **flashbots.sandwiched\_swaps** + +The sandwiched\_swaps table contains additional data about one or more swaps that were sandwiched with a corresponding sandwich in the database. + +Query examples can be found here: + +| **Column name** | **Type** | **Description** | +| ----------------- | --------- | ----------------------------------------------------------------------------------------------------------- | +| created\_at | string | Time of the records creation | +| block\_number | bigint | Block number | +| sandwich\_id | string | Internal id of the sandwiched swap | +| trace\_address | string | Trace pattern related to the position of the swap in the chain of all swaps related to the arbitrage trade. | +| transaction\_hash | string | Transaction hash | +| timestamp | timestamp | Timestamp of the latest update of the file | + +## **flashbots.sandwiches** + +This table contains detailed information about executed sandwiches + +Query examples can be found here: + +| **Column name** | **Type** | **Description** | +| --------------------------------- | --------- | --------------------------------------------------------------- | +| created\_at | datetime | Time of the records creation | +| block\_number | bigint | Block number | +| backrun\_swap\_trace\_address | string | address of the swap in the backrun transaction | +| backrun\_swap\_transaction\_hash | string | transaction\_hash of backrun transaction of specified sandwich | +| frontrun\_swap\_trace\_address | string | address of the swap in the frontrun transaction | +| frontrun\_swap\_transaction\_hash | string | transaction\_hash of frontrun transaction of specified sandwich | +| id | string | Internal id of the sandwich | +| profit\_amount | bigint | Profit amount after the arbitrage | +| profit\_token\_address | string | Address of the profit asset | +| sandwicher\_address | string | Address of the sandwicher | +| timestamp | timestamp | Timestamp of the latest update of the file | + +## **flashbots.blocks** + +This table contains block numbers and corresponding block\_timestamps + +Query examples can be found here: + +| **Column name** | **Type** | **Description** | +| ---------------- | --------- | --------------- | +| block\_number | bigint | Block number | +| block\_timestamp | timestamp | Block timestamp | diff --git a/data-tables/data-tables/decoded-data.md b/data-tables/data-tables/decoded-data.md new file mode 100644 index 0000000..8c64ca4 --- /dev/null +++ b/data-tables/data-tables/decoded-data.md @@ -0,0 +1,83 @@ +--- +description: >- + We decode the data emitted by smart contracts and store them in easy-to-use + tables. +--- + +# Decoded Data + +## Decoded smart contract data + +Instead of working with the traces, logs, and traces, Dune decodes smart contract activity into nice human-readable tables. + +We create tables for each event and function defined in the smart contract ABI. Subsequently, every event or function call on that contract is decoded and inserted as a row into these tables. + +The tables are named accordingly + +**events:** `projectname."contractName_evt_eventName"` + +**function calls:** `projectname."contractName_call_eventName"` + +As an example, decoded data for the `swap`-event of the uniswap V2 exchange contract is found in the table [uniswap\_v2."pair\_swap"](https://dune.xyz/queries/38968). + +Using the event tables is usually sufficient, but in some cases you will want to use the `call` tables. For instance Maker DAO which don’t give you too many events you can use tables like [maker."SaiTub\_call\_draw](https://dune.xyz/queries/38974)". + +## What contracts have decoded data? + +You can check if contracts are already decoded by querying "blockchain".contracts through our database or [this dashboard](https://dune.xyz/0xBoxer/Is-my-Contract-decoded-yet). + +If the contract is not in our database yet, you can submit it for [Decoding](../../duneapp/adding-new-contracts.md) here: [dune.xyz/decode](http://dune.xyz/decode) + +We usually take about 24-48 hours to decode smart contracts. + +Check out [this guide](../../duneapp/adding-new-contracts.md) to learn more about the Decoding process. + +## How to understand decoded data? + +Decoded data sometimes is a bit tricky to work with since it requires you to understand what the events/calls mean in the context of the smart contract. Additionally you need to understand what kind of data the smart contract emits and understand the intricacies of the different smart contracts of the project interacting with each other. Often times the data you are looking for is scattered across multiple smart contracts and tables in Dune. + +If you are not able to make sense of the data by just searching at the tables, it usually helps to look at single tx's using the transaction hash and etherscan. + +If that also doesn't lead to satisfactory results, scouring the relevant docs and github of the project can lead you to the desired answers. Furthermore, talking to the developers and core community of a project can also get you to a good understanding of the contract. + +Some good showcasing of how to deal with decoded data can be found all throughout Dune, but especially our [abstraction repository](https://github.com/duneanalytics/abstractions) is full of great examples. + +**In Summary**: + +Dealing with decoded data allows you deep access to information stored on the blockchain and is very information rich, but understanding that data sometimes takes a bit of effort on your side since you are interacting with the data of the contract in a direct way. + +## Scalable decoding across contracts + +Many dApps have numerous smart contracts that are deployed with the same bytecode. This can be: yield aggregator pools,distinctive options, liquidity pools etc. + +We can automatically pull these similar contracts into the same tables and thereby make it way easier for you to work with that data. Instead of having to query for all distinctive smart contracts you can then just query one table which will have the `contract_address` of that specific smart contract as an identifier. + +To be able to use this function you have to submit the contract as one of the two bottom options while submitting it to decoding. + +![](<../../.gitbook/assets/image (23).png>) + +As a result, `SELECT`-ing from a single table might yield data from multiple contracts. In decoded tables, the column `contract_address` tells you which smart contract the event or call is on. If you want to look at only a single contract you can filter by its address. + +For example: + +```sql +SELECT DISTINCT contract_address FROM uniswap_v2."Pair_evt_swap"; +``` + +will give you all the unique Uniswap Pairs with a Token Purchase event. + +[Query in action](https://dune.xyz/queries/39006) + +## **Queries to explore decoded Contracts** + +**See all projects we have decoded data for** + +```sql +SELECT DISTINCT namespace FROM ethereum."contracts"; +``` + +If you are working with a an event or call table directly you can see if there are several instances of that contract with this query. + +```sql +SELECT DISTINCT contract_address FROM projectname."contractName_evt_eventName"; +``` diff --git a/data-tables/data-tables/erc-20-balances.md b/data-tables/data-tables/erc-20-balances.md new file mode 100644 index 0000000..2247bcf --- /dev/null +++ b/data-tables/data-tables/erc-20-balances.md @@ -0,0 +1,120 @@ +--- +description: >- + ERC20 token analysis is a fundamental part of any analysis of DeFi products, + these tables and views will provide you with all the necessary information. +--- + +# ERC-20 balances + +## Easily track wallets and token balances over time. + +The following tables allow for easy tracking or wallet-balances, token allocations or supply of a token over time or in a snapshot format. + +On a raw data level it's pretty hard to work with erc20 tokens since you need to sum all transfers for all addresses over time. This unnecessarily bloats queries and quickly leads to human errors. To prevent that from happening we have constructed several views and tables that will help you query for erc20 data with ease. + +These tables can be used for all kinds of interesting analysis, but you still need to watch out for a few things while working with them: + +* the **mint/burn address** is not standardized, so you need to find out those addresses and manually apply a fix in your queries. In most cases it will be `x0000000000000000000000000000000000000000`for minting and burning, but always make sure that that is indeed the case. In the example given that's exactly not the case. + +**example:** + +```sql +Select + wallet_address, + amount, + day, + token_symbol +from erc20."view_token_balances_daily" +where token_address = '\x429881672B9AE42b8EbA0E26cD9C73711b891Ca5' +and wallet_address != '\x0000000000000000000000000000000000000000' --mint address +and wallet_address != '\x000000000000000000000000000000000000dead' --burn address +``` + +* working with these tables quickly leads to a lot of individual data points that our visualization engine is not always able to handle perfectly. Instead of trying to display every unique holder it makes sense to group them by certain criteria and display the dataset that way. This is unique for every token, you might need to experiment a bit to see what works in your queries. + +```sql +Select + + CASE WHEN wallet_address = '\xbBCf169eE191A1Ba7371F30A1C344bFC498b29Cf' then 'dill' + WHEN wallet_address = '\xdc98556Ce24f007A5eF6dC1CE96322d65832A819' then 'uniswap' + WHEN wallet_address = '\xC52139a20A57c9002e9F5188901EF0ffC63c7205' then 'smart_treasury' + WHEN wallet_address = '\x40ec5b33f54e0e8a33a975908c5ba1c14e5bbbdf' then 'polygon' + WHEN wallet_address = '\x6cc5f688a315f3dc28a7781717a9a798a59fda7b' then 'OKEX' + WHEN amount between 0 and 10 then 'Plankton(0-10)' + WHEN amount between 10 and 100 then 'shrimp(10-100)' + WHEN amount between 100 and 1000 then 'fish(100-1,000)' + WHEN amount between 1000 and 10000 then 'dolphin(1,000-10,000)' + WHEN amount > 10000 then 'whale (>10000)' + --note that the order of case statements matters here + end as classification, + +sum(amount) as amount, +token_symbol +from erc20."view_token_balances_latest" +where token_address = '\x429881672B9AE42b8EbA0E26cD9C73711b891Ca5' +and wallet_address != '\x0000000000000000000000000000000000000000' +and wallet_address != '\x000000000000000000000000000000000000dead' +and amount > 0.1 --filter out dust amounts, adjust this for different tokens based on economic value +group by 1,3 +``` + +## Dashboard example: + +This dashboard contains the most important use cases related to a single erc20 token that is used as gov token. + +[https://dune.xyz/0xBoxer/pickle-finance\_1](https://dune.xyz/0xBoxer/pickle-finance\_1) + +## erc20.view\_token\_balances\_latest + +This view depends on the erc20.token\_balances table and gives you the information of the latest distribution of that token. + +| column name | data type | description | +| ----------------------------- | ----------- | ------------------------------------------------------------------------------------------ | +| amount | numeric | the correct display format for that token | +| amount\_raw | numeric | the raw amount of that token (need to divide by decimals!) | +| amount\_usd | float8 | the current price (if we have data on the price) | +| last\_transfer\_\_\_timestamp | timestamptz | the date on which the balance of this token last changed in this particular wallet address | +| token\_address | bytea | the address of the token | +| token\_symbol | text | the symbol of the token | +| wallet\_address | bytea | the address of the wallet holding this token | + +## erc20.view\_token\_balances\_hourly + +This table will provide information about all token balances on an hourly basis. It also already includes decimals and prices in most cases, so they are pretty much ready to go out of the box. + +| column name | data type | description | +| --------------- | ----------- | ---------------------------------------------------------- | +| amount | numeric | the correct display format for that token | +| amount\_raw | numeric | the raw amount of that token (need to divide by decimals!) | +| amount\_usd | float8 | the current price (if we have data on the price) | +| hour | timestamptz | the time in the resolution of hours | +| token\_address | bytea | the address of the token | +| token\_symbol | text | the symbol of the token | +| wallet\_address | bytea | the address of the wallet holding this token | + +## erc20.view\_token\_balances\_daily + +**This table will perform much better than `erc20.view_token_balances_hourly` since it's only querying for data on a daily basis**. If you want to make high level analysis, this is your way to go. + +| column name | data type | description | +| --------------- | ----------- | ---------------------------------------------------------- | +| amount | numeric | the correct display format for that token | +| amount\_raw | numeric | the raw amount of that token (need to divide by decimals!) | +| amount\_usd | float8 | the current price (if we have data on the price) | +| day | timestamptz | the time in the resolution of days | +| token\_address | bytea | the address of the token | +| token\_symbol | text | the symbol of the token | +| wallet\_address | bytea | the address of the wallet holding this token | + +## erc20.token\_balances + +This table contains the hourly balance of all erc20 tokens over the entire existence of these tokens. You can use this table as a fallback option might the views we have provided above not be sufficient for the usecase you are trying to establish. + +| column name | data type | description | +| --------------- | ----------- | ---------------------------------------------------------- | +| amount | numeric | the correct display format for that token | +| amount\_raw | numeric | the raw amount of that token (need to divide by decimals!) | +| timestamp | timestamptz | the time in the resolution of hours | +| token\_address | bytea | the address of the token | +| token\_symbol | text | the symbol of the token | +| wallet\_address | bytea | the address of the wallet holding this token | diff --git a/data-tables/data-tables/labels.md b/data-tables/data-tables/labels.md new file mode 100644 index 0000000..6539c7a --- /dev/null +++ b/data-tables/data-tables/labels.md @@ -0,0 +1,194 @@ +# Labels + +Have you ever made a query on Dune where you get a list of addresses, only to stop and wonder what’s behind these beautiful, random hexadecimal encoded strings? So have we. + +**Address labels** is a feature on Dune where you as a user can _add_, _update_ and _query_ labels for any address. + +## What is a label? + +A label is **a piece of metadata about an address**, a tag or metadata if you will. It comes in the form of a key-value pair. The key is the label _type_, and the value the label _name_. + +Browse addresses and and labels at the [**labels page**](https://dune.xyz/labels). + +## What labels looks like + +Check out [this dashboard](https://dune.xyz/hagaetc/labels) for examples on what can be created with labels. + +**Address label examples** + +The address [0xD551234Ae421e3BCBA99A0Da6d736074f22192FF](https://dune.xyz/ethereum/address/0xD551234Ae421e3BCBA99A0Da6d736074f22192FF) can be labeled like this: + +| **type** | **name** | +| ----------- | -------- | +| owner | binance | +| wallet type | exchange | + +The address is controlled by the exchange Binance. + +The address [0xe65040f61701940b62e18da7a53126a58525588b](https://dune.xyz/ethereum/address/0xe65040f61701940b62e18da7a53126a58525588b) can be labeled like this: + +| **type** | **name** | +| ---------- | ------------ | +| dapp usage | uniswap user | +| activity | dex trader | + +The address in the past interacted with Uniswap. + +You are free to come up with both new types and label names, as labels on Dune are open ended and **crowd sourced.** + +## Adding labels + +There are two ways to add labels: + +**1. Directly to an address via our labels page** + +Good for specific labels like “this is a binance wallet”. + +**2. Via a Dune query** + +Use Dune queries to label addresses. A very powerful and scalable way to add labels like “all these addresses used Uniswap”, and much much more. + +Please see our [Github](https://github.com/duneanalytics/abstractions/tree/master/labels) for examples of labels created with queries and PR in your own! + +Examples of what you can do: + +* Label all addresses that used a certain dapp +* Label all addresses that hold a certain amount of a token +* Label all addresses that use a dapp more than X times per month +* Label all addresses that sent money to Binance + +You could also do more novel and involved things around user patterns like who did arbitrage trades or profited from flash loans and so much more. + +Note that there might be a few minutes delay from adding the label on [dune.xyz](http://dune.xyz/) until you can query it in SQL. + +## The labels table + +Labels are stored in the new `labels.labels` table which has the following schema: + +| column name | data type | description | +| ----------- | ----------- | -------------------------------------------------------- | +| id | int | incrementing integer | +| address | bytea | the address of a contract or wallet this label describes | +| name | text | label name | +| type | text | label type | +| author | text | the username of the user who created this label | +| source | text | the source of this label, autopopulated by dune | +| updated\_at | timestamptz | the last time this label was changed | + +## Using labels + +Note that this table holds multiple rows per address, and therefore joins against it can be tricky to get right. For that reason we’ve made the convenient function: + +`labels.get(address bytea, type text default null) RETURNS text[]` + +which we anticipate will be the primary way to use labels. See examples below. + +Typically if you do a query that returns `address` you can use `labels.get(address)` to get all labels for that address independent of label type. If you want to see labels of the type `owner` you can do `labels.get(address, 'owner')`. You can also pass this function several label types you want included like: `labels.get(address, 'owner', 'project')`. + +We’ve also added the function `labels.url(address bytea)`. Pass that function an address from your query and your results table will contain a clickable link to for instance: + +[https://dune.xyz/ethereum/address/0xD551234Ae421e3BCBA99A0Da6d736074f22192FF](https://dune.xyz/ethereum/address/0xD551234Ae421e3BCBA99A0Da6d736074f22192FF) + +### Usecase: I want to display labels for a list of addresses + +> We encourage you to run these queries in Dune while you read this + +Say you’re looking at the top 10 traders of DAI across all dexes last 24 hours: + +```sql +SELECT trader_a, SUM(token_a_amount) +FROM dex.trades +WHERE token_a_symbol = 'DAI' +AND block_time > now() - interval '24 hours' +GROUP BY 1 +ORDER BY 3 DESC +LIMIT 10; +``` + +If you want to have labels for these addresses simply alter the `trader_a` column to `labels.get(trader_a)`. + +> Note: In the examples below `---` represents lines removed, and `+++` lines added. + +```sql +SELECT trader_a, labels.get(trader_a) as label, SUM(token_a_amount) + FROM dex.trades + WHERE token_a_symbol = 'DAI' + AND block_time > now() - interval '24 hours' + and not labels.get(trader_a) isnull + GROUP BY 1 + ORDER BY 2 DESC + LIMIT 100; +``` + +Now you’ve replaced the addresses with lists of all labels for trader\_a. Sometimes you’re only interested in a subset of labels: `labels.get` accepts an optional list of type names which filter the type of labels you get. Say you’re only interested in ‘activity’ labels: + +```sql + SELECT trader_a, labels.get(trader_a, 'activity') as label, SUM(token_a_amount) + FROM dex.trades + WHERE token_a_symbol = 'DAI' + AND block_time > now() - interval '24 hours' + and not labels.get(trader_a) isnull + GROUP BY 1 + ORDER BY 2 DESC + LIMIT 100; +``` + +Of course you can also show the address, and filter for multiple label types + +```sql + SELECT trader_a, labels.get(trader_a, 'activity', 'project', 'contract_name') as label, SUM(token_a_amount) + FROM dex.trades + WHERE token_a_symbol = 'DAI' + AND block_time > now() - interval '24 hours' + and not labels.get(trader_a) isnull + GROUP BY 1 + ORDER BY 2 DESC + LIMIT 100; +``` + +You can also use `labels.url` to make the addresses clickable: + +```sql +SELECT labels.url(trader_a), labels.get(trader_a, 'activity') as labels, SUM(token_a_amount) + FROM dex.trades + WHERE token_a_symbol = 'DAI' + AND block_time > now() - interval '24 hours' +GROUP BY 1, 2 + ORDER BY 3 DESC + LIMIT 10; +``` + +This way people who look at your dashboard can easily contribute even better labels to it! + +### Usecase: I want to filter my query by labels that exist. + +In this usecase you wouldn’t want to use `labels.get`, because it can be slow to operate with. Instead you’ll use the fantastic `EXISTS` function in SQL. + +As an example: you’re querying _Uniswap_, but are interested in the behavior of users who have traded previously on _1inch_. Here’s how you’d go about that: + +```sql +SELECT "to" +FROM uniswap_v2."Pair_evt_Swap" +WHERE EXISTS( + SELECT * + FROM labels.labels + WHERE address="to" + AND type='dapp usage' + AND name='1inch user' + ) +LIMIT 10; +``` + +The above query will give you 10 address that has swapped on Uniswap and traded on 1inch. + +Of course, you can use the two patterns in conjunction! If you _are_ interested for labels on those addresses, go ahead and use `labels.get` in addition to the `WHERE EXISTS` pattern: + +```sql +--- SELECT "to" ++++ SELECT "to", labels.get("to") + FROM uniswap_v2."Pair_evt_Swap" + WHERE EXISTS(SELECT * FROM labels.labels WHERE address="to" AND type='dapp usage' AND name='1inch user') + LIMIT 10; +``` + +There you have it: you see addresses that traded on both Uniswap and 1inch _and_ all associated address labels. diff --git a/data-tables/data-tables/nft.trading.md b/data-tables/data-tables/nft.trading.md new file mode 100644 index 0000000..21e0d06 --- /dev/null +++ b/data-tables/data-tables/nft.trading.md @@ -0,0 +1,152 @@ +--- +description: >- + nft.trades makes NFT trading data available to everyone on Dune Analytics. + NFT.trades aggregates data across multiple NFT platforms into one simple + table. +--- + +# nft.trades + +## **An easy way of querying for NFT data** + +`nft.trades` is an effort to make NFT trading data easily available to everyone on Dune Analytics. This table aggregates and standardizes the data between different data platforms and provides auxiliary information and metadata all in one table. + +The culmination of this is a dataset which makes it extremely easy to query for any NFT related trading data across all indexed platforms. + +So far we have indexed the data of the following platforms: + +* OpenSea +* Rarible +* SuperRare +* CryptoPunks (They get traded in their own contracts) +* Foundation +* LooksRare + +All of this data is easily accessible with very simple queries like these: + +* [**all trades for a given NFT**](https://dune.xyz/queries/146090) + +![](<../../.gitbook/assets/image (31).png>) + +```sql +select * from nft.trades + +where nft_contract_address = '\xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb' --this is the cryptopunks address +``` + +* [**trades in the last 24 hour on a given platform**](https://dune.xyz/queries/146152) + +```sql +select date_trunc('day', block_time), usd_amount, nft_contract_address, token_id from nft.trades + +where platform = 'OpenSea' --only shows trades on given Platform + +and block_time > now() - interval '24hours' +``` + +* [**platform volumes in the last year**](https://dune.xyz/queries/146160) + +```sql +select sum(usd_amount), date_trunc('day', block_time), platform from nft.trades + +where block_time > now() - interval '365 days' + +group by 2,3 +``` + +### + +### Basic Understanding + +#### Single Item Trade + +A trade occurs between a `buyer`and a `seller`.\ +They exchange an item which is uniquely identified by the combination of `nft_contract_address` and `token_id`. The Buyer will pay the Seller a given `original_amount`of tokens in any given `original_currency`. To make it easier, we have calculated the `usd_amount` that this was worth at the time of the trade for you. Most trades will be done in ETH or WETH, but especially non OpenSea trades often contain other currencies.\ +The trade is committed on any of the indexed `platforms`and will be facilitated through a smart contract of those platform's `exchange_contract_address`. Each trade will have metadata like `block_time`, `tx_hash`_,_ `block_number`, `platform version`, `evt_index` etc.\ +\ +Additionally, we also provide metadata about the traded NFT. `nft_project_name` and `erc_standard` will help you in analysing your dataset more easily. `nft_project_name` data gets pulled from the `nft.tokens` [table](https://github.com/duneanalytics/abstractions/blob/master/ethereum/nft/tokens.sql), if your NFT is missing in that table, you are welcome to make a PR to add it. + +**Bundle Trade** + +There can also be trades in which a single trade transaction contains multiple Items. Each of these Items is uniquely identified through a combination of `nft_contract_address` and `token_id`. Unfortunately, in these trades there is not a clear way to determine a corresponding `usd_amount` for each of the items. A possible workaround is to divide the number of items by the payment made for the bundle, but this logic very quickly falls apart when Items that are not one in kind/value get sold in a bundle. We recommend removing bundle transfers from the dataset that you are working with since it can heavily influence the results in either direction. Note that `token_id` and '`erc_standard` will be null if tokens with different tokens IDs or erc type are transfered within the same transaction. + +**Aggregator Trade** + +There can also be trades in which a single trade transaction contains multiple items, especially when using NFT aggregator platforms. Our approach is to unravel aggregator trades so that each row correspond to a unique item that was traded, with its associated ID, price, collection, etc. Importantly, the `trade_type` will be indicated as `Aggregator Trade`, and platform names and address can be found in the `nft.aggregators` [table](https://github.com/duneanalytics/abstractions/blob/master/ethereum/nft/aggregators.sql). If your aggregator platform is missing in that table, you are welcome to make a PR to add it. + +**Platform and Royalty Fees** + +In the most recent version of `nft.trades`, information about the amount and percent of royalty fees in the original amount and in USD is available when this information was able to be retrieved. Royalty fees are going to the creator, and Platform fees are collected by the NFT platform. Note that royalty fees cannot always be retrieved, and are set to null by default. + +### **Sample dashboards** + +**Dashboard that utilize parameters** + +[**https://dune.xyz/0xBoxer/NFT**](https://dune.xyz/0xBoxer/NFT)\*\*\*\* + +[**https://dune.xyz/rantum/NFT-Sales-Overview-by-Project**](https://dune.xyz/rantum/NFT-Sales-Overview-by-Project) + +**Dashboards that look across the entire Ecosystem** + +[**https://dune.xyz/rantum/NFT-Collection-Dashboard**](https://dune.xyz/rantum/NFT-Collection-Dashboard) + +[**https://dune.xyz/masquot/NFT-Sales-Trends**](https://dune.xyz/masquot/NFT-Sales-Trends) + +## **Ser my platform is not indexed** + +The SQL code that processes the data for every market place is open source and available in our [github repository](https://github.com/duneanalytics/abstractions/tree/master/ethereum/nft/trades). Everyone can review the code, make pull requests and submit code to add more marketplaces. + +Also read the section "[abstractions](abstractions.md)" about this topic. + +**Table contents** + +| column\_name | data\_type | description | +| ---------------------------- | ------------------------ | --------------------------------------------------------------------------------- | +| block\_time | timestamp with time zone | When was this trade exectuted | +| nft\_project\_name | text | NFT project name (e.g. "the dudes") | +| nft\_token\_id | text | The token\_id that got trades (e.g. 235) | +| erc\_standard | text | The Token Standard of the traded token | +| platform | text | Which Platform was this trade executed on? | +| platform\_version | text | Which version of this platform was utilized? | +| trade\_type | text | "Single Item Sale" or "Bundle Sale"? | +| number\_of\_items | integer | How many NFTs were traded in this trade? | +| category | text | Was this an auction or a direct sale? | +| evt\_type | text | currently not in use, default 'Trade' | +| aggregator | text | Was this trade made using an aggregator (Yes : Name of aggregator, No : Null) | +| usd\_amount | numeric | USD value of the trade at time of execution | +| seller | bytea | Seller of NFTs | +| buyer | bytea | Buyer of NFTs | +| original\_amount | numeric | The amount in the right format | +| original\_amount\_raw | numeric | raw amount of the currency | +| eth\_amount | numeric | ETH value of the trade at time of execution | +| royalty\_fees\_percent | numeric | Royalty fees going to the creator (in %) | +| original\_royalty\_fees | numeric | Royalty fees in the currency used for this trade | +| usd\_royalty\_fees | numeric | USD value of royalty fees at time of execution | +| platform\_fees\_percent | numeric | Platform fees (in %) | +| original\_platform\_fees | numeric | Platform fees in the currency used for this trade | +| usd\_platform\_fees | numeric | USD value of platform fees at time of execution | +| original\_currency | text | The Currency used for this trade | +| original\_currency\_contract | bytea | The erc20 address of the currency used in this trade (does not work with raw ETH) | +| currency\_contract | bytea | the corrected currency contract | +| nft\_contract\_address | bytea | The contract address of the NFT traded | +| exchange\_contract\_address | bytea | The platform contract that facilitated this trade | +| tx\_hash | bytea | the hash of this transaction | +| block\_number | integer | the block\_number that this trade was done in | +| tx\_from | bytea | Initiated this transaction | +| tx\_to | bytea | Received this transaction | +| trace\_address | ARRAY | n/a | +| evt\_index | integer | event index | +| trade\_id | integer | n/a | + +## **Credits** + +Amazing pioneer work on NFTs by the following Dune users: + +* [https://dune.xyz/rchen8](https://dune.xyz/rchen8) +* [https://dune.xyz/keeganead](https://dune.xyz/keeganead) +* [https://dune.xyz/eliasimos](https://dune.xyz/eliasimos) + +The following power users helped along the way in various ways: + +* [https://dune.xyz/0xBoxer](https://dune.xyz/0xBoxer) +* [https://dune.xyz/danner\_eth](https://dune.xyz/danner\_eth) diff --git a/data-tables/data-tables/prices.md b/data-tables/data-tables/prices.md new file mode 100644 index 0000000..9bb0300 --- /dev/null +++ b/data-tables/data-tables/prices.md @@ -0,0 +1,51 @@ +# Prices + +#### Centralized exchanges trading data + +Token volume is great, but more often than not you want to know the USD value of smart contract activity.\ +You can easily get and combine that information with on-chain data using the data we pull from the coinpaprika API. + +The Price is the volume-weighted price based on real-time market data, translated to USD. + +**prices.usd** + +This table support a range of erc20.tokens. \ +If the token you desire is not listed in here, please make a pull request to our [github repository](https://github.com/duneanalytics/abstractions/tree/master/prices) **** or use the decentralized price feed **dex.view\_token\_prices.** + +|
column name
| description | +| ------------------------- | --------------------------------------------- | +| contract\_address | the contract address of the erc20 token | +| symbol | the identifier of the asset (ticker, cashtag) | +| price | the price of the asset in any given minute | +| minute | the resolution for this table is by minute | + +Note that `WETH` can be used for ETH price. + +**prices.layer\_1usd** + +This table also supports layer 1 assets on other blockchains. + +| column name | description | +| ----------------- | --------------------------------------------- | +| contract\_address | the contract address of the erc20 token | +| symbol | the identifier of the asset (ticker, cashtag) | +| price | the price of the asset in any given minute | +| minute | the resolution for this table is by minute | + +**** + +**dex.view\_token\_prices** + +We created a decentralized price feed that calculates prices based on decentralized exchange trading data. **This table covers much more assets than prices.usd.** This table is very resource intensive and can therefore only be updated every few hours, please keep that in mind when utilizing it. + +This table currently only exists for Ethereum data. + +| column name | description | +| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| contract\_address | the contract address of the erc20 token | +| sample\_size | the number of trades that occurred for this asset on all decentralized exchanges (If the number is very small you might want to exclude the data, it can lead to inaccuracies). | +| median\_price | the median price of the asset in any given hour | +| hour | the resolution for this table is hourly | + + + diff --git a/data-tables/data-tables/raw-data/README.md b/data-tables/data-tables/raw-data/README.md new file mode 100644 index 0000000..87dc82b --- /dev/null +++ b/data-tables/data-tables/raw-data/README.md @@ -0,0 +1,17 @@ +# Raw Data + +{% content-ref url="ethereum-data.md" %} +[ethereum-data.md](ethereum-data.md) +{% endcontent-ref %} + +{% content-ref url="xdai-data.md" %} +[xdai-data.md](xdai-data.md) +{% endcontent-ref %} + +{% content-ref url="../solana-data/" %} +[solana-data](../solana-data/) +{% endcontent-ref %} + + + +### diff --git a/data-tables/data-tables/raw-data/ethereum-data.md b/data-tables/data-tables/raw-data/ethereum-data.md new file mode 100644 index 0000000..4d9d06e --- /dev/null +++ b/data-tables/data-tables/raw-data/ethereum-data.md @@ -0,0 +1,110 @@ +--- +description: >- + Our Database automatically picks up different aspects of every transaction on + the Ethereum Blockchain and parses them into different tables depending on + which aspect that table is focused on. +--- + +# Ethereum data + +## Ethereum.Blocks + +| **Column Name** | **datatype** | **Description** | +| ------------------- | ------------ | ---------------------------------------------------------------------------------------- | +| time | timestamptz | the time when the block was mined. | +| number | numeric | the length of the blockchain in blocks | +| hash | bytea | a unique identifier for that block | +| parent hash | bytea | the unique identifier for the prior block | +| gas\_limit | numeric | the gas limit of the current block | +| gas\_used | numeric | the gas used in this block | +| miner | bytea | the address of the miner | +| difficulty | numeric | the effort required to mine the block | +| total\_difficulty | numeric | total difficulty of the chain until this block | +| nonce | bytea | the block nonce is used to demonstrate the proof of work during mining | +| size | numeric | this block's size in bytes (limited by gas limit) | +| base\_fee\_per\_gas | numeric | this block's base fee (introduced by [EIP1559](https://eips.ethereum.org/EIPS/eip-1559)) | + +## Ethereum.Logs + +This Table stores all logs that get generated by smart contracts. It is sometimes useful for querying contracts that are not yet decoded or are resistant to being decoded(we need an abi key for that). + +Logs are an elegant way to store tiny amounts of data on the Ethereum blockchain for a small price. Specifically, event logs are useful to let other people know something has happened without them having to query contracts individually. + +For more on this topic read [this article](https://medium.com/mycrypto/understanding-event-logs-on-the-ethereum-blockchain-f4ae7ba50378). + +| **Column Name** | **datatype** | **Description** | +| ----------------- | ------------ | ------------------------------------------------ | +| block\_hash | bytea | a unique identifier for that block | +| block\_number | int8 | the length of the blockchain in blocks | +| block\_time | timestamptz | the time when the block was mined | +| contract\_address | bytea | The address of the contract that emitted the log | +| data | bytea | event data | +| topic1 | bytea | indexed _keys_ of the event | +| topic2 | bytea | indexed _keys_ of the event | +| topic3 | bytea | indexed _keys_ of the event | +| topic4 | bytea | indexed _keys_ of the event | +| index | numeric | the transactions index position in the block | +| tx\_hash | bytea | the transaction hash of the event | +| tx\_index | numeric | the index of the transaction | + +[**Take a look for yourself**](https://dune.xyz/queries/38957) + +## Ethereum.Transactions + +| **Column Name** | **datatype** | **Description** | +| ---------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| block\_time | timestamptz | the time when the block was mined | +| nonce | numeric | the transaction nonce, unique to that wallet | +| index | numeric | the transactions index position in the block | +| success | boolean | a true/false value that shows if the transaction suceeded | +| from | bytea | address of the sender | +| to | bytea | address of the receiver. Null when its a contract creation transaction | +| value | numeric | the amount of ether sent in this transaction in wei. note that erc20 tokens do not show up here. | +| block\_number | int8 | the length of the blockchain in blocks | +| block\_hash | bytea | a unique identifier for that block | +| gas\_limit | numeric | the gas limit in wei | +| gas\_price | numeric | the gas price in wei | +| gas\_used | numeric | the gas consumed by the transaction in wei | +| data | bytea | event data | +| hash | bytea | the hash of the transaction | +| type | text | the type of the transaction: `Legacy, AccessList,` or`DynamicFee` | +| access\_list | jsonb | a list of addresses and storage keys the transactions intends to access. See [EIP2930](https://eips.ethereum.org/EIPS/eip-2930). Applicable if the transaction is of type `AccessList` or `DynamicFee` | +| max\_fee\_per\_gas | numeric | the maximum fee per gas the transaction sender is willing to pay total (introduced by [EIP1559](https://eips.ethereum.org/EIPS/eip-1559)) | +| max\_priority\_fee\_per\_gas | numeric | maximum fee per gas the transaction sender is willing to give to miners to incentivize them to include their transaction (introduced by [EIP1559](https://eips.ethereum.org/EIPS/eip-1559)) | +| priority\_fee\_per\_gas | numeric | the priority fee paid out to the miner for this transaction (introduced by [EIP1559](https://eips.ethereum.org/EIPS/eip-1559)) | + +\*\*\*\*[**Take a look for yourself**](https://dune.xyz/queries/38964)\*\*\*\* + +## Ethereum.Traces + +Transactions can trigger smaller atomic actions that modify the internal state of the Ethereum Virtual Machine. Information about the execution of these actions is logged and can be found stored as an EVM execution trace, or just a _trace_. + +Read more [here](https://medium.com/chainalysis/ethereum-traces-not-transactions-3f0533d26aa). + +| **Column Name** | **datatype** | **Description** | +| --------------- | ------------ | ------------------------------------------------------------------------------------------------- | +| block\_time | timestamptz | the time when the block was mined | +| tx\_success | boolean | a true/false value that shows if the transaction succeeded | +| success | boolean | a true/false value that shows if the trace action succeeded | +| block\_hash | bytea | a unique identifier for that block | +| block\_number | int8 | the length of the blockchain in blocks | +| tx\_hash | bytea | the transaction hash of the event | +| from | bytea | address of the sender | +| to | bytea | address of the receiver. Null when its a contract creation transaction | +| value | numeric | the amount of ether sent in this transaction in wei. note that erc20 tokens do not show up here. | +| gas | numeric | | +| gas\_used | numeric | the gas consumed by the transaction in wei | +| tx\_index | numeric | the index of the transaction | +| trace\_address | array | address of the trace within the call graph forest. E.g., \[0, 2, 1] is a parent of \[0, 2, 1, 0]. | +| sub\_traces | numeric | number of children of a trace | +| type | text | type of action | +| address | bytea | the contract that is called when the type is suicide or create | +| code | bytea | | +| call\_type | bytea | the type of the call | +| input | bytea | | +| output | bytea | | +| refund\_address | bytea | | + +\*\*\*\*[**Take a look for yourself**](https://dune.xyz/queries/38730)\*\*\*\* + +**You probably won’t use these too much when doing analysis with Dune (see** [**decoded data**](../decoded-data.md)**), but it’s always nice to have just in case.** diff --git a/data-tables/data-tables/raw-data/xdai-data.md b/data-tables/data-tables/raw-data/xdai-data.md new file mode 100644 index 0000000..e5ccf36 --- /dev/null +++ b/data-tables/data-tables/raw-data/xdai-data.md @@ -0,0 +1,93 @@ +# xDai Data + +### xDai.Blocks + +| **Column Name** | **datatype** | **Description** | +| ----------------- | ------------ | ---------------------------------------------------------------------- | +| time | timestamptz | the time when the block was mined. | +| number | numeric | the length of the blockchain in blocks | +| hash | bytea | a unique identifier for that block | +| parent hash | bytea | the unique identifier for the prior block | +| gas\_limit | numeric | the gas limit of the current block | +| gas\_used | numeric | the gas used in this block | +| miner | bytea | the address of the miner | +| difficulty | numeric | the effort required to mine the block | +| total\_difficulty | numeric | total difficulty of the chain until this block | +| nonce | bytea | the block nonce is used to demonstrate the proof of work during mining | +| size | numeric | this block's size in bytes (limited by gas limit) | + +### + +### xDai.Logs + +This Table stores all logs that get generated by smart contracts. It is sometimes useful for querying contracts that are not yet decoded or are resistant to being decoded(we need an abi key for that). + +Logs are an elegant way to store tiny amounts of data on the Ethereum blockchain for a small price. Specifically, event logs are useful to let other people know something has happened without them having to query contracts individually. + +For more on this topic read [this article](https://medium.com/mycrypto/understanding-event-logs-on-the-ethereum-blockchain-f4ae7ba50378). + +| **Column Name** | **datatype** | **Description** | +| ----------------- | ------------ | ------------------------------------------------ | +| block\_hash | bytea | a unique identifier for that block | +| block\_number | int8 | the length of the blockchain in blocks | +| block\_time | timestamptz | the time when the block was mined | +| contract\_address | bytea | The address of the contract that emitted the log | +| data | bytea | event data | +| topic1 | bytea | indexed _keys_ of the event | +| topic2 | bytea | indexed _keys_ of the event | +| topic3 | bytea | indexed _keys_ of the event | +| topic4 | bytea | indexed _keys_ of the event | +| index | numeric | the transactions index position in the block | +| tx\_hash | bytea | the transaction hash of the event | +| tx\_index | numeric | the index of the transaction | + +### xDai.Transactions + +| **Column Name** | **datatype** | **Description** | +| --------------- | ------------ | ------------------------------------------------------------------------------------------------ | +| block\_time | timestamptz | the time when the block was mined | +| nonce | numeric | the transaction nonce, unique to that wallet | +| index | numeric | the transactions index position in the block | +| success | boolean | a true/false value that shows if the transaction suceeded | +| from | bytea | address of the sender | +| to | bytea | address of the receiver. Null when its a contract creation transaction | +| value | numeric | the amount of ether sent in this transaction in wei. note that erc20 tokens do not show up here. | +| block\_number | int8 | the length of the blockchain in blocks | +| block\_hash | bytea | a unique identifier for that block | +| gas\_limit | numeric | the gas limit in wei | +| gas\_price | numeric | the gas price in wei | +| gas\_used | numeric | the gas consumed by the transaction in wei | +| data | bytea | event data | +| hash | bytea | the hash of the transaction | + +### xDai.Traces + + Transactions can trigger smaller atomic actions that modify the internal state of the Ethereum Virtual Machine. Information about the execution of these actions is logged and can be found stored as an EVM execution trace, or just a _trace_.\ +\ +Read more [here](https://medium.com/chainalysis/ethereum-traces-not-transactions-3f0533d26aa). + +| **Column Name** | **datatype** | **Description** | +| --------------- | ------------ | ------------------------------------------------------------------------------------------------ | +| block\_time | timestamptz | the time when the block was mined | +| tx\_success | boolean | a true/false value that shows if the transaction succeeded | +| success | boolean | a true/false value that shows if the trace action succeeded | +| block\_hash | bytea | a unique identifier for that block | +| block\_number | int8 | the length of the blockchain in blocks | +| tx\_hash | bytea | the transaction hash of the event | +| from | bytea | address of the sender | +| to | bytea | address of the receiver. Null when its a contract creation transaction | +| value | numeric | the amount of ether sent in this transaction in wei. note that erc20 tokens do not show up here. | +| gas | numeric | | +| gas\_used | numeric | the gas consumed by the transaction in wei | +| tx\_index | numeric | the index of the transaction | +| trace\_address | | | +| sub\_traces | | | +| type | text | type of action | +| address | bytea | the contract that is called when the type is suicide or create | +| code | bytea | | +| call\_type | bytea | the type of the call | +| input | bytea | | +| output | bytea | | +| refund\_address | bytea | | + +**You probably won’t use these too much when doing analysis with Dune (see** [**decoded data**](../decoded-data.md)**), but it’s always nice to have just in case.** diff --git a/data-tables/data-tables/solana-data/README.md b/data-tables/data-tables/solana-data/README.md new file mode 100644 index 0000000..2578bd4 --- /dev/null +++ b/data-tables/data-tables/solana-data/README.md @@ -0,0 +1,158 @@ +--- +description: >- + Our database automatically pulls in raw data from the Solana Blockchain and + parses them into different tables depending on which aspect that table is + focused on. +--- + +# Solana Data + +All of the tables below are built in an updated version of the Dune platform that will require a slight change to how wizards write queries in the platform. The new data platform leverages spark to increase query speed, data scale, and to support multi-chain queries. + +A reference document to use as you start to query the Solana tables is available here: + +{% embed url="https://spark.apache.org/docs/latest/sql-ref-ansi-compliance.html" %} + +## Solana.blocks + +This table contains the block data within Solana’s blockchain. It can be used to identify block activity and transaction changes over time. + +Query examples can be found here: [Solana blocks over time](https://dune.xyz/queries/389979) and [Transactions per day](https://dune.xyz/queries/390045) + +| Column Name | Column Type | Description | +| ------------------------- | ----------- | --------------------------------------------------- | +| hash | string | string The hash of this block, base-58 encoded | +| height | bigint | The number of blocks beneath this block | +| slot | bigint | This block’s slot index in the ledger | +| time | timestamp | The (estimated) time this block was produced | +| date | date | Used to partition by | +| parent\_slot | bigint | The slot index of this block's parent | +| previous\_block\_\_\_hash | string | The hash of this block's parent, base-58 encoded | +| total\_transactions | bigint | The total number of transactions in this block | +| successful\_transactions | bigint | The number of successful transactions in this block | +| failed\_transactions | bigint | The number of failed transactions in this block | + +## Solana.transactions + +This table contains the transaction data within Solana’s blockchain. Most of the relevant data related to account, protocol, and program activity is available in this table. + +Query examples can be found here: [NFT transactions of popular programs past 7 days](https://dune.xyz/queries/390720/745376) and [drift-protocol overview](https://dune.xyz/bigz/drift-\(solana\)) + +| Column Name | Column Type | Description | +| -------------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| block\_slot | bigint | This block’s slot index in the ledger | +| block\_time | timestamp | The (estimated) time this block was produced | +| block\_date | date | Event date | +| index | bigint | Index into the block’s transactions | +| fee | bigint | Fee this transaction was charged, as paid by first account | +| block\_hash | string | The hash of this block, base-58 encoded | +| error | STRUCT error | NULL if success is true. | +| required\_signatures | bigint | The total number of signatures required to make the transaction valid. | +| readonly\_signed\_\_\_accounts | bigint | The last readonly\_signed\_accounts of the signed keys are read-only accounts. | +| readonly\_unsigned\_\_\_accounts | bigint | The last readonly\_unsigned\_accounts of the unsigned keys are read-only accounts. | +| id | string | The first signature in the transaction | +| success | boolean | The transaction was valid and thus committed. | +| recent\_block\_\_\_hash | string | The hash of a recent block in the ledger, used to prevent transaction duplication and to give transactions lifetimes | +| instructions | array\\x2a7d..
(bytea)
0x2a7d...
(string)
\x2A7D...
(bytea)
Works in Postgres
0x2a7d...
(string)
Has to be lowercase in Spark.
Can be done via lower('0x2A7D...')
.
Don’t useprices.usd
decimals
Get json object
differences
("takerOutputUpdate"->
'deltaWei'->'value'
)decode(substring(("addressSet"->'baseAsset')::TEXT, 4,40), 'hex')
get_json_object(get_json_object(takerOutputUpdate,'$.deltaWei'),'$.value')
'0x'
# H1
## H2
### H3
1. First item
2. Second item
3. Third item
- First item
- Second item
- Third item
Displays the value in an abbreviated format.
Will display decimals of the abbreviated number according to count of zeroes after the dot.
| +| 1256784.3745 | $0\[.]0a | $1.2m | Adheres to the same methods as before, but adds a $ prefix. | diff --git a/duneapp/visualizations/README.md b/duneapp/visualizations/README.md new file mode 100644 index 0000000..e2abe39 --- /dev/null +++ b/duneapp/visualizations/README.md @@ -0,0 +1,49 @@ +--- +description: Visualizations make your data come alive! +--- + +# Visualizations + +Visualizing your query results makes the results accessible and allows you to effectively communicate your findings to your audience. + +Dune offers you a variety of different visualization options: + +* bar charts +* area charts +* scatter charts +* line charts +* pie charts +* counters + +Combining these in a thoughtful manner allows you to best communicate your data to your audience. + +### Creating Visualizations + +You can create visualizations from any query results in seconds using our visualization engine. + +Simply click on the `New visualization` button and configure the visualization to your needs. + +One query can have multiple visualizations. + + + +![](<../../.gitbook/assets/2021-11-26 13-08-16.gif>) + +**Read more about the different visualization options here:** + +{% content-ref url="graphs.md" %} +[graphs.md](graphs.md) +{% endcontent-ref %} + +{% content-ref url="counters.md" %} +[counters.md](counters.md) +{% endcontent-ref %} + +{% content-ref url="pie-charts.md" %} +[pie-charts.md](pie-charts.md) +{% endcontent-ref %} + +## What you can do with Visualizations + +Visualizations can either live on your [dashboard](../dashboards.md) or be embedded on their own using the [embedd function](../../sharing/embeds/) + diff --git a/duneapp/visualizations/counters.md b/duneapp/visualizations/counters.md new file mode 100644 index 0000000..6000991 --- /dev/null +++ b/duneapp/visualizations/counters.md @@ -0,0 +1,57 @@ +# Counters + +#### Counters are a great way to provide your audience with immediate "on a glance" stats. + +!["on a glance" stats in https://dune.xyz/0xBoxer/NFT](<../../.gitbook/assets/image (41).png>) + +## Configuring your counter + +![](<../../.gitbook/assets/image (49).png>) + +### Counter options + +In this section you can define what kind of data the counter should display. + +#### Title + +* The Title will appear in all instances of this graph prominently at the top +* If left blank the query name will be the only thing that is left standing + +#### Column + +* In this field you can define which column the counter should show. + +#### Row + +* This field can be used to define which row of the underlying datatable you want displayed e.g. row 1 +* Usually this requires you to sort or limit your query results in order for row 1 to show the wanted results. + +### Formatting + +**Prefix** + +* This field allows you to define a prefix for your counter value. +* e.g.: `$`, `€`, `Ξ`, `฿` + +**Suffix** + +* This field allows you to define a suffix for your counter value. + +**Label** + +* This field allows you to define a label for your counter value. +* The label will appear beneath the counter value as text. + +**Decimals** + +* In this field you can choose how many decimals you want displayed for your counter +* This is currently limited to 3 decimal places. + +### Counters explained + +Here is an example to bring some points explained earlier home. + +![label](<../../.gitbook/assets/image (39).png>) + +![label configuration](<../../.gitbook/assets/image (57).png>) + diff --git a/duneapp/visualizations/graphs.md b/duneapp/visualizations/graphs.md new file mode 100644 index 0000000..08c9c37 --- /dev/null +++ b/duneapp/visualizations/graphs.md @@ -0,0 +1,187 @@ +--- +description: Graphs are good for condensing data points into a visualization. +--- + +# Graphs + +**Graphs are great for condensing data points into a visualization.** + +![a graph with mixed line and scatter graphs](<../../.gitbook/assets/image (48).png>) + +![a stacked bar chart](<../../.gitbook/assets/image (60).png>) + +### Dune offers you to create the following graph types: + +* bar charts +* area charts +* scatter charts +* line charts + +You can mix all of these graph types together in one visualization**.**\ +**** + +### Configuring your visualizations + +All graph visualizations share a common editing schema. + +In essence, you can define your visualization in detail here. The three different sections of this are explained below. + +![](<../../.gitbook/assets/image (34).png>) + +### Chart options + +This section allows you to define how to display your data. + +![see explanations below](<../../.gitbook/assets/image (59).png>) + +**Title** + +* The title will appear in all instances of this graph prominently at the top. +* The graph will always keep the name of the query, even if you edit this. + + + +* [ ] **Show chart legend** + + + +* Ticking this box will enable or disable the legend for the chart. + + + +* [ ] **Enable stacking** + + + +* If applicable, ticking this box will stack the chart values on top of each other based on the x-axis values. +* If this is not turned on, the values will be plotted individually on the y-axis. +* The calculation underpinning this will always group the value corresponding to one value on the x-axis. Make sure your data is clean in able for this to work (avoid gaps in your data). + + + +* [ ] **Normalize to percentage data** + + + +* This will normalize the chart to display percentage values of the chosen data table. +* The calculation underpinning this will always group the value corresponding to one value on the x-axis. Make sure your data is clean in able for this to work (avoid gaps in your data). + + + +* [ ] **Show data labels** + + + +* Ticking this box leads to the display of the individual datapoints inside of the graph. +* This only makes sense in cases where you have few datapoints that are spread out far enough from each other to not overlap. + +### Result data + +Here you can pick the data points that are to be displayed. + +![see explanations below](<../../.gitbook/assets/image (47).png>) + +You can choose one **x-axis** and multiple **y-axis.** + +Alternatively, you can also choose one data series on the y-axis and choose to group it by a different column of your table (as shown in the example above). + +### **X-axis options** + +Using these options you can influence how your x-axis data gets displayed. + +![see explanations below](<../../.gitbook/assets/image (37).png>) + +**Axis title** + +* This field allows you to specify a title for your x-axis. + + + +* [ ] **Sort Values** + + + +* by ticking this box you can specify if you want the values in your chart to be ordered. +* If your x-axis is a timeseries, this will automatically happen. + + + +* [ ] **Reverse value** + + + +* Ticking this box will reverse the order of the values on the x-axis. + + + +* [ ] **Logarithmic** + + + +* Ticking this box will make your x-axis values display __ logarithmically. + +### **Y-axis options** + +With these options you can influence how your x-axis data gets displayed. + +![see explanations below](<../../.gitbook/assets/image (40).png>) + +**Axis title** + +* This field allows you to specify a title for your y-axis. + + + +* [ ] **Logarithmic** + + + +* Ticking this box will make your x-axis values display __ logarithmically. + + + +* [ ] **Enable right y-axis** + + + +* Ticking this box will enable an additional y-axis that you can plot values on. +* You can choose in the [chart series section](graphs.md#ordering-your-series) what you want to be displayed on the left and right axis. + +### **Tick formats** + +****![](<../../.gitbook/assets/image (61).png>)**** + +Tick formats will change how values in your chart and the axis labels will get displayed. + +It follows this logic: + +| Value | Tick format | Output | Description | +| ------------ | ----------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| 1256784.3745 | left blank | 1256784,3745000 | Display the full number and 7 decimals | +| 1256784.3745 | 0 | 1256784 | Only Display whole numbers | +| 1256784.3745 | 0,0 | 1,256,784 | Only displays whole numbers with comma separator | +| 1256784.3745 | 0,0.00 | 1,256,784.38 | Displays the value with decimals points according to the count of zeroes after the dot | +| 1256784.3745 | 0\[.]0a | 1.2m |Displays the value in an abbreviated format.
Will display decimals of the abbreviated number according to count of zeroes after the dot.
| +| 1256784.3745 | $0\[.]0a | $1.2m | Adheres to the same methods as before, but adds a $ prefix. | + +### Ordering your series + +![](<../../.gitbook/assets/image (52).png>) + +In this section of the visualization editor you can finalize your graph. + +* You can rename the "series" by simply clicking into the field. +* You can change the chart type by clicking into the dropdown. +* You can change the colors by clicking into the color box. +* Finally you can also change the order of the series. + +### Picking Colors + +You can pick colors with your browser native color selector. + +This might look slightly different for you depending on which browser you use. + + + +![Choose any color you want!](<../../.gitbook/assets/2021-11-26 17-25-04.gif>) + diff --git a/duneapp/visualizations/pie-charts.md b/duneapp/visualizations/pie-charts.md new file mode 100644 index 0000000..1585e25 --- /dev/null +++ b/duneapp/visualizations/pie-charts.md @@ -0,0 +1,39 @@ +# Pie Charts + +**Pie charts are great for showing the composition of something.** + +![Marketshare of different decentralized exchanges on https://dune.xyz/hagaetc/dex-metrics](<../../.gitbook/assets/image (51).png>) + +## Configuring your pie chart + +![](<../../.gitbook/assets/image (55).png>) + +### Chart Options + +#### Title + +* The Title will appear in all instances of this graph prominently at the top +* If left blank the query name will be the only thing that is left standing + + + +* [ ] **Show data labels** + + + +* Ticking this box leads to the display of the individual datapoints inside of the graph. +* This only makes sense in cases where you have few datapoints that are spread out far enough from each other to not overlap. + +### Result data + +Here you can pick the data points that are to be displayed. + +![The configuration for the chart above](<../../.gitbook/assets/image (33).png>) + +You can choose one **x-axis** and one y-axis. + +### Pie Options + +**Label format** + +* This field allows you to define the [tick format](https://docs.dune.xyz/duneapp/visualizations#tick-formats) of the data labels. diff --git a/faq/does-dune-have-a-token.md b/faq/does-dune-have-a-token.md new file mode 100644 index 0000000..dcd51c8 --- /dev/null +++ b/faq/does-dune-have-a-token.md @@ -0,0 +1,3 @@ +# Does Dune have a Token? + +**Dune does not have token.** diff --git a/faq/does-dune-have-an-api.md b/faq/does-dune-have-an-api.md new file mode 100644 index 0000000..3a8032f --- /dev/null +++ b/faq/does-dune-have-an-api.md @@ -0,0 +1,7 @@ +# Does Dune have an API? + +**Dune is currently working on an API!** + +If you'd like to express interest in receiving early access and would be willing to tell us more on how you expect to use the API - please complete our [API Interest form](https://docs.google.com/forms/d/e/1FAIpQLSdoF4\_LC1BdPumRq1TJguxAsKC-g5i6u2f7-sac5v14EubLsw/viewform). + +Until then, [paid plan users](https://dune.com/pricing) can export results as CSV and anyone can embed Dune charts on their page for free by clicking "[Embed](../sharing/embeds/)" on any query visualisation. diff --git a/faq/how-are-results-refreshing.md b/faq/how-are-results-refreshing.md new file mode 100644 index 0000000..83f27d7 --- /dev/null +++ b/faq/how-are-results-refreshing.md @@ -0,0 +1,7 @@ +# How are results refreshing? + +When a visualisation is viewed, either on a query page or on a dashboard, the Dune backend will inspect the age of the most recent result. If the result is stale (currently defined as >3 hours old), Dune will automatically queue an execution for this query and run it in the background. + +This means that dashboards will always be kept up to date when they are being viewed and the query creator does not need to set a refresh schedule. + +Note that the query execution queue is separate from each individual users queue when they create and run queries in the query editor. diff --git a/faq/how-does-dune-get-its-data.md b/faq/how-does-dune-get-its-data.md new file mode 100644 index 0000000..fbbe601 --- /dev/null +++ b/faq/how-does-dune-get-its-data.md @@ -0,0 +1,7 @@ +# How does Dune get it's data ? + +We are working together with node providers across the Industry to ingest data into our database. This includes all raw historical data from these blockchains. It does not include state data.\ + + +We don't discriminate against any smart contract, you can submit any contract via our [decoding page](../data-tables/data-tables/decoded-data.md) and work with it in a matter of hours. The only prerequisite for this is an ABI so we can actually decode the contract (usually the ABI is already on etherscan, but there are edge cases). + diff --git a/onboarding/onboarding-to-dune.md b/onboarding/onboarding-to-dune.md new file mode 100644 index 0000000..95b6146 --- /dev/null +++ b/onboarding/onboarding-to-dune.md @@ -0,0 +1,28 @@ +# Onboarding to Dune + +### Dune is an open platform that anyone can build on + +Team Dune often gets asked about "possible cooperation" and "ways to work together" and while we appreciate all these kind requests, there really isn't anything you need from the core team to be able to surface your data on dune. \ +\ +Our platform is free, open and permissionless and anyone can use the platform as they see fit. \ +All you need is either a skilled freelancer or one of your team members to take care of the actually surfacing the data. + +**The Process looks like this:** + +1. **Compile a List of all relevant contracts and submit them for** [**decoding**](../duneapp/adding-new-contracts.md)**.** +2. **Surface the data using SQL queries** +3. **Visualize the results** +4. **Assemble visualizations on a dashboard.** +5. **Make the dashboard pretty** +6. **Enjoy your data** + +**** + +### How to find a freelancer + +There is quite a few people in the web3 scene which either specialized in building on dune or have the skillset in their repertoire. To reach out to this pool of freelancers, you can **fill in this** [**form**](http://bounties.dune.xyz/) **** and freelancers will get back to you in little to no time. Alternatively, you could also use platforms like gitcoin or layer3.xyz to find suitable freelancers. + +If hiring a freelancer for the first time, please make sure to check their past works and dashboards to verify that they are indeed capable of solving the task at hand. + + + diff --git a/resources/press-kit.md b/resources/press-kit.md new file mode 100644 index 0000000..71f0f33 --- /dev/null +++ b/resources/press-kit.md @@ -0,0 +1,70 @@ +--- +description: Get the Dune brand assets and learn about the usage guidelines +--- + +# Press Kit + +## Primary - Standard Logo + +This is the primary Dune logo. It should be used in this format whenever possible. + +![](../.gitbook/assets/dune-horizontal-logo-cover.png) + +{% file src="../.gitbook/assets/dune-standard-logo.svg" %} +Standard logo (SVG) +{% endfile %} + +{% file src="../.gitbook/assets/dune-standard-logo@2x (1).png" %} +Standard logo (PNG) +{% endfile %} + +{% file src="../.gitbook/assets/dune-standard-logo-dark.svg" %} +Standard logo dark (SVG) +{% endfile %} + +{% file src="../.gitbook/assets/dune-standard-logo-dark@2x.png" %} +Standard logo dark (PNG) +{% endfile %} + + + +## Vertical logo + +![](<../.gitbook/assets/dune-vertical-logo-cover (1).png>) + +{% file src="../.gitbook/assets/dune-vertical-logo (1).svg" %} +Vertical logo (SVG) +{% endfile %} + +{% file src="../.gitbook/assets/dune-vertical-logo@2x (1).png" %} +Vertical logo (PNG) +{% endfile %} + +{% file src="../.gitbook/assets/dune-vertical-logo-dark.svg" %} +Vertical logo dark (SVG) +{% endfile %} + +{% file src="../.gitbook/assets/dune-vertical-logo-dark@2x (1).png" %} +Vertical logo dark (PNG) +{% endfile %} + +## Icon only + +![](../.gitbook/assets/dune-icon-only.svg) + +{% file src="../.gitbook/assets/dune-icon-only.svg" %} +Icon only (SVG) +{% endfile %} + +{% file src="../.gitbook/assets/dune-icon-only@2x.png" %} +Icon only (PNG) +{% endfile %} + +## Complete set of all logos + +{% file src="../.gitbook/assets/Dune-logo-Full.zip" %} +All logos in SVG and PNG format (ZIP) +{% endfile %} + + + diff --git a/sharing/attribution.md b/sharing/attribution.md new file mode 100644 index 0000000..30b1852 --- /dev/null +++ b/sharing/attribution.md @@ -0,0 +1,28 @@ +--- +description: Content on Dune is community created and should be attributed accordingly! +--- + +# Attribution + +### Attribution + +Content on Dune is first and foremost the product of the creators on the platform. \ +Any mention of analysis published on our platform outside of the platform should credit the creators of this specific piece of analysis and not just "Dune". \ +\ +Crediting charts and dashboards should be done in the following way: + +_"@eliasmos via_ [_https://dune.com/queries/610591_](https://dune.com/queries/610591)_"._ + +You can find the twitter tags and more information of most creators in their [profile page](https://dune.xyz/rchen8). + + + +![opening the profile of a creator](<../.gitbook/assets/opening up profile.gif>) + +\ + + +![Be the galaxy brain! Meme by https://dune.xyz/eliasimos/](https://pbs.twimg.com/media/E2YSaD2WUAAU7RU?format=png\&name=900x900) + +## + diff --git a/sharing/embeds/README.md b/sharing/embeds/README.md new file mode 100644 index 0000000..a6e75a0 --- /dev/null +++ b/sharing/embeds/README.md @@ -0,0 +1,64 @@ +--- +description: Embeds allow you to enjoy beautiful, updating dune charts across the web! +--- + +# Embeds + +## Using Embeds + +**Screenshots are boring and tech of the past.** + +Instead of using static screenshots in varying forms of quality, Dune has a native embed function that works across most platforms. + +You can generate embed links by clicking on any query title and selecting the embed function in the top right corner. + +![generating an embedd link](<../../.gitbook/assets/2021-11-01 14-30-33.gif>) + + + +### Parameterized embeds + +Embed links also work with parameterized queries, but it is a bit tricky to get them to work: + +The embed link that gets generated does not include the necessary parameters yet, even if you have ran the query with it. We are already working on automating the link generation, but for now the is the only way for us to handle this. + +For now you need to manually prefix the parameter link with the parameters. + +The syntax for this is: + +`link?name_of_parameter1=xxxx&?name_of_parameter2=yyyy&...` __ + +An example of this would be: + +`>https://dune.xyz/embeds/118220/238460/aa002dd3-f9e2-4d63-86c8-b765569306c6NFT?address=0xff9c1b15b16263c61d017ee9f65c50e4ae0113d7&rolling_n_trades=500`\ +`` + +### Embeds across different platforms + +Here is a couple of exemplary use cases for Dune embeds: + +{% content-ref url="discord.md" %} +[discord.md](discord.md) +{% endcontent-ref %} + +{% content-ref url="twitter.md" %} +[twitter.md](twitter.md) +{% endcontent-ref %} + +{% content-ref url="mirror.xyz.md" %} +[mirror.xyz.md](mirror.xyz.md) +{% endcontent-ref %} + +{% content-ref url="webpages.md" %} +[webpages.md](webpages.md) +{% endcontent-ref %} + + + +### Known Issues + +Unfortunately, embeds do not work in a couple of fairly popular sites, this includes: + +* substack +* medium +* gitbook diff --git a/sharing/embeds/discord.md b/sharing/embeds/discord.md new file mode 100644 index 0000000..6c4c434 --- /dev/null +++ b/sharing/embeds/discord.md @@ -0,0 +1,16 @@ +--- +description: Dune's embeds display beautifully in Discord! +--- + +# Discord + +Dune embeds work very well in Discord: + +You can simply drop the link in the chat and the corresponding visualization will get displayed. + +This also lends itself very well to programming a bot to return the corresponding charts on command. + +![](<../../.gitbook/assets/2021-11-02 18-39-01.gif>) + + + diff --git a/sharing/embeds/known-issues.md b/sharing/embeds/known-issues.md new file mode 100644 index 0000000..c9b8ade --- /dev/null +++ b/sharing/embeds/known-issues.md @@ -0,0 +1,11 @@ +--- +description: Sadly not every website wants to make it. +--- + +# Known Issues + +These websites currently sadly do not support dune embeds: + +* substack +* medium +* gitbook diff --git a/sharing/embeds/mirror.xyz.md b/sharing/embeds/mirror.xyz.md new file mode 100644 index 0000000..feb56a9 --- /dev/null +++ b/sharing/embeds/mirror.xyz.md @@ -0,0 +1,11 @@ +--- +description: Dune embedds work in Mirror.xyz! +--- + +# Mirror.xyz + +Dune charts can easily be embedded into articles on mirror.xyz. Simply generate an embed link and postfix it with `?display=iframe` + +An example of this would be: + +`https://dune.xyz/embeds/208941/391702/34ee3319-1cac-40e1-a08d-160bd93693cc?display=iframe` diff --git a/sharing/embeds/twitter.md b/sharing/embeds/twitter.md new file mode 100644 index 0000000..83e670a --- /dev/null +++ b/sharing/embeds/twitter.md @@ -0,0 +1,20 @@ +--- +description: >- + Sharing data on Twitter is probably the most common use case of Dune's + Visualizations. +--- + +# Twitter + +You can use embeds to share Dune's visualizations on Twitter. + +Twitter will render the visualizations automatically and they will update automatically as time progresses. + +Definitely a better experience compared to static screenshots! + +![Twitter automatically renders the embed link correctly](<../../.gitbook/assets/2021-11-01 14-45-28.gif>) + + + + + diff --git a/sharing/embeds/webpages.md b/sharing/embeds/webpages.md new file mode 100644 index 0000000..a56031e --- /dev/null +++ b/sharing/embeds/webpages.md @@ -0,0 +1,22 @@ +--- +description: You can embedd Dune's Visualizations on most Websites with ease. +--- + +# Webpages + +### Dune Charts can live in your website! + +You can use Dune's embed function to embed the charts usually displayed on Dune Analytics Dashboards into your website. + +Here is a code snippet example: + +`` + +We have seen this feature used on project websites, websites of researchers and basically everywhere by now, the limit really is just your imagination. + +A great showcase for this is the [cryptoart.io](https://cryptoart.io/data) website. + + + + +