-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathscoring-summary.Rmd
39 lines (39 loc) · 1.63 KB
/
scoring-summary.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
---
output:
md_document:
variant: gfm
---
```{r setup, include=FALSE}
if (length(commandArgs(trailingOnly=TRUE)) > 0) {
args <- commandArgs(trailingOnly=TRUE)
}
validators <- read.csv(args[1])
```
# Scoring results `r args[2]`
```{r, echo=FALSE}
library(knitr)
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("Stake type", "Stake (SOL)", "Validators", "Stake-weighted performance"))
```