Manifold Markets: A market for every question
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Phil c762869b83
Migrate prod bot (#1052)
2 years ago
.github Action to merge main into main2 automatically 2 years ago
.vscode add tailwind to recommended vscode extensions 2 years ago
common Migrate prod bot (#1052) 2 years ago
docs Document the new /comment endpoint 2 years ago
functions Tipping in posts (#1045) 2 years ago
og-image Remove spaces in hashtags & line clamp metadata 2 years ago
web New component to add arbitrary (but static) react embeds to posts programatically + midterms component (#1051) 2 years ago
.firebaserc Allow admins to see private-users info 2 years ago
.gitignore add tailwind to recommended vscode extensions 2 years ago
.prettierrc move prettier config to top level 2 years ago Choose MIT license 2 years ago Mention /docs package in README 2 years ago Allow to follow/unfollow markets, backfill as well (#794) 2 years ago
firebase.json [WIP] Fully customizable notifications (#860) 2 years ago
firestore.indexes.json Move comment-bet association code into comment creation trigger (#899) 2 years ago
firestore.rules Add flaggedByUsernames to firestore rules 2 years ago
package.json Small add-on React 18 fixes (#1004) 2 years ago
yarn.lock Update stability-client to fix /dream 2 years ago

Manifold Markets

This monorepo has basically everything involved in running and operating Manifold.

Getting started

  1. Make sure you have Yarn 1.x
  2. $ cd web
  3. $ yarn
  4. $ yarn dev:dev
  5. Your site will be available on http://localhost:3000

See web/ for more details on hacking on the web client.

General architecture

Manifold's public API and web app are hosted by Vercel. In general, the web app runs as much as possible on the client; we follow a JAMStack architecture. All data is stored in Firebase's database, Cloud Firestore. This is directly accessed by the client for most data access operations.

Operations with complicated contracts (e.g. buying shares) are provided in a separate HTTP API using Firebase's Cloud Functions. Those are deployed separately from the Vercel website; see functions/ for more details.

Directory overview

  • web/: UI and business logic for the client. Where most of the site lives. The public API endpoints are also in here.

  • functions/: Firebase cloud functions, for secure work (e.g. balances, Stripe payments, emails). Also contains in functions/src/scripts/ some Typescript scripts that do ad hoc CLI interaction with Firebase.

  • common/: Typescript library code shared between web/ & functions/. If you want to look at how the market math works, most of that's in here (it gets called from the placeBet and sellBet endpoints in functions/.) Also contains in common/envs configuration for the different environments (i.e. prod, dev, Manifold for Teams instances.)

  • og-image/: The OpenGraph image generator; creates the preview images shown on Twitter/social media.

  • docs/: Manifold's public documentation that lives at


Since we are just now open-sourcing things, we will see how things go. Feel free to open issues, submit PRs, and chat about the process on Discord. We would prefer small PRs that we can effectively evaluate and review -- maybe check in with us first if you are thinking to work on a big change.

By contributing to this codebase, you are agreeing to the terms of the Manifold CLA.

If you need additional access to any infrastructure in order to work on something (e.g. Vercel, Firebase) let us know about that on Discord as well.