Published
Edited
Jul 6, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
hash = "f715bb83132b212a3cd79ad49d616c295dc5eb36"
Insert cell
last_week_hash="bba8eca07f2137668623133f17a0ac9d7a126992"
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
balance = aliasMap(a => {
return pastPayout.get(a) + fastPayout.get(a) + slowPayout.get(a);
})
Insert cell
Insert cell
Insert cell
Insert cell
project_data_file = "https://raw.githubusercontent.com/MetaFam/TheSource/master/project.json"
Insert cell
identities = (await (await fetch(project_data_file)).json())[1].identities
Insert cell
address_book_file = "https://raw.githubusercontent.com/MetaFam/TheSource/master/addressbook.json"
Insert cell
address_book = (await (await fetch(address_book_file)).json());
Insert cell
seedsToMint = address_book.map(a => {
const identity = identities.find(i => i.aliases.indexOf(`discord/${a.discordId}`) > 0);
if (!identity) return;
const username = `sourcecred/@${identity.username}`;
let seed = fastPayout.get(username) + slowPayout.get(username);
const res = [username, a.address, seed];
return res;
}).filter(Boolean)
Insert cell
seedsCSV = seedsToMint.map((infoArray, index) => {
return infoArray.join(",");
}).join("\n")
Insert cell
DOM.download(() => {
return new Blob([seedsCSV], {type: "text/csv"})
}, "seedsToMint.csv", "Save Seeds To Mint")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
users = {
const aliases = new Set(scores.users);
return Array.from(aliases);
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
totalProportion = aliasMap((a) => totalCred.get(a) / sumTotalCred)
Insert cell
totalCred = aliasMap((a) => d3.sum(intervalCred.has(a) ? intervalCred.get(a).slice(0,last_week_idx+1) : 0))
Insert cell
Insert cell
sumTotalCred = d3.sum(Array.from(totalCred.values()))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
MIN_ACTIVE_CONTRIB_XP = 20
Insert cell
SEED_PER_WEEK_PER_CONTRIB = 50
Insert cell
activeContributors = scores.intervals.map((interval, i) => {
const contribs = scores.users.reduce(
(acc, user) => user.intervalCred[i] >= MIN_ACTIVE_CONTRIB_XP ? acc.concat(addressToAlias(user.address)) : acc,
[],
);
return contribs;
}
)
Insert cell
seedPerInterval = activeContributors.map(contribs => SEED_PER_WEEK_PER_CONTRIB * (contribs.length + 1))
Insert cell
totalSeed = d3.sum(seedPerInterval)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
percentFormat = d3.format(".1%")
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more