Manifold Markets: A market for every question
Go to file
James Grugett f533d9bfcb
Verify balance of limit order "makers" (#1007)
* Fetch balance of users with open limit orders & cancel orders with insufficient balance

* Fix imports

* Fix bugs

* Fix a bug

* Remove redundant cast

* buttons overlaying content fix (#1005)

* buttons overlaying content fix

* stats: round DAU number

* made set width for portfolio/profit fields (#1006)

* tournaments: included resolved markets

* made delete red, moved button for regular posts (#1008)

* Fix localstorage saved user being overwritten on every page load

* Market page: Show no right panel while user loading

* Don't flash sign in button if user is loading

* election map coloring

* market group modal scroll fix (#1009)

* midterms: posititoning, make mobile friendly

* Un-daisy share buttons (#1010)

* Make embed and challenge buttons non-daisyui

* Allow link Buttons. Change tweet, dupe buttons.

* lint

* don't insert extra lines when upload photos

* Map fixes (#1011)

* usa map: fix sizing

* useSetIframeBackbroundColor

* preload contracts

* seo

* remove hook

* turn off sprig on dev

* Render timestamp only on client to prevent error of server not matching client

* Make sized container have default height so graph doesn't jump

* midterms: use null in static props

* Create common card component (#1012)

* Create common card component

* lint

* add key prop to pills

* redirect to /home after login

* create market: use transaction

* card: reduce border size

* Update groupContracts in db trigger

* Default sort to best

* Save comment sort per user rather than per contract

* Refactor Pinned Items into a reusable component

* Revert "create market: use transaction"

This reverts commit e1f24f24a9.

* Mark @v with a (Bot) label

* fix padding on daily movers

* fix type errors

* Wrap sprig init in check for window

* unindex date-docs from search engines

* Auto-prettification

* compute elasticity

* change dpm elasticity

* Fix google lighthouse issues (#1013)

* don't hide free response panel on open resolve

* liquidity sort

* Limit order trade log: '/' to 'of'. Remove 'of' in 'of YES'.

* Date doc: Toggle to disable creating a prediction market

* Listen for date doc changes

* Fix merge error

* Don't cancel all a users limit orders if they go negative

Co-authored-by: ingawei <46611122+ingawei@users.noreply.github.com>
Co-authored-by: mantikoros <sgrugett@gmail.com>
Co-authored-by: Sinclair Chen <abc.sinclair@gmail.com>
Co-authored-by: mantikoros <95266179+mantikoros@users.noreply.github.com>
Co-authored-by: Ian Philips <iansphilips@gmail.com>
Co-authored-by: Pico2x <pico2x@gmail.com>
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
Co-authored-by: sipec <sipec@users.noreply.github.com>
2022-10-06 22:16:49 -05:00
.github Set up github action to remove unused imports 2022-08-26 23:56:38 -05:00
.vscode add tailwind to recommended vscode extensions 2022-06-23 14:25:55 -05:00
common Verify balance of limit order "makers" (#1007) 2022-10-06 22:16:49 -05:00
docs Expose multiple choice answer probabilities (#939) 2022-09-29 14:17:52 -04:00
functions Verify balance of limit order "makers" (#1007) 2022-10-06 22:16:49 -05:00
og-image Remove spaces in hashtags & line clamp metadata 2022-10-04 09:14:27 -06:00
web Verify balance of limit order "makers" (#1007) 2022-10-06 22:16:49 -05:00
.firebaserc Allow admins to see private-users info 2022-01-24 00:48:10 -06:00
.gitignore add tailwind to recommended vscode extensions 2022-06-23 14:25:55 -05:00
.prettierrc move prettier config to top level 2022-01-10 17:44:42 -06:00
dev.sh Allow to follow/unfollow markets, backfill as well (#794) 2022-08-24 10:49:53 -06:00
firebase.json [WIP] Fully customizable notifications (#860) 2022-09-12 10:34:56 -06:00
firestore.indexes.json Move comment-bet association code into comment creation trigger (#899) 2022-09-20 15:25:58 -07:00
firestore.rules Allo creators to unlist markets 2022-10-03 09:26:39 -06:00
LICENSE.md Choose MIT license 2022-04-02 12:01:23 -07:00
package.json Small add-on React 18 fixes (#1004) 2022-10-05 00:23:23 -07:00
README.md Mention /docs package in README 2022-05-31 15:16:18 -07:00
yarn.lock Small add-on React 18 fixes (#1004) 2022-10-05 00:23:23 -07:00

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/README.md 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/README.md 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 https://docs.manifold.markets.

Contributing

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.