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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more