-
Notifications
You must be signed in to change notification settings - Fork 3
/
scoring-report.Rmd
158 lines (134 loc) · 5.67 KB
/
scoring-report.Rmd
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
---
pagetitle: Marinade Scoring Report
output:
html_document
---
```{r setup, include=FALSE}
if (length(commandArgs(trailingOnly=TRUE)) > 0) {
args <- commandArgs(trailingOnly=TRUE)
}
validators <- read.csv(args[1])
library(knitr)
library(ggplot2)
library(treemapify)
library(dplyr)
knit_hooks$set(inline = function(x) {
prettyNum(x, big.mark=",")
})
```
# Marinade Scoring Report `r args[2]`
## Overview
```{r, echo=FALSE}
df <- data.frame(type = c("Performance-based stake", "veMNDE directed stake", "mSOL directed stake", "", "**Total stake**"),
stake = c(
sum(validators$target_stake_algo),
sum(validators$target_stake_vemnde),
sum(validators$target_stake_msol),
"",
sum(validators$target_stake)
),
validators = c(
sum(validators$target_stake_algo > 0),
sum(validators$target_stake_vemnde > 0),
sum(validators$target_stake_msol > 0),
"",
sum(validators$target_stake > 0)
),
perf = c(
round(sum(validators$avg_adjusted_credits * validators$target_stake_algo) / sum(validators$target_stake_algo)),
round(sum(validators$avg_adjusted_credits * validators$target_stake_vemnde) / sum(validators$target_stake_vemnde)),
round(sum(validators$avg_adjusted_credits * validators$target_stake_msol) / sum(validators$target_stake_msol)),
"",
round(sum(validators$avg_adjusted_credits * validators$target_stake) / sum(validators$target_stake))
)
)
kable(df, col.names = c("Delegation strategy", "Stake (SOL)", "Validators", "Stake-weighted performance"), align = "r")
```
The plot below shows the voting performance of all validators in Solana. Purple lines denote validators who are supposed to receive any stake from Marinade.
```{r, echo=FALSE, fig.align="center", fig.width = 10}
df <- validators[validators$avg_adjusted_credits > 0,]
df$x <- factor(df$vote_account, levels = df$vote_account[order(-df$avg_adjusted_credits)])
df$fill <- ifelse(df$target_stake > 0, "purple", "gray")
ggplot(df, aes(x=df$x, y=df$avg_adjusted_credits)) +
geom_bar(stat = "identity", width = 1, colour = "transparent", fill = df$fill) +
ylim(0, 432000) +
labs(title="Validators' voting performance", x = "Validators", y = "Average commission adjusted vote credits") +
scale_x_discrete(labels = NULL) +
theme_minimal()
```
The plots below show validators and their scores as calculated by the Delegation Strategy. The plot (A) shows which validators were picked by the performance-based scoring formula. The plot (B) shows which validators were picked by VeMNDE votes.
```{r, echo=FALSE, fig.align="center", fig.width = 10}
df <- validators
df$x <- factor(df$vote_account, levels = df$vote_account[order(-df$score)])
df$fill_algo <- ifelse(df$target_stake_algo > 0, "purple", "gray")
df$fill_vemnde <- ifelse(df$target_stake_vemnde > 0, "purple", "gray")
plot1 <- ggplot(df, aes(x=x, y=score)) +
geom_bar(stat = "identity", width = 1, colour = "transparent", fill = df$fill_algo) +
ylim(0, 1) +
labs(title="Validators picked by their performance", x = "Validators", y = "Score", tag = "A") +
scale_x_discrete(labels = NULL) +
theme_minimal()
plot2 <- ggplot(df, aes(x=x, y=score)) +
geom_bar(stat = "identity", width = 1, colour = "transparent", fill = df$fill_vemnde) +
ylim(0, 1) +
labs(title="veMNDE voted validators", x = "Validators", y = "Score", tag = "B") +
scale_x_discrete(labels = NULL) +
theme_minimal()
gridExtra::grid.arrange(plot1, plot2, ncol=2)
```
## Stake distribution in data centers
The plots in this section show how Marinade plans to distribute the stake between different data centers and how stake is distributed in the whole Solana cluster.
```{r, echo=FALSE, fig.align="center", fig.width = 10}
df <- validators %>%
group_by(dc_aso) %>%
summarize(stake = sum(target_stake_algo))
df$pct <- round(df$stake / sum(df$stake) * 100, digits = 2)
# Create a treemap
ggplot(df, aes(
area = stake,
fill = dc_aso,
label = paste(dc_aso, stake, paste(pct, "%"), sep = "\n"))
) +
geom_treemap() +
geom_treemap_text(colour = "white",
place = "centre",
size = 15) +
theme(legend.position = "none") +
labs(title = "Performance-based part of Marinade stake by ASO")
```
```{r, echo=FALSE, fig.align="center", fig.width = 10}
df <- validators %>%
group_by(dc_aso) %>%
summarize(stake = sum(target_stake))
df$pct <- round(df$stake / sum(df$stake) * 100, digits = 2)
# Create a treemap
ggplot(df, aes(
area = stake,
fill = dc_aso,
label = paste(dc_aso, stake, paste(pct, "%"), sep = "\n"))
) +
geom_treemap() +
geom_treemap_text(colour = "white",
place = "centre",
size = 15) +
theme(legend.position = "none") +
labs(title = "Total planned Marinade stake by ASO")
```
```{r, echo=FALSE, fig.align="center", fig.width = 10}
df <- validators %>%
group_by(dc_aso) %>%
summarize(stake = sum(avg_stake))
df$pct <- round(df$stake / sum(df$stake) * 100, digits = 2)
# Create a treemap
ggplot(df, aes(
area = stake,
fill = dc_aso,
label = paste(dc_aso, stake, paste(pct, "%"), sep = "\n"))
) +
geom_treemap() +
geom_treemap_text(colour = "white",
place = "centre",
size = 15) +
theme(legend.position = "none") +
labs(title = "Solana stake distribution by ASO")
```