Public
Edited
Dec 22, 2022
1 fork
Importers
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
allBids.filter(bid => bid.bidder.id === "0xb6c5b1a489606028da263eda28063186f96fa921")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
plotableSeedDistributions.background
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
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
decay = (factor) => (acc, value) => factor * value + (1 - factor) * acc
Insert cell
nocMoveFactory = (factor) => (data) =>
data.reduce(
(acc, auction) => {
acc.moving = decay(factor)(acc.moving, auction.settleTimeSec);
acc.auctions.push({
...auction,
[`noc${factor}`]: acc.moving
});
return acc;
},
{ moving: 0, auctions: [] }
).auctions
Insert cell
projections = [0.2, 0.3, 0.7, 0.6, 0.5, 0.95, 0.999]
Insert cell
decayedData = projections.reduce(
(acc, proj) => nocMoveFactory(proj)(acc),
auctionData.slice(-40, -2)
)
Insert cell
prediction = (attribute) => {
const last = decayedData[decayedData.length - 1];
return R.range(last.id, 570).map((id, i) => ({
id,
endTime: new Date(
(Number(last["endTime"]) +
last["settleTimeSec"] +
i * last[attribute] +
24 * 60 * 60 * i) *
1000
)
}));
}
Insert cell
predicted = projections
.map((p) => `noc${p}`)
.reduce((acc, attribute) => {
acc[attribute] = prediction(attribute);
return acc;
}, {})
Insert cell
Plot.plot({
marks: [
Plot.ruleY([0]),
Plot.lineY(decayedData, Plot.windowY({ x: "id", y: "noc0.2", k: 10 })),
Plot.lineY(decayedData, Plot.windowY({ x: "id", y: "noc0.7", k: 10 })),
Plot.lineY(decayedData, Plot.windowY({ x: "id", y: "noc0.95", k: 10 })),
Plot.lineY(decayedData, Plot.windowY({ x: "id", y: "noc0.999", k: 10 })),
Plot.lineY(
auctionData,
Plot.windowY({
x: "id",
y: "settleTimeSec",
k: 10,
reduce: "mean",
color: "red"
})
)
]
})
Insert cell
predictionHms = (p) =>
(p.endTime.getHours() + 2) * 100 + (p.endTime.getMinutes() / 60) * 100
Insert cell
Plot.plot({
y: {
// domain: [
// new Date(),
// predicted[Object.keys(predicted)[0]].reverse()[0].endTime
// ]
domain: [1800, 2400]
},
marks: [
Plot.ruleY([0]),
Plot.lineY(predicted["noc0.6"], { x: "id", y: predictionHms }),
Plot.lineY(predicted["noc0.7"], { x: "id", y: predictionHms }),
Plot.lineY(predicted["noc0.5"], { x: "id", y: predictionHms }),
Plot.lineY(predicted["noc0.95"], { x: "id", y: predictionHms })
]
})
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
auctionData.filter(auction => moment(Number(auction.startDate)).hour() === 13)
Insert cell
auctionData.map(auction => moment(Number(auction.startTime)).hour())[287]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
bidderParticipation.filter(bidder => bidder.bidder.indexOf("667") > -1)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
probability(41)
Insert cell
probability = n => 1 - Math.pow((234 - 1/234), n)
Insert cell
Insert cell
fetchAuctions = async (skip) => ((await axios.post(SUBGRAPH_URL, {query: AUCTIONS_QUERY(skip)})).data.data.auctions)
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
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
Insert cell
MULTIPLES = [
"once",
"twice",
"three times",
"four times",
"five times",
"six times",
"seven times"
]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
AUCTIONS_QUERY = (skip = 0) => `
{
auctions (first: 1000) {
id
startTime
endTime
settled
bids {
id
amount
txIndex
blockNumber
blockTimestamp
bidder {
id
}
}
noun {
id
seed {
background
body
accessory
head
glasses
}
owner {
id
}
}
}
}
`
Insert cell
Insert cell
Insert cell
Insert cell
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