-
Notifications
You must be signed in to change notification settings - Fork 1
/
stats_hicetnunc.R
698 lines (641 loc) · 29.1 KB
/
stats_hicetnunc.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
library(pacman)
#devtools::install_github('thomasp85/ggfx')
# devtools::install_github('lenkiefer/darklyplot')
# Load packages
p_load('pins','ggplot2','anytime','ggthemes','fs','gganimate','magick','dplyr','devtools',
'transformr', 'ggforce','scales','tidyr','glue','darklyplot','ggfx', 'gridExtra')
# Register Board for data pull
board_register("https://raw.githubusercontent.com/predictcrypto/pins/master/","pins_repo")
#### Visualize Stats ####
# Pull data
stats_hicetnunc <- pin_get("stats_hicetnunc_new", "pins_repo")
# Daily Users
ggplot(data = stats_hicetnunc,
aes(x = as.POSIXct(date_time_utc), y = stats_day_users)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: better-call.dev API') +
# Circle max
geom_mark_ellipse(aes(filter = stats_day_users == max(stats_day_users),
label = date_time_utc,
description = paste0('Max daily users - ', stats_day_users))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = stats_day_users == min(stats_day_users),
label = date_time_utc,
description = paste0('Min daily users - ', stats_day_users))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Number of Collectors') +
ggtitle(paste('hic et nunc Daily Collectors'))
# Save chart as image
ggsave('stats_hicetnunc_daily_users.png')
# Also archive
#ggsave(glue('archive/users/stats_hicetnunc_daily_users_{Sys.Date()}.png'))
# Daily Transactions
ggplot(data = stats_hicetnunc,
aes(x = as.POSIXct(date_time_utc), y = stats_day_txs)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: better-call.dev API') +
# Circle max
geom_mark_ellipse(aes(filter = stats_day_txs == max(stats_day_txs),
label = date_time_utc,
description = paste0('Max daily txs - ', stats_day_txs))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = stats_day_txs == min(stats_day_txs),
label = date_time_utc,
description = paste0('Min daily txs - ', stats_day_txs))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Number of Purchases') +
ggtitle(paste('hic et nunc Daily Purchases'))
# Save chart as image
ggsave('stats_hicetnunc_daily_txs.png')
# Also archive
#ggsave(glue('archive/transactions/stats_hicetnunc_daily_txs_{Sys.Date()}.png'))
# Weekly Users
ggplot(data = stats_hicetnunc,
aes(x = as.POSIXct(date_time_utc), y = stats_week_users)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: better-call.dev API') +
# Circle max
geom_mark_ellipse(aes(filter = stats_week_users == max(stats_week_users),
label = date_time_utc,
description = paste0('Max weekly users - ', stats_week_users))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = stats_week_users == min(stats_week_users),
label = date_time_utc,
description = paste0('Min weekly users - ', stats_week_users))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Number of Collectors') +
ggtitle(paste('hic et nunc Weekly Collectors'))
# Save chart as image
ggsave('stats_hicetnunc_week_users.png')
# Also archive
#ggsave(glue('archive/users/stats_hicetnunc_week_users_{Sys.Date()}.png'))
# Weekly Transactions
ggplot(data = stats_hicetnunc,
aes(x = as.POSIXct(date_time_utc), y = stats_week_txs)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: better-call.dev API') +
# Circle max
geom_mark_ellipse(aes(filter = stats_week_txs == max(stats_week_txs),
label = date_time_utc,
description = paste0('Max weekly txs - ', stats_week_txs))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = stats_week_txs == min(stats_week_txs),
label = date_time_utc,
description = paste0('Min weekly txs - ', stats_week_txs))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Number of Purchases') +
ggtitle(paste('hic et nunc Weekly Purchases'))
# Save chart as image
ggsave('stats_hicetnunc_week_txs.png')
# Also archive
#ggsave(glue('archive/transactions/stats_hicetnunc_week_txs_{Sys.Date()}.png'))
# Monthly Users
ggplot(data = stats_hicetnunc,
aes(x = as.POSIXct(date_time_utc), y = stats_month_users)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: better-call.dev API') +
# Circle max
geom_mark_ellipse(aes(filter = stats_month_users == max(stats_month_users),
label = date_time_utc,
description = paste0('Max monthly users - ', stats_month_users))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = stats_month_users == min(stats_month_users),
label = date_time_utc,
description = paste0('Min monthly users - ', stats_month_users))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Number of Collectors') +
ggtitle(paste('hic et nunc Monthly Collectors'))
# Save chart as image
ggsave('stats_hicetnunc_month_users.png')
# Also archive
#ggsave(glue('archive/users/stats_hicetnunc_month_users_{Sys.Date()}.png'))
# Monthly Transactions
ggplot(data = stats_hicetnunc,
aes(x = as.POSIXct(date_time_utc), y = stats_month_txs)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: better-call.dev API') +
# Circle max
geom_mark_ellipse(aes(filter = stats_month_txs == max(stats_month_txs),
label = date_time_utc,
description = paste0('Max monthly txs - ', stats_month_txs))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = stats_month_txs == min(stats_month_txs),
label = date_time_utc,
description = paste0('Min monthly txs - ', stats_month_txs))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Number of Purchases') +
ggtitle(paste('hic et nunc Monthly Purchases'))
# Save chart as image
ggsave('stats_hicetnunc_month_txs.png')
# Also archive
#ggsave(glue('archive/transactions/stats_hicetnunc_month_txs_{Sys.Date()}.png'))
# All-time Users
ggplot(data = stats_hicetnunc,
aes(x = as.POSIXct(date_time_utc), y = stats_all_users)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: better-call.dev API') +
# Circle max
geom_mark_ellipse(aes(filter = stats_all_users == max(stats_all_users),
label = date_time_utc,
description = paste0('all time users - ', stats_all_users))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Number of Collectors') +
ggtitle(paste('hic et nunc Total Collectors'))
# Save chart as image
ggsave('stats_hicetnunc_all_users.png')
# Also archive
#ggsave(glue('archive/users/stats_hicetnunc_all_users_{Sys.Date()}.png'))
# All-time Transactions
ggplot(data = stats_hicetnunc,
aes(x = as.POSIXct(date_time_utc), y = stats_all_txs)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: better-call.dev API') +
# Circle max
geom_mark_ellipse(aes(filter = stats_all_txs == max(stats_all_txs),
label = date_time_utc,
description = paste0('all time txs - ', stats_all_txs))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Number of Purchases') +
ggtitle(paste('hic et nunc All-Time Purchases'))
# Save chart as image
ggsave('stats_hicetnunc_all_txs.png')
# Also make an archive
#ggsave(glue('archive/transactions/stats_hicetnunc_all_txs_{Sys.Date()}.png'))
# TODO - Calculate % of all the network that is active based on day, week, month
stats_hicetnunc_percent = mutate(stats_hicetnunc,
Day = stats_day_users/stats_all_users,
Week = stats_week_users/stats_all_users,
Month = stats_month_users/stats_all_users)
# Reshape the data to avoid issues coloring
stats_hicetnunc_percent = gather(stats_hicetnunc_percent, key = "days_out",
value = "percent_active", Day, Week, Month) %>%
select(date_utc, date_time_utc, days_out, percent_active)
# Reorder factors
stats_hicetnunc_percent$days_out <- factor(stats_hicetnunc_percent$days_out,
levels = c("Day", "Week", "Month"))
# Visualize Active Users
ggplot(data = stats_hicetnunc_percent,
aes(x = as.POSIXct(date_time_utc), y = percent_active, color=days_out)) +
geom_line(size=1.2) +
geom_point(size=2.5) +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc_percent$date_time_utc), ' - UTC'),
caption='Data source: better-call.dev API') +
theme_solarized() +
xlab('Date Time Collected (UTC)') +
ylab('Active Collectors - % of Total') +
ggtitle(paste('hic et nunc Active Collectors - Percent of Total')) +
labs(color='Days Out') +
scale_y_continuous(labels = scales::percent) +
scale_x_datetime(date_labels = "%m/%d/%y") +
# Tried changing the order but was not able to
scale_color_manual(labels = c("Day", "Week","Month"), values = c("#6DB9BE", "#87BE6D", "#876DBE"))
# Save chart as image
ggsave('stats_hicetnunc_active_users.png')
# Also make an archive
#ggsave(glue('archive/active_users_percent/stats_hicetnunc_active_users_{Sys.Date()}.png'))
#
# # GGFX - WAITING TO PROPERLY TEST inner AND outer GLOW ONCE MORE DATA COMES IN!
# ggplot(data = stats_hicetnunc_percent,
# aes(x = as.POSIXct(date_time_utc), y = percent_active, color=days_out)) +
# with_outer_glow(geom_line(size=1.2)) + # Can do either `with_inner_glow` or `with_outer_glow`
# #with_inner_glow(geom_point(size=5)) +
# labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc_percent$date_time_utc), ' - UTC'),
# caption='Data source: better-call.dev API') +
# theme_solarized() +
# xlab('Date Time Collected (UTC)') +
# ylab('Active Users % of Total') +
# ggtitle(paste('Hicetnunc Active Users - Percent of Total')) +
# labs(color='Days Out') +
# scale_y_continuous(labels = scales::percent) +
# scale_x_datetime(date_labels = "%m/%d/%y") +
# # Tried changing the order but was not able to
# scale_color_manual(labels = c("Day", "Week","Month"), values = c("#6DB9BE", "#87BE6D", "#876DBE"))
# #darklyplot::theme_dark2()
# # Save chart as image
# ggsave('stats_hicetnunc_active_users.png')
# # Also make an archive
# ggsave(glue('archive/active_users_percent/stats_hicetnunc_active_users_{Sys.Date()}.png'))
# NOW hDAO
# Pull data
hdao_price <- pin_get("hdao_price", "pins_repo")
# Visualize price
ggplot(data = hdao_price,
aes(x = as.POSIXct(date_time_utc), y = hdao_price)) +
geom_line(size=1.2) +
geom_point(size=0.8, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: tzkt.io API') +
# Circle max
geom_mark_ellipse(aes(filter = hdao_price == max(hdao_price),
label = date_time_utc,
description = paste0('Max price - ', hdao_price))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = hdao_price == min(hdao_price),
label = date_time_utc,
description = paste0('Min price - ', hdao_price))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Price ($XTZ)') +
ggtitle(paste('Price of hDAO ($XTZ)'))
# Save chart as image
ggsave('hdao_price.png')
# Also archive
#ggsave(glue('archive/hdao_price/hdao_price_{Sys.Date()}.png'))
# Now WEEKLY chart
ggplot(data = filter(hdao_price, date_utc > Sys.Date()-7),
aes(x = as.POSIXct(date_time_utc), y = hdao_price)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: tzkt.io API') +
# Circle max
geom_mark_ellipse(aes(filter = hdao_price == max(hdao_price),
label = date_time_utc,
description = paste0('Max price - ', hdao_price))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = hdao_price == min(hdao_price),
label = date_time_utc,
description = paste0('Min price - ', hdao_price))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Price ($XTZ)') +
ggtitle(paste('Price of hDAO ($XTZ) - Last 7 Days'))
# Save chart as image
ggsave('hdao_price_7d.png')
# Also archive
#ggsave(glue('archive/hdao_price/hdao_price_7d_{Sys.Date()}.png'))
# NOW wrap
# Pull data
wrap_price <- pin_get("wrap_price", "pins_repo")
# Daily Users
ggplot(data = wrap_price,
aes(x = as.POSIXct(date_time_utc), y = wrap_price)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: tzkt.io API') +
# Circle max
geom_mark_ellipse(aes(filter = wrap_price == max(wrap_price),
label = date_time_utc,
description = paste0('Max price - ', wrap_price))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = wrap_price == min(wrap_price),
label = date_time_utc,
description = paste0('Min price - ', wrap_price))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Price ($XTZ)') +
ggtitle(paste('Price of WRAP ($XTZ)'))
# Save chart as image
ggsave('wrap_price.png')
# Also archive
#ggsave(glue('archive/wrap_price/wrap_price_{Sys.Date()}.png'))
# NOW wxtz
# Pull data
wxtz_price <- pin_get("wxtz_price", "pins_repo")
# Daily Users
ggplot(data = wxtz_price,
aes(x = as.POSIXct(date_time_utc), y = wxtz_price)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: tzkt.io API') +
# Circle max
geom_mark_ellipse(aes(filter = wxtz_price == max(wxtz_price),
label = date_time_utc,
description = paste0('Max price - ', wxtz_price))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = wxtz_price == min(wxtz_price),
label = date_time_utc,
description = paste0('Min price - ', wxtz_price))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Price ($XTZ)') +
ggtitle(paste('Price of wXTZ ($XTZ)'))
# Save chart as image
ggsave('wxtz_price.png')
# Also archive
#ggsave(glue('archive/wxtz_price/wxtz_price_{Sys.Date()}.png'))
# NOW stkr
# Pull data
stkr_price <- pin_get("stkr_price", "pins_repo")
# Daily Users
ggplot(data = stkr_price,
aes(x = as.POSIXct(date_time_utc), y = stkr_price)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: tzkt.io API') +
# Circle max
geom_mark_ellipse(aes(filter = stkr_price == max(stkr_price),
label = date_time_utc,
description = paste0('Max price - ', stkr_price))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = stkr_price == min(stkr_price),
label = date_time_utc,
description = paste0('Min price - ', stkr_price))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Price ($XTZ)') +
ggtitle(paste('Price of STKR ($XTZ)'))
# Save chart as image
ggsave('stkr_price.png')
# Also archive
#ggsave(glue('archive/stkr_price/stkr_price_{Sys.Date()}.png'))
# NOW kusd
# Pull data
kusd_price <- pin_get("kusd_price", "pins_repo")
# Daily Users
ggplot(data = kusd_price,
aes(x = as.POSIXct(date_time_utc), y = kusd_price)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: tzkt.io API') +
# Circle max
geom_mark_ellipse(aes(filter = kusd_price == max(kusd_price),
label = date_time_utc,
description = paste0('Max price - ', kusd_price))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = kusd_price == min(kusd_price),
label = date_time_utc,
description = paste0('Min price - ', kusd_price))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Price ($XTZ)') +
ggtitle(paste('Price of KUSD ($XTZ)'))
# Save chart as image
ggsave('kusd_price.png')
# Also archive
#ggsave(glue('archive/kusd_price/kusd_price_{Sys.Date()}.png'))
# NOW usds
# Pull data
usds_price <- pin_get("usds_price", "pins_repo")
# Daily Users
ggplot(data = usds_price,
aes(x = as.POSIXct(date_time_utc), y = usds_price)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: tzkt.io API') +
# Circle max
geom_mark_ellipse(aes(filter = usds_price == max(usds_price),
label = date_time_utc,
description = paste0('Max price - ', usds_price))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = usds_price == min(usds_price),
label = date_time_utc,
description = paste0('Min price - ', usds_price))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Price ($XTZ)') +
ggtitle(paste('Price of USDS ($XTZ)'))
# Save chart as image
ggsave('usds_price.png')
# Also archive
#ggsave(glue('archive/usds_price/usds_price_{Sys.Date()}.png'))
# NOW usdtz
# Pull data
usdtz_price <- pin_get("usdtz_price", "pins_repo")
# Daily Users
ggplot(data = usdtz_price,
aes(x = as.POSIXct(date_time_utc), y = usdtz_price)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: tzkt.io API') +
# Circle max
geom_mark_ellipse(aes(filter = usdtz_price == max(usdtz_price),
label = date_time_utc,
description = paste0('Max price - ', usdtz_price))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = usdtz_price == min(usdtz_price),
label = date_time_utc,
description = paste0('Min price - ', usdtz_price))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Price ($XTZ)') +
ggtitle(paste('Price of USDtz ($XTZ)'))
# Save chart as image
ggsave('usdtz_price.png')
# Also archive
#ggsave(glue('archive/usdtz_price/usdtz_price_{Sys.Date()}.png'))
# NOW ethtz
# Pull data
ethtz_price <- pin_get("ethtz_price", "pins_repo")
# Daily Users
ggplot(data = ethtz_price,
aes(x = as.POSIXct(date_time_utc), y = ethtz_price)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: tzkt.io API') +
# Circle max
geom_mark_ellipse(aes(filter = ethtz_price == max(ethtz_price),
label = date_time_utc,
description = paste0('Max price - ', ethtz_price))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = ethtz_price == min(ethtz_price),
label = date_time_utc,
description = paste0('Min price - ', ethtz_price))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Price ($XTZ)') +
ggtitle(paste('Price of ETHtz ($XTZ)'))
# Save chart as image
ggsave('ethtz_price.png')
# Also archive
#ggsave(glue('archive/ethtz_price/ethtz_price_{Sys.Date()}.png'))
# NOW sDAO
# Pull data
sdao_price <- pin_get("sdao_price", "pins_repo")
# Daily Users
ggplot(data = sdao_price,
aes(x = as.POSIXct(date_time_utc), y = sdao_price)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: tzkt.io API') +
# Circle max
geom_mark_ellipse(aes(filter = sdao_price == max(sdao_price),
label = date_time_utc,
description = paste0('Max price - ', sdao_price))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = sdao_price == min(sdao_price),
label = date_time_utc,
description = paste0('Min price - ', sdao_price))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Price ($XTZ)') +
ggtitle(paste('Price of SDAO ($XTZ)'))
# Save chart as image
ggsave('sdao_price.png')
# Also archive
#ggsave(glue('archive/sdao_price/sdao_price_{Sys.Date()}.png'))
# NOW RSAL
# Pull data
rsal_price <- pin_get("rsal_price", "pins_repo")
# Daily Users
ggplot(data = rsal_price,
aes(x = as.POSIXct(date_time_utc), y = rsal_price)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: tzkt.io API') +
# Circle max
geom_mark_ellipse(aes(filter = rsal_price == max(rsal_price),
label = date_time_utc,
description = paste0('Max price - ', rsal_price))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = rsal_price == min(rsal_price),
label = date_time_utc,
description = paste0('Min price - ', rsal_price))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Price ($XTZ)') +
ggtitle(paste('Price of RSAL ($XTZ)'))
# Save chart as image
ggsave('rsal_price.png')
# Also archive
#ggsave(glue('archive/rsal_price/rsal_price_{Sys.Date()}.png'))
# NOW TZ10X
# Pull data
tz10x_price <- pin_get("tz10x_price", "pins_repo")
# Daily Users
ggplot(data = tz10x_price,
aes(x = as.POSIXct(date_time_utc), y = tz10x_price)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: tzkt.io API') +
# Circle max
geom_mark_ellipse(aes(filter = tz10x_price == max(tz10x_price),
label = date_time_utc,
description = paste0('Max price - ', tz10x_price))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = tz10x_price == min(tz10x_price),
label = date_time_utc,
description = paste0('Min price - ', tz10x_price))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Price ($XTZ)') +
ggtitle(paste('Price of TZ10X ($XTZ)'))
# Save chart as image
ggsave('tz10x_price.png')
# Also archive
#ggsave(glue('archive/tz10x_price/tz10x_price_{Sys.Date()}.png'))
# NOW bDAO
# Pull data
bdao_price <- pin_get("bdao_price", "pins_repo")
# Daily Users
ggplot(data = bdao_price,
aes(x = as.POSIXct(date_time_utc), y = bdao_price)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(stats_hicetnunc$date_time_utc), ' - UTC'),
caption='Data source: tzkt.io API') +
# Circle max
geom_mark_ellipse(aes(filter = bdao_price == max(bdao_price),
label = date_time_utc,
description = paste0('Max price - ', bdao_price))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = bdao_price == min(bdao_price),
label = date_time_utc,
description = paste0('Min price - ', bdao_price))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Price ($XTZ)') +
ggtitle(paste('Price of bDAO ($XTZ)'))
# Save chart as image
ggsave('bdao_price.png')
# Also archive
#ggsave(glue('archive/bdao_price/bdao_price_{Sys.Date()}.png'))
# NOW PLENTY
# Pull data
plenty_price <- pin_get("plenty_price", "pins_repo")
# Daily Users
ggplot(data = plenty_price,
aes(x = as.POSIXct(date_time_utc), y = PLENTY_price)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(plenty_price$date_time_utc), ' - UTC'),
caption='Data source: tzkt.io API') +
# Circle max
geom_mark_ellipse(aes(filter = PLENTY_price == max(PLENTY_price),
label = date_time_utc,
description = paste0('Max price - ', PLENTY_price))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = PLENTY_price == min(PLENTY_price),
label = date_time_utc,
description = paste0('Min price - ', PLENTY_price))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Price ($XTZ)') +
ggtitle(paste('Price of PLENTY ($XTZ)'))
# Save chart as image
ggsave('plenty_price.png')
# Also archive
#ggsave(glue('archive/plenty_price/plenty_price_{Sys.Date()}.png'))
# NOW FLAME
# Pull data
flame_price <- pin_get("flame_price", "pins_repo")
# Daily Users
ggplot(data = flame_price,
aes(x = as.POSIXct(date_time_utc), y = flame_price)) +
geom_line(size=1.2) +
geom_point(size=2, color='dark green') +
labs(subtitle=paste('Latest data collected on:', max(flame_price$date_time_utc), ' - UTC'),
caption='Data source: tzkt.io API') +
# Circle max
geom_mark_ellipse(aes(filter = flame_price == max(flame_price),
label = date_time_utc,
description = paste0('Max price - ', flame_price))) +
# Now the same to circle the minimum:
geom_mark_ellipse(aes(filter = flame_price == min(flame_price),
label = date_time_utc,
description = paste0('Min price - ', flame_price))) +
theme_solarized() +
scale_x_datetime('Date Time Collected (UTC)',date_labels = "%m/%d/%y") +
scale_y_continuous('Price ($XTZ)') +
ggtitle(paste('Price of FLAME ($XTZ)'))
# Save chart as image
ggsave('flame_price.png')
# Also archive
#ggsave(glue('archive/flame_price/flame_price_{Sys.Date()}.png'))
# hDAO Distribution
hdao_holders <- pin_get("hdao_holders", "pins_repo")
# Take screenshot of top holders
png("hdao_top_holders.png")
p <- tableGrob(head(select(hdao_holders, address, hdao_value, percent_of_supply),20))
grid.arrange(top = paste("Top hDAO Holders -",max(hdao_holders$date, na.rm=T)), p)
dev.off()
# Archive
#png("archive/hdao_supply/hdao_top_holders.png")
#p <- tableGrob(head(select(hdao_holders, address, hdao_value, percent_of_supply),20))
#grid.arrange(top = paste("Top hDAO Holders -",max(hdao_holders$date, na.rm=T)), p)
#dev.off()
# TODO - add charts from incorrect smart contract as free ones!