Public
Edited
Jun 28, 2024
Fork of All Markets
Insert cell
Insert cell
kalshi = FileAttachment("kalshi-markets.0b58f60f.json").json()
Insert cell
filterTickers = (tickers) => {
const regexPattern = /^FED-\d{2}[A-Z]{3}-T\d+\.\d+$/;
return tickers.filter((ticker) => regexPattern.test(ticker.Market));
}

Insert cell
data = filterTickers(kalshi).filter(
(d) => d.Status === "active" && d.Volume > 0
)

Insert cell
Insert cell
function sparkbar(max) {
return (x) => htl.html`<div style="
background: var(--theme-blue);
color: black;
font: 10px/1.6 var(--sans-serif);
width: ${(100 * x) / max}%;
float: right;
padding-right: 3px;
box-sizing: border-box;
overflow: visible;
display: flex;
justify-content: end;">${x.toLocaleString("en-US")}`;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
decRates = Plot.plot({
marks: [
Plot.barY(binnedRates[12], {
x: "rate",
y: "probability",
sort: { x: "y", reverse: true }
}),
Plot.ruleY([0])
]
})
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