Published
Edited
Dec 6, 2021
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
treasuryBalanceInt = Number.parseInt(treasuryBalance2.replaceAll(/[,$]/g, '')) +
promisedProtocolLabsFundsUSD
Insert cell
grainsPerDollar = treasuryBalanceInt
? outstandingGrains.map(x => G.divideFloat(x, treasuryBalanceInt))
: null
Insert cell
grainPrices = grainsPerDollar
? grainsPerDollar.map(x => G.toFloatRatio(G.ONE, x))
: null
Insert cell
outstandingGrains = [0, 1, 2, 3, 4, 5].map(x =>
G.add(G.multiplyFloat(G.fromInteger(25000), x), outstandingGrain)
)
Insert cell
outstandingGrain = G.sum(
ledger
.accounts()
.filter(
x =>
!["sourcecred", "protocol", "decentralion", "onchain-sink"].includes(
x.identity.name
)
)
.map(x => x.balance)
)
Insert cell
ledger = loadLedger("sourcecred/cred/main")
Insert cell
import { sc, loadLedger, G, spacer } from "@sourcecred/quick-imports"
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