* /dream api: Upload StableDiffusion image to Firestore
* Minor tweaks
* Set content type on uploaded image
This makes it so the image doesn't auto-download when opened in a new tab
* Allow users to dream directly from within Manifold
* Remove unused import
* Implement a /comment endpoint which supports html and markdown
* Upgrade @tiptap/core to latest
* Update all tiptap deps to beta.199
* Add @tiptap/suggestion
* Import @tiptap/html in the right place
* ... add deps everywhere
So I have no idea how common deps work apparently
* Add tiptap/suggestion too
* Clean up dream
* More cleanups
* Rework /comment endpoint
* Move API to /comment
* Change imports in case that matters
* Add a couple todos
* Dynamically import micromark
* Parallellize gsutil with -m option
* Adding comments via api working, editor.tsx erroring out
* Unused import
* Remove disabled state from useTextEditor
Co-authored-by: Ian Philips <iansphilips@gmail.com>
* Tweak limit order UI and fix button
* Style all follow/unfollow buttons blue
also get rid of highlight-blue button
* remove all other uses of 'btn'
* Style group follow button like user follow
* lint and format
* Fix freezing when typing big docs
* Make rich text fields autosave to localstorage
* Add autosave for comments
* delete vestigial text editor from challenges
* Clear autosave on submit post/market/comment
* lint
* Award badges for market creation, betting streaks, proven correct
* Styling
* Add minimum unique bettors for proven correct
* Add name, refactor
* Add notifications for badge awards
* Correct styling
* Need at least 3 unique bettors for market maker badge
* Lint
* Switch to badges_awarded
* Don't include n/a resolutions in market creator badge
* Add badges by rarities to profile
* Show badges on profile, soon on market page
* Add achievements to new user
* Backfill all users badges
* Call updatemetrics v2 cloud function from scheduled function
* Set limits on bets and contracts loaded for portfolio page. Show warning if limit is hit
* mqp review: Use console.error if !response.ok
* 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>
* Fix chart `onMouseOver` propagation
* Make generic charts support money on y-axis
* Fix somewhat ridiculous `formatMoney` to work with negative amounts
* Make margins on charts configurable
* Implement color as function of point on SingleValueHistoryChart
* Rewrite portfolio history graphs with new graph machinery
* Toast Nivo
* Make curve configurable on generic charts
* Extract SizedContainer helper component
* Use new charts for stats page
* Move analytics charts component
* Fix up start date logic for graphs excluding data
* Fix embed style (adjust input, strikethrough)
* Turn small embeds into contract cards
* Use media query instead of conditional render
* Open embed card clicks in new tab
* Use objects instead of tuples for chart data
* Carry bet data down into charts
* Refactor to invert control of chart tooltip display
* Jazz up the chart tooltips with avatars
* Tidying
* Fiddle around with everything, WIP FR charts
* Implement numeric chart
* Reorganize everything into neat little files
* Add `AreaWithTopStroke` helper
* Tidying, don't gratuitously use d3.format
* Remove duplicate code
* Better tooltip bisection
* `NumericPoint` -> `DistributionPoint`
* Add numeric market tooltip
* Make numeric chart bucket points less wrong
* Clean up numeric bucket computation
* Clean up a bunch of tooltip stuff, add FR legend tooltips
* Fix a dumb bug
* Implement basic time selection
* Fix fishy Date.now inconsistency bugs
* Might as well show all the FR outcomes now
* Make tooltips accurate on curveStepAfter charts
* Make log scale PN charts work properly
* Adjust x-axis tick count
* Display tooltip on charts only for mouse
* Fix up deps
* Tighter chart tooltips
* Adjustments to chart time range management
* Better date formatting
* Continue tweaking time selection handling to be perfect
* Make FR charts taller by default
* Date docs
* Create date doc
* Create and show a date market as well
* Move url to date-docs
* Date doc individual page
* Add share button
* Edit date docs
* Layout
* Add comments for create-post
* Add comments and back nav
* Fix urls
* Tweaks
* show position, expected value, profit instead of "invested"
* move bet summary outside trades on market page
* refactor
* pass in userbets
* hide only if no bets; show invested on desktop
* various
* Stats computing correctly
* Styles propagating - testing in prod now
* Formatting html
* Reset portfolio flag on mondays at 12am
* Add profit, styling
* More styling, less reports
* Cleanup
* Comments
* comment
* Try to send higher signal emails
* Send emails to proper email address
* Memoize calculating sale amount on your bets list
* Don't re-render more than necessary with `useIsMobile` hook
* Use `useIsMobile` hook in `AmountInput`
* Add dailyScore: product of unique bettors (3 days) and probChanges.day
* Increase memory and duration of scoreContracts
* Home: Smaller prob change card for groups. Use dailyScore for sort order (algolia)
* Add back hover
* Move comments and tips fetching down into comments tab rendering
* Consolidate `contract-activity.tsx` into `contract-tabs.tsx`
* Move LP fetching into bets tab
* don't show welcome dialog for twitch users
* handle sign up race conditions with more hooks
* content organization and copy tweaks
* lint
* fix import
* fix https
* add beasts
* Remove extra file
* Prettier-ify code
* Prettier-ify
* add basic land guesser
also added fetcher to filter all cards instead of only unique art
* default to original
makes basic better
* added set symbol to basics
added set symbol to the basics game mode. Changed name to "How Basic"
* cleanup
* changed some pixels
* only load set data if needed
* hacked fix for removing image from name
* removed check from original
* remove check from original
* sort names by set instead of by set symbol
* include battlebond
* update cards for categories
update for dominaria united
* added commander category
commander category
* update basic land art
* can use double feature
* removing racist cards upstream
this way we don't have to store the cards in the json
* remove generated cards from digital commanders
* fix counterspell setting default
* added difficulty rating
* updated padding
* add dfc support for commanders
* add artists
* use latest non-digital if possible
* change vsCode settings for python
* update with latest non-digital printing
* update artist list
* update algo to select k samples
* cleanup code
* equally weight artists
* weight everything equally
* updated for all artists
* update artists
* add allowlist
* update artists to min 50 art
* allow promo to be replaced
* update jsons
* update with min 100 arts
* update code to be smaller jsons
* updated to 18 artists per game
* update ui
* update importing artists
* update to 21
* move num artists to top of js file
* update artistList to not include artist sigs
* update to 50 artists
* update for ub
* update artist list
* update ub defaults
* update jsons
* allow non-english cards to be replaced
* update allowlist
* update jsons
* add watermark
* update jsons
* update jsons
* make jsons slightly smaller
* add checkmarks and x's
* remove python
* add no answer and checkbox and x
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
* Factor out section header
* Remove daily balance change
* Remove dead code
* Layout, add streak
* Fix visibility observer to work on server
* Tweak
* Search perserved by url
* Add pill query param
* Add search page
* Extract component for ProbChangeRow
* Explore groups page
* Add search row
* Add trending groups section
* Add unfollow option for group
* Experimental home: accommodate old saved sections.
* Tweaks to search layout
* Rearrange layout
* Daily movers page
* Add streak grayed out indicator
* Use firebase query instead of algolia search for groups
* Replace trending group card with pills
* Hide streak if you turned off that notification
* Listen for group updates
* Better UI for adding / removing groups
* Toast feedback for join/leave group. Customize button moved to bottom.
* Remove Home title
* Refactor arrange home
* Add new for you section
* Add prefetch
* Move home out of experimental!
* Remove unused import
* Show non-public markets from group
* Bot linking button functional.
* Implemented initial prototype of new Twitch signup page.
* Removed old Twitch signup page.
* Moved new Twitch page to correct URL.
* Twitch account linking functional.
* Fixed charity link.
* Changed to point to live bot server.
* Slightly improve spacing and alignment on Twitch page
* Tidy up, handle some errors when talking to bot
* Seriously do the thing where Twitch link is hidden by default
* Fixed secondary Get Started button. Copy overlay and dock link now functional.
* Add/remove bot from channel working.
* Removed legacy Twitch controls from user profile.
* Links provided by dock/overlay buttons are now correct.
* Minor profile cleanup post merge.
* Fixed unnecessary relinking Twitch account when logging in on Twitch page.
* Added confirmation popup to refresh API key. Refreshing API key now requires a user to relink their Twitch account.
* Removed legacy twitch-panel.tsx
Co-authored-by: Marshall Polaris <marshall@pol.rs>
* Move tabs to sidebar
* Address all feedback
Fix icon names
Extract navbar component into a separate function
Rm arrow and indentation
Move group name under logo
Fix visual sidebar stretchy thing
Fix visual bug
* Extra nits
* Bot linking button functional.
* Implemented initial prototype of new Twitch signup page.
* Removed old Twitch signup page.
* Moved new Twitch page to correct URL.
* Twitch account linking functional.
* Fixed charity link.
* Changed to point to live bot server.
* Slightly improve spacing and alignment on Twitch page
* Tidy up, handle some errors when talking to bot
* Seriously do the thing where Twitch link is hidden by default
Co-authored-by: Marshall Polaris <marshall@pol.rs>
* Revert "Revert "Use %mention to embed a contract card in rich text editor (#869)""
This reverts commit e0634cea6d.
* Overwrite name to prevent breakages
* Fix '%' mentioning if you escape out
* Cleanup: merge render functions
* Bring up a list of contracts with @
* Fix hot reload for RichContent
* Render contracts as half-size cards
* Use % as the prompt; allow for spaces
* WIP: When there's no matching question, create a new contract
* Revert "WIP: When there's no matching question, create a new contract"
This reverts commit efae1bf715.
* Rename to contract-mention
* WIP: Try to merge in @ and % side by side
* Add a different pluginKey
* Track the prosemirror-state dep
* twitch account linking; profile page twitch panel; twitch landing page
* fix import
* twitch logo
* save twitch credentials cloud function
* use user id instead of bot id, add manifold api endpoint
* properly add function to index
* Added support for new redirect Twitch auth.
* Added clean error handling in case of Twitch link fail.
* remove simulator
* Removed legacy non-redirect Twitch auth code. Added "add bot to channel" button in user profile and relevant data to user type.
* Removed unnecessary imports.
* Fixed line endings.
* Allow users to modify private user twitchInfo firestore object
* Local dev on savetwitchcredentials function
Co-authored-by: Phil <phil.bladen@gmail.com>
Co-authored-by: Marshall Polaris <marshall@pol.rs>
* Denormalize user display fields onto bets
* Make bet denormalization script fast enough to run it on prod
* Make `placeBet`/`sellShares` immediately post denormalized info
* Factor out section header
* Remove daily balance change
* Remove dead code
* Layout, add streak
* Fix visibility observer to work on server
* Tweak
* Formatting
* Line clamp question in prob change table
* Tweaks
* Expand option for daily movers
* Snap scrolling for carousel
* Add arrows to section headers
* Remove carousel from experimental/home
* React querify fetching your groups
* Edit home is its own page
* Add daily profit and balance
* Merge branch 'main' into new-home
* Make experimental search by your followed groups/creators
* Just submit, allow xs on pills
* Weigh in
* Use next/future/image component to optimize avatar images
* Inga/challenge icon (#857)
* changed challenge icon to custom icon
* fixed tip button alignment
* weighing in and trading "weigh in" for "trade"
* Delete closing soon, mark new as New for you, trending is site-wide
* Delete your trades. Factor out section item
* Don't allow hiding of home sections
* Convert daily movers into a section
* Tweaks for loading daily movers
* Prob change table shows variable number of rows
* Fix double negative
Co-authored-by: Ian Philips <iansphilips@gmail.com>
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
Co-authored-by: ingawei <46611122+ingawei@users.noreply.github.com>
Co-authored-by: mantikoros <sgrugett@gmail.com>
* Adds investmentValue to group leaderboard calculation
* Initial investment is no longer counted, only the profit
* Simplify scoring calculation
* Remove console.log
* Group bets by user first
Co-authored-by: James Grugett <jahooma@gmail.com>
* fix https
* add beasts
* Remove extra file
* Prettier-ify code
* Prettier-ify
* add basic land guesser
also added fetcher to filter all cards instead of only unique art
* default to original
makes basic better
* added set symbol to basics
added set symbol to the basics game mode. Changed name to "How Basic"
* cleanup
* changed some pixels
* only load set data if needed
* hacked fix for removing image from name
* removed check from original
* remove check from original
* sort names by set instead of by set symbol
* include battlebond
* update cards for categories
update for dominaria united
* added commander category
commander category
* update basic land art
* can use double feature
* removing racist cards upstream
this way we don't have to store the cards in the json
* remove generated cards from digital commanders
* fix counterspell setting default
* added difficulty rating
* updated padding
* add dfc support for commanders
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
* Submit comments on ctrl/cmd-enter
* Remove unused import
* Tweak padding on /tournaments
* Always submit on ctrl+enter
Since we took out group chats, this should be fine for all comments
* fix https
* add beasts
* Remove extra file
* Prettier-ify code
* Prettier-ify
* add basic land guesser
also added fetcher to filter all cards instead of only unique art
* default to original
makes basic better
* added set symbol to basics
added set symbol to the basics game mode. Changed name to "How Basic"
* cleanup
* changed some pixels
* only load set data if needed
* hacked fix for removing image from name
* removed check from original
* remove check from original
* sort names by set instead of by set symbol
* include battlebond
* update cards for categories
update for dominaria united
* added commander category
commander category
* update basic land art
* can use double feature
* removing racist cards upstream
this way we don't have to store the cards in the json
* remove generated cards from digital commanders
* fix counterspell setting default
* added difficulty rating
* updated padding
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
* fix https
* add beasts
* Remove extra file
* Prettier-ify code
* Prettier-ify
* add basic land guesser
also added fetcher to filter all cards instead of only unique art
* default to original
makes basic better
* added set symbol to basics
added set symbol to the basics game mode. Changed name to "How Basic"
* cleanup
* changed some pixels
* only load set data if needed
* hacked fix for removing image from name
* removed check from original
* remove check from original
* sort names by set instead of by set symbol
* include battlebond
* update cards for categories
update for dominaria united
* added commander category
commander category
* update basic land art
* can use double feature
* removing racist cards upstream
this way we don't have to store the cards in the json
* remove generated cards from digital commanders
* fix counterspell setting default
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
* fix https
* add beasts
* Remove extra file
* Prettier-ify code
* Prettier-ify
* add basic land guesser
also added fetcher to filter all cards instead of only unique art
* default to original
makes basic better
* added set symbol to basics
added set symbol to the basics game mode. Changed name to "How Basic"
* cleanup
* changed some pixels
* only load set data if needed
* hacked fix for removing image from name
* removed check from original
* remove check from original
* sort names by set instead of by set symbol
* include battlebond
* update cards for categories
update for dominaria united
* added commander category
commander category
* update basic land art
* can use double feature
* removing racist cards upstream
this way we don't have to store the cards in the json
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
* Line clamp question in prob change table
* Tweaks
* Expand option for daily movers
* Snap scrolling for carousel
* Add arrows to section headers
* Remove carousel from experimental/home
* React querify fetching your groups
* Edit home is its own page
* Add daily profit and balance
* Merge branch 'main' into new-home
* Make experimental search by your followed groups/creators
* Just submit, allow xs on pills
* Weigh in
* Use next/future/image component to optimize avatar images
* Inga/challenge icon (#857)
* changed challenge icon to custom icon
* fixed tip button alignment
* weighing in and trading "weigh in" for "trade"
Co-authored-by: Ian Philips <iansphilips@gmail.com>
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
Co-authored-by: ingawei <46611122+ingawei@users.noreply.github.com>
Co-authored-by: mantikoros <sgrugett@gmail.com>
* Toggle monthly leaderboards
I didn't get to enabling monthly leaderboards after my work trial was over (I enabled daily/weekly/alltime). The cache has been filled out for a while now, this toggles it on.
* Fix nits
* Make tournament page efficient
* Fix URL to Salem contract
* Use totalMembers instead of deprecated field
* Increase page size to 12
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
* Handle the case where a user is surprisingly not in the DB
* Only set referral info on user after creation
* More reliably cache current user info in local storage
* Don't jam username stuff into user listener hook
* Members and contracts now documents
* undo loans change?
* Handle closed group
* Slight refactoring
* Don't allow modification of private groups contracts
* Add back in numMembers
* Update group field names
* Update firestore rules
* Update firestore rules
* Handle updated groups
* update start numbers
* Lint
* Lint
* Leaderboard calc: remove didProfitChange optimization that was incorrect
* Put back didPortfolioChange for deciding whether to create new history doc.
* Add embedded market grids
* Hacky way to set height
I haven't figured out a way yet to get the height of the actual iframe's content, so I did some bad estimate for now to unblock shipping the feature, while I continue investigating.
* Clean up some markup & dead code
* Order comments in Firestore instead of on client
* Order bets in Firestore instead of on client
* Make indexes file up to date with production
* WIP liking markets with tip
* Refactor Userlink, add MultiUserLink
* Lint
* Lint
* Fix merge
* Fix imports
* wip liked contracts list
* Cache likes and liked by user ids on contract
* Refactor tip amount, reduce to M
* Move back to M
* Change positioning for large screens
* De-feedify contract bets list
* De-feedify contract comments lists
* Clean up a bunch of duplicated work in the comments list stuff
* Remove wrapper markup from comment replies list
* Fix sort order on comments I broke
* Kill now unhelpful `CommentRepliesList` wrapper component
* More random cleanup
* More cleanup and fix some styling I had broken
* Make bet calculations less wrong
* Keep up to date with master
* Make copy link component copy better URL
* Make highlighted comments align properly
* Make user header left align with content on comments
* Fix some free response UI stuff up
* WIP persistence work
* Fix up close date filter, kill custom scroll restoration
* Use built-in Next.js scroll restoration machinery
* Tweaking stuff
* Implement 'history state' idea
* Clean up and unify persistent state stores
* Respect options for persisting contract search
* Fix typing in common lib
* Clean up console logging
* Create backend for Dashboards
* Rm lastupdatetime for now
* Added a create-dashboard and sharable view dashboard page
* Various nit fixes.
* Renamed Dashboards to Posts
* Fix nits
* Convert useUserBets to react query
* Fix duplicate key warnings
* Fix react-query workaround to use refetchOnMount: always'
* Use react query for portfolio history
* Fix useUserBet workaround
* Script to back fill unique bettors in all contracts
* React query for user bet contracts, using uniqueBettorsId!
* Prefetch user bets / portfolio data
* Make portfolio graph on profile not load extra data
* Clean up unused props
* Tidy up markup
* Enable "daily" option again on portfolio history picker
* add utility class for `word-break: break-word`
* refactor visuallyHidden style out of Page
* refactor out ref sizing hack in sidebar
* replace style props with tailwind classes
* Allow to follow/unfollow markets, backfill as well
* remove yarn script edit
* add decrement comment
* Lint
* Decrement follow count on unfollow
* Follow/unfollow button logic
* Unfollow/follow => heart
* Add user to followers in place-bet and sell-shares
* Add tracking
* Show contract follow modal for first time following
* Increment follower count as well
* Remove add follow from bet trigger
* restore on-create-bet
* Add pubsub to dev.sh, show heart on FR, remove from answer trigger
* Remove some old loan code
* Almost complete implementation of updateLoans cloud function
* Merge fixes
* Use invested instead of sale value, check if eligible, perform payouts
* Run monday 12am
* Implement loan income notification
* Fix imports
* Loan update fixes / debug
* Handle NaN and negative loan calcs
* Working loan notification
* Loan modal!
* Move loans calculation to /common
* Better layout
* Pay back loan on sell shares
* Pay back fraction of loan on redeem
* Sell bet loan: negate buy bet's loan
* Modal tweaks
* Compute and store nextLoanCached for all users
* lint
* Update loans with newest portfolio
* Filter loans to only unresolved contracts
* Tweak spacing
* Increase memory
* Revert "Revert "Tile contract cards in masonry layout (#761)""
This reverts commit 62728e52b7.
* Sort the contracts in the correct masonry order
* Fix ordering on single columns
* Use react-masonry-css to accomplish masonry view
* Improve comment
* Remove gridClassName
Everything is spaced with m-4, too bad
* Send out email template for 3 trending markets
* Rich text to plaintext descriptions, other ui changes
* Lint
* Filter for closed markets
* Change sign
* First order must be closeTime
* Send 6 emails, check flag twice
* Exclude contracts with trump and president in the name
* interesting markets email
* sendInterestingMarketsEmail
* Change subject line back
Co-authored-by: mantikoros <sgrugett@gmail.com>
* rename BetRow -> BetButton
* Replace bet modal in embed with inline betting
- Also simplifies graph height calculation
* Move bet row above graph, in "mini modal"
* Show signup button if not signed up
* Show probability change
* Show error after modal
- Show balance if insufficient funds
- Clear error from amount input if amount deleted entirely
* Fix error state conditions
- Reset amount input on success
- Reset success state on user input
* Make input smaller (80px)
Headless UI's Modal component autofocuses the first focusable item
inside it when opened. This is by design for accessibility reasons.
See https://headlessui.com/react/dialog#managing-initial-focus
Ironically this means we'll have to remove keyboard focus for tooltips
because this causes the tooltips to pop up unnecessarily for all users
whenever the dialog is opened. The alternative is managing focus
manually for several dialogs, which may not be possible as some of our
modals lack a sensible element to focus by default.
* fix https
* add beasts
* Remove extra file
* Prettier-ify code
* Prettier-ify
* add basic land guesser
also added fetcher to filter all cards instead of only unique art
* default to original
makes basic better
* added set symbol to basics
added set symbol to the basics game mode. Changed name to "How Basic"
* cleanup
* changed some pixels
* only load set data if needed
* hacked fix for removing image from name
* removed check from original
* remove check from original
* sort names by set instead of by set symbol
* include battlebond
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
* fix https
* add beasts
* Remove extra file
* Prettier-ify code
* Prettier-ify
* add basic land guesser
also added fetcher to filter all cards instead of only unique art
* default to original
makes basic better
* added set symbol to basics
added set symbol to the basics game mode. Changed name to "How Basic"
* cleanup
* changed some pixels
* only load set data if needed
* hacked fix for removing image from name
* removed check from original
* remove check from original
* sort names by set instead of by set symbol
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
* fix https
* add beasts
* Remove extra file
* Prettier-ify code
* Prettier-ify
* add basic land guesser
also added fetcher to filter all cards instead of only unique art
* default to original
makes basic better
* added set symbol to basics
added set symbol to the basics game mode. Changed name to "How Basic"
* cleanup
* changed some pixels
* only load set data if needed
* hacked fix for removing image from name
* removed check from original
* remove check from original
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
* fix https
* add beasts
* Remove extra file
* Prettier-ify code
* Prettier-ify
* add basic land guesser
also added fetcher to filter all cards instead of only unique art
* default to original
makes basic better
* added set symbol to basics
added set symbol to the basics game mode. Changed name to "How Basic"
* cleanup
* changed some pixels
* only load set data if needed
* hacked fix for removing image from name
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
* Add min, max, isLogScale to numeric market API return
* Add lastUpdatedTime to market API
* Return a string description in market API
* Accept string descriptions in market POST api
* install prettier eslint config. fix import
* fix another import
* Make `groupConsecutive` more capable
* Put denormalized `contractQuestion` and `contractSlug` on comments
* Update user profile UI to use new denormalized fields
* `/Austin` -> `/market`
* Rewrite useQueryAndSortParams machinery to be faster/simpler/better
* Politely debounce Algolia querying
* Tidy some stuff up
* Style changes suggested by James
* Move search controls into separate component
* Fix up typing on pill groups thingy
* More precise comparison per James
* Make sure `additionalFilter` is passed into controls
* Load bets and comments tabs data on user page independently
* Implement basic pagination on profile comments list
* Tweak server auth to return `null` instead of `undefined`
* Switch to SSR for user page
* Fix lint
* Fix broken contract fetching in user bets list
* Tidying
* Return both user and privateUser from `createuser`
* Make `useStateCheckEquality` more flexible
* Make `AuthContext` track the private user doc
* Change `usePrivateUser` hook to use the auth context data
* Pass both user and private user through SSR to auth context
* Fix bug in create user flow
* Make all tooltips use our component
* Stop mobile tooltip crop (daisy -> floating-ui)
* Show tooltip on tap for touch devices
Except tooltips on buttons
* migrate another daisy tooltip to ours
* Prevent hidden tooltip from covering click/hover
* Embed a tweet by URL
* Clean up imports
* Prevent tweetId from getting interpreted as a number
* Use a single place to embed iframe, Youtube, and Tweets
* Support Manifold and Metaculus embeds
* Remove unused import
* Simplify Manifold paste logic
* Clean up embed rewrite code
* Add back comment
* Rejigger config so tsx is only in web/
* Clean up comment
* Revert unnecessary tsconfig change
* Fix placeholder
* Lighten placeholder
* Embed markets using the "add markets" template
* Override dev domain
* Improve market modal style
- contract searchbar now sticky
- entire card clickable to select (if quickbet is hidden)
- adjust selected card styles
* remove extra export
* Hide pills
* Fix browser redirect warning
* Insert all markets instead of just one
* fix type error
* fixup "Insert all markets instead of just one"
Co-authored-by: Sinclair Chen <abc.sinclair@gmail.com>
* Allow focus on all parts of editor
* Fix background and text colors
* Restrict height of image in comment
* Remove "Type *markdown*" placeholder
it's a little misleading (can't do markdown links) and messes with focus
to be replaced with a highlight menu in the future
* Fix problems with visibility checking code
* Tear out old contract tracking stuff per James
* Use `useEvent` in VisibilityObserver per James suggestion
* Revert "Revert "Switch comments/chat to rich text editor (#703)""
This reverts commit 33906adfe4.
* Fix typing after being weird on Android
Issue: character from mention gets deleted. Most weird on Swiftkey:
mention gets duplicated instead of deleting.
See https://github.com/ProseMirror/prosemirror/issues/565https://bugs.chromium.org/p/chromium/issues/detail?id=612446
The keyboard still closes unexpectedly when you delete :(
* On reply, put space instead of \n after mention
* Remove image upload from placeholder text
- Redundant with image upload button
- Too long on mobile
* fix dependency
* Add cloud function to get custom token from API auth
* Use custom token to authenticate Firebase SDK on server
* Make sure getcustomtoken cloud function is fast
* Make server auth code maximally robust
* Refactor cookie code, make set and delete more flexible
* Challenge bets
* Store avatar url
* Fix before and after probs
* Check balance before creation
* Calculate winning shares
* pretty
* Change winning value
* Set shares to equal each other
* Fix share challenge link
* pretty
* remove lib refs
* Probability of bet is set to market
* Remove peer pill
* Cleanup
* Button on contract page
* don't show challenge if not binary or if resolved
* challenge button (WIP)
* fix accept challenge: don't change pool/probability
* Opengraph preview [WIP]
* elim lib
* Edit og card props
* Change challenge text
* New card gen attempt
* Get challenge on server
* challenge button styling
* Use env domain
* Remove other window ref
* Use challenge creator as avatar
* Remove user name
* Remove s from property, replace prob with outcome
* challenge form
* share text
* Add in challenge parts to template and url
* Challenge url params optional
* Add challenge params to parse request
* Parse please
* Don't remove prob
* Challenge card styling
* Challenge card styling
* Challenge card styling
* Challenge card styling
* Challenge card styling
* Challenge card styling
* Challenge card styling
* Challenge card styling
* Add to readme about how to dev og-image
* Add emojis
* button: gradient background, 2xl size
* beautify accept bet screen
* update question button
* Add separate challenge template
* Accepted challenge sharing card, fix accept bet call
* accept challenge button
* challenge winner page
* create challenge screen
* Your outcome/cost=> acceptorOutcome/cost
* New create challenge panel
* Fix main merge
* Add challenge slug to bet and filter by it
* Center title
* Add helper text
* Add FAQ section
* Lint
* Columnize the user areas in preview link too
* Absolutely position
* Spacing
* Orientation
* Restyle challenges list, cache contract name
* Make copying easy on mobile
* Link spacing
* Fix spacing
* qr codes!
* put your challenges first
* eslint
* Changes to contract buttons and create challenge modal
* Change titles around for current bet
* Add back in contract title after winning
* Cleanup
* Add challenge enabled flag
* Spacing of switch button
* market share row
* Add lite market endpoint
* 500 mana email (#687)
* Create 500-mana.html
* Update 500-mana.html
Fixed typos and links not working
* Added "create a good market" guide
added page creating-market.html
For Stephen to set up condition (email 3 days after signing up)
* Update 500-mana.html
updated 500 Mana email (still need to make changes to create market guide)
* email changes
* sendOneWeekBonusEmail logic
* add dayjs as dependency
* don't use mailgun scheduling
Co-authored-by: mantikoros <sgrugett@gmail.com>
* Challenge Bets (#679)
* Challenge bets
* Store avatar url
* Fix before and after probs
* Check balance before creation
* Calculate winning shares
* pretty
* Change winning value
* Set shares to equal each other
* Fix share challenge link
* pretty
* remove lib refs
* Probability of bet is set to market
* Remove peer pill
* Cleanup
* Button on contract page
* don't show challenge if not binary or if resolved
* challenge button (WIP)
* fix accept challenge: don't change pool/probability
* Opengraph preview [WIP]
* elim lib
* Edit og card props
* Change challenge text
* New card gen attempt
* Get challenge on server
* challenge button styling
* Use env domain
* Remove other window ref
* Use challenge creator as avatar
* Remove user name
* Remove s from property, replace prob with outcome
* challenge form
* share text
* Add in challenge parts to template and url
* Challenge url params optional
* Add challenge params to parse request
* Parse please
* Don't remove prob
* Challenge card styling
* Challenge card styling
* Challenge card styling
* Challenge card styling
* Challenge card styling
* Challenge card styling
* Challenge card styling
* Challenge card styling
* Add to readme about how to dev og-image
* Add emojis
* button: gradient background, 2xl size
* beautify accept bet screen
* update question button
* Add separate challenge template
* Accepted challenge sharing card, fix accept bet call
* accept challenge button
* challenge winner page
* create challenge screen
* Your outcome/cost=> acceptorOutcome/cost
* New create challenge panel
* Fix main merge
* Add challenge slug to bet and filter by it
* Center title
* Add helper text
* Add FAQ section
* Lint
* Columnize the user areas in preview link too
* Absolutely position
* Spacing
* Orientation
* Restyle challenges list, cache contract name
* Make copying easy on mobile
* Link spacing
* Fix spacing
* qr codes!
* put your challenges first
* eslint
* Changes to contract buttons and create challenge modal
* Change titles around for current bet
* Add back in contract title after winning
* Cleanup
* Add challenge enabled flag
* Spacing of switch button
* Put sharing qr code in modal
Co-authored-by: mantikoros <sgrugett@gmail.com>
* See challenges you've accepted too
* Remove max height
* Notify mentioned users on market publish (#683)
* Add function to parse at mentions
* Notify mentioned users on market create
- refactor createNotification to accept list of recipients' ids
* Switch comments/chat to rich text editor (#703)
* Switch comments/chat to rich text editor
* Remove TruncatedComment
* Re-add submit on enter
* Insert at mention on reply
* Update editor style for send button
* only submit on enter in chat
* code review: refactor
* use more specific type for upload
* fix ESlint and errors from merge
* fix trigger on every render eslint warning
* Notify people mentioned in comment
* fix type errors
* Revert "Switch comments/chat to rich text editor (#703)"
This reverts commit f52da72115.
* merge conflict
* share modal
* merge issue
* eslint
* bigger link icion
Co-authored-by: Ian Philips <iansphilips@gmail.com>
Co-authored-by: James Grugett <jahooma@gmail.com>
Co-authored-by: SirSaltyy <104849031+SirSaltyy@users.noreply.github.com>
Co-authored-by: Sinclair Chen <abc.sinclair@gmail.com>
* Switch comments/chat to rich text editor
* Remove TruncatedComment
* Re-add submit on enter
* Insert at mention on reply
* Update editor style for send button
* only submit on enter in chat
* code review: refactor
* use more specific type for upload
* fix ESlint and errors from merge
* fix trigger on every render eslint warning
* Notify people mentioned in comment
* fix type errors
* Challenge bets
* Store avatar url
* Fix before and after probs
* Check balance before creation
* Calculate winning shares
* pretty
* Change winning value
* Set shares to equal each other
* Fix share challenge link
* pretty
* remove lib refs
* Probability of bet is set to market
* Remove peer pill
* Cleanup
* Button on contract page
* don't show challenge if not binary or if resolved
* challenge button (WIP)
* fix accept challenge: don't change pool/probability
* Opengraph preview [WIP]
* elim lib
* Edit og card props
* Change challenge text
* New card gen attempt
* Get challenge on server
* challenge button styling
* Use env domain
* Remove other window ref
* Use challenge creator as avatar
* Remove user name
* Remove s from property, replace prob with outcome
* challenge form
* share text
* Add in challenge parts to template and url
* Challenge url params optional
* Add challenge params to parse request
* Parse please
* Don't remove prob
* Challenge card styling
* Challenge card styling
* Challenge card styling
* Challenge card styling
* Challenge card styling
* Challenge card styling
* Challenge card styling
* Challenge card styling
* Add to readme about how to dev og-image
* Add emojis
* button: gradient background, 2xl size
* beautify accept bet screen
* update question button
* Add separate challenge template
* Accepted challenge sharing card, fix accept bet call
* accept challenge button
* challenge winner page
* create challenge screen
* Your outcome/cost=> acceptorOutcome/cost
* New create challenge panel
* Fix main merge
* Add challenge slug to bet and filter by it
* Center title
* Add helper text
* Add FAQ section
* Lint
* Columnize the user areas in preview link too
* Absolutely position
* Spacing
* Orientation
* Restyle challenges list, cache contract name
* Make copying easy on mobile
* Link spacing
* Fix spacing
* qr codes!
* put your challenges first
* eslint
* Changes to contract buttons and create challenge modal
* Change titles around for current bet
* Add back in contract title after winning
* Cleanup
* Add challenge enabled flag
* Spacing of switch button
* Put sharing qr code in modal
Co-authored-by: mantikoros <sgrugett@gmail.com>
* Create 500-mana.html
* Update 500-mana.html
Fixed typos and links not working
* Added "create a good market" guide
added page creating-market.html
For Stephen to set up condition (email 3 days after signing up)
* Update 500-mana.html
updated 500 Mana email (still need to make changes to create market guide)
* email changes
* sendOneWeekBonusEmail logic
* add dayjs as dependency
* don't use mailgun scheduling
Co-authored-by: mantikoros <sgrugett@gmail.com>
* Add in group chat bubble
* Show chat bubble on nav with unseen notifs
* Spacing
* More spacing
* Remove chat tab
* Show chat on help/welcome/updates/features groups
* Cleanup
* Scroll with updated height
* Update group links in trigger and api
* Remove extra call during creation
* Remove grouplinks on frontend
* Deserialize
* Consolidate logic
* Move function locally
* In progress refactor to not use Algolia components
* Cleanup
* Only query when necessary
* Read and update url params for query and sort
* Don't push router
* Don't update url if using default sort
* Add popstate listener to improve home navigation
* Remove console.logs
* Make better tabs components, apply to user page
* Remove fishy unused href property from tabs
* Remove tab ID property
* Clean up crufty markup in tabs component
* Fix naming to be right (thanks James!)
* Reuse DAY_MS in update-metrics job
* More concise transaction in cancelbet
* Remove some meaningless awaits
* Do less work in onCreateLiquidityProvision
* Do less work in onCreateAnswer
* Move concurrently dep upwards
* Add express as explicit dependency
* Accept just one HTTP method per endpoint
* Fix endpoint option coalescing
* Expressification of cloud functions
* Nicer logging of API requests
* Refactor web package.json
* Add ts-node and nodemon to dev dependencies, bring back cors
* Add scaffolding to point dev server at local functions
* Enable emulator in dev server scaffolding
* Fix up a little stuff I broke
* Add @ mentions to editor
* Fix mention list not loading
* Sort mention list by prefix, follow count
* Render at mention with Linkify component
- mentions are now Next <Link> rather than <a>
- fix bug where editor.getText() returns [object Object] for mentions
- fix mention rendering for posted markets
* Try embedding iframes in tiptap
* When iframe code is pasted, inject it into the editor
* Code cleanups and comments
* Remove clsx dependency
Cuz it doesn't exist in `common` anyways
* Rename to tiptap-iframe
* Prototype range limit order UI
* Conditionally show YES or NO max payout
* Range bet executes both bets immediately.
* Validate lowLimitProb < highLimitProb
* Show error if low limit is higher than high limit
* Update range order UI
* Revert "Validate lowLimitProb < highLimitProb"
This reverts commit c261fc2743.
* Revert "Range bet executes both bets immediately."
This reverts commit 30b95d75d9.
* Buy panel only non-limit orders
* Bet choice => outcome
* More iterating on range UI
* betChoice => outcome
* Lighten placeholder text
* Referrals page added to sidebar; useSaveReferral; InfoBox
* text color
* eslint
* migrate useUsers hook to react-query (#674)
* Remove bet button from free response comments
* Make answer replies more closely spaced together
* Host Ida and Alex's MTG Guesser game (#656)
* Copy over code from Mtg Guesser
* Run Prettier
* CSS Tweaks: Hover feedback, button positioning
* Hide all but counterspell & burn, for now
* Move to /mtg directory
* Fix prettierignore
* smaller jsons (#673)
limited burn to only red cards and also added limited json files to only have fields needed to play
* Add Ida's tweak to card position
Co-authored-by: marsteralex <bob.masteralex@gmail.com>
* Adjust card positioning
* Make the select screen index.html
* Remove other guessing games
* Remove alternate versions; add Alex's email
* Remove unused jsons
* Small FR comments tweaks
* Spacing tweak
* Changing manalinks table UI (#665)
From table to card view
* Fix comment spacing on non-FR
* Move "Send M$" lower in sidebar More list.
* Move leaderboards up in mobile nav
* eslint
* prettier
Co-authored-by: Sinclair Chen <abc.sinclair@gmail.com>
Co-authored-by: James Grugett <jahooma@gmail.com>
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
Co-authored-by: marsteralex <bob.masteralex@gmail.com>
Co-authored-by: ingawei <46611122+ingawei@users.noreply.github.com>
* Make a React context to manage the logged in user events
* Remove unnecessary new user creation promise machinery
* Slight refactoring to auth context code
* Improvements in response to James feedback
* Copy over code from Mtg Guesser
* Run Prettier
* CSS Tweaks: Hover feedback, button positioning
* Hide all but counterspell & burn, for now
* Move to /mtg directory
* Fix prettierignore
* smaller jsons (#673)
limited burn to only red cards and also added limited json files to only have fields needed to play
* Add Ida's tweak to card position
Co-authored-by: marsteralex <bob.masteralex@gmail.com>
* Cache notifs in local, gives instant load of old notifs
* Small refactor, add ss auth
* unused vars
* Add back in replaceAll
* Save all notifs
* Memoize paginated notifs
* Replace all => replace with regexp
* Set a cookie with an up-to-date Firebase ID token
* Implement server-side authentication cookie reading logic
* Change index page to redirect for authed users
* No branch necessary for logged in users on index page
* Add helpers for creating server-side redirects
* Add some common sense redirects
- links and blockquotes have light font weight, like other text
- font size in editor matches font size in description
- old descriptions have same style as new
- placeholder text matches editor style
- decrease line-height a bit
* Use rich text editor on the description
* Write a new line to description when the question is changed
* Stop showing categories
* Allow anyone to edit their own question
* fixed manalinks bug of claiming own manalink, and also rerouting to home upon claiming if not logged in
* no more multiple hardcoded manalink messages
* minor tweaks of manalink form, adding M$ in front of amount and changing expire time to dropdown instead of calendar selection
* made minimum for uses and amount 1, it seems otherwise it does not generate a link at all
* start on script
* Revert "Remove category filters"
This reverts commit d6e808e1a3.
* Convert categories to official default groups
* Add new users to default groups
* Rework group cards
* Cleanup
* Add unique bettors to contract and sort by them
* Most bettors to most popular
* Unused vars
* Track unique bettor ids on contracts
* Add followed users' bets to personal markets
* Add new users to welcome, bugs, and updates groups
* Add users to fewer default cats
* Add TipTap editor and renderer components
* Change market description editor to rich text
* Type description as JSON, fix string-based logic
- Delete make-predictions.tsx
- Delete feed logic that showed descriptions
* wip Fix API validation
* fix type error
* fix extension import (backend)
In firebase, typescript compiles imports into common js imports
like `const StarterKit = require("@tiptap/starter-kit")`
Even though StarterKit is exported from the cjs file, it gets imported
as undefined. But it magically works if we import *
If you're reading this in the future, consider replacing StarterKit with
the entire list of extensions.
* Stop load on fail create market, improve warning
* Refactor editor as hook / fix infinite submit bug
Move state of editor back up to parent
We have to do this later anyways to allow parent to edit
* Add images - display, paste + uploading
* add uploading state of image
* Fix placeholder, misc styling
min height, quote
* Fix appending to description
* code review fixes: rename, refactor, chop carets
* Add hint & upload button on new lines
- bump to Tailwind 3.1 for arbitrary variants
* clean up, run prettier
* rename FileButton to FileUploadButton
* add image extension as functions dependency
* Simple limit order UI
* Update bet schema
* Restrict bet panel / bet row to only CPMMBinaryContracts (all binary DPM are resolved)
* Limit orders partway implemented
* Update follow leaderboard copy
* Change cpmm code to take some state instead of whole contract
* Write more of matching algorithm
* Fill in more of placebet
* Use client side contract search for emulator
* More correct matching
* Merge branch 'main' into limit-orders
* Some cleanup
* Listen for unfilled bets in bet panel. Calculate how the probability moves based on open limit orders.
* Simpler switching between bet & limit bet.
* Render your open bets (unfilled limit orders)
* Cancel bet endpoint.
* Fix build error
* Rename open bets to limit bets. Tweak payout calculation
* Limit probability selector to 1-99
* Deduct user balance only on each fill. Store orderAmount of bet. Timestamp of fills.
* Use floating equal to check if have shares
* Add limit order switcher to mobile bet dialog
* Support limit orders on numeric markets
* Allow CORS exception for Vercel deployments
* Remove console.logs
* Update user balance by new bet amount
* Tweak vercel cors
* Try another regexp for vercel cors
* Test another vercel regex
* Slight notifications refactor
* Fix docs edit link (#624)
* Fix docs edit link
* Update github links
* Small groups UX changes
* Groups UX on mobile
* Leaderboards => Rankings on groups
* Unused vars
* create: remove automatic setting of log scale
* Use react-query to cache notifications (#625)
* Use react-query to cache notifications
* Fix imports
* Cleanup
* Limit unseen notifs query
* Catch the bounced query
* Don't use interval
* Unused var
* Avoid flash of page nav
* Give notification question priority & 2 lines
* Right justify timestamps
* Rewording
* Margin
* Simplify error msg
* Be explicit about limit for unseen notifs
* Pass limit > 0
* Remove category filters
* Remove category selector references
* Track notification clicks
* Analyze tab usage
* Bold more on new group chats
* Add API route for listing a bets by user (#567)
* Add API route for getting a user's bets
* Refactor bets API to use /bets
* Update /markets to use zod validation
* Update docs
* Clone missing indexes from firestore
* Minor notif spacing adjustments
* Enable tipping on group chats w/ notif (#629)
* Tweak cors regex for vercel
* Your limit bets
* Implement selling shares
* Merge branch 'main' into limit-orders
* Fix lint
* Move binary search to util file
* Add note that there might be closed form
* Add tooltip to explain limit probability
* Tweak
* Cancel your limit orders if you run out of money
* Don't show amount error in probability input
* Require limit prob to be >= .1% and <= 99.9%
* Fix focus input bug
* Simplify mobile betting dialog
* Move mobile limit bets list into bet dialog.
* Small fixes to existing sell shares client
* Lint
* Refactor useSaveShares to actually read from localStorage, use less bug-prone interface.
* Fix NaN error
* Remove TODO
* Simple bet fill notification
* Tweak wording
* Sort limit bets by limit prob
* Padding on limit bets
* Match header size
Co-authored-by: Ian Philips <iansphilips@gmail.com>
Co-authored-by: ahalekelly <ahalekelly@gmail.com>
Co-authored-by: mantikoros <sgrugett@gmail.com>
Co-authored-by: Ben Congdon <ben@congdon.dev>
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
* Show tip notifications
* Optimizing notifications for mobile
* Unused vars
* Move income reason logic to income notif
* Remove unnecessary icons
* Unused vars
* create pseudo-numeric contracts
* graph and bet panel for pseudo numeric
* pseudo numeric market layout, quick betting
* Estimated value
* sell panel
* fix graph
* pseudo numeric resolution
* bets tab
* redemption for pseudo numeric markets
* create log scale market, validation
* log scale
* create: initial value can't be min or max
* don't allow log scale for ranges with negative values (b/c of problem with graph library)
* prettier delenda est
* graph: handle min value of zero
* bet labeling
* validation
* prettier
* pseudo numeric embeds
* update disclaimer
* validation
* validation
* add trigger for updated user
* Add referral bonuses and notifications for them
* Cleanup
* Add share group button, cleanup
* Cleanup
* Add referrals list to user profile
* Remove unused
* Referral bonus => constant
* Refactor
* Add referral txn to helper fn
* Move reads into firebase transaction
* Use effects to write referral info
* Flex-wrap profile objects
* Small ui changes
* Restrict referral user to one update
* Remove rogue semicolon
* Note about group referral query details
* Track referrals, add them to settings list
* Update resolve-market to be a v2 function
* Cleanup API error responses
* Update frontend to use v2 version of resolvemarket
* Appease ESLint
* Address review comments
* Appease ESLint
* Remove unnecessary auth check
* Fix logic bug in FR market validation
* Make it so you can specify runtime opts for v2 functions
* Cleanup to resolve market API resolutions input, fixes
* Fix up tiny lint
* Last minute cleanup to resolvemarket FR API input validation
Co-authored-by: Benjamin <ben@congdon.dev>
* More liberal .gitignores on TS output directories
* Use project references for Typescript functions project
* Use /dist dir for Cloud Functions deployment payload
* Fix Github actions functions tsc job
* More liberal .gitignores on TS output directories
* Use project references for Typescript projects
* Use /dist dir for Cloud Functions deployment payload
* Disable `next build` typechecking
* Fiddle with GitHub tsc jobs
* [Portfolio Graph] Shows a graph of the portfolio value over time
* [PortfolioGraph] Fix some nits.
* [PortfolioGraph] Comment out portfolio-value-section
Hides the component completely for now, so we can land today. My plan would be to land today, wait for the history to build up, and then revert this commit. As opposed to leaving the PR idle for a while, and then have to deal with conflicts.
* [PortfolioGraph] Rm duplicate firestore rule
* Set up Firestore structure for mana bounty links
* Split up manalinks into successes and failures
* Allow clients to create manalinks
* Track txnId and successful users
* Store custom amounts in the link
* List all manalinks you've created
* Support backend for claiming manalinks
* Add some more error handling
* Tweak readme
* Fix typescript breakage
* Revert "Convert common imports in functions to be absolute"
This reverts commit c03518e906.
* Scaffolding so `claimManalink` works
* Clean up imports
* Barebones endpoint to claim mana
* Fix rules to only allow link creators to query
* Design out claim giftcard
* List all claimed transactions
* Style in a more awesome card
* Fix import
* Padding tweak
* Fix useManalinkTxns hook
* /send -> /link
* Tidy up some details
* Do a bunch of random manalinks work
* Fix up LinksTable to build
* Clean up LinksTable an absurd amount
* Basic details functionality on manalinks table
* Work on manalink claim stuff
* Fix up some merge mess
* Not-signed-in flow implemented
* Better manalinks table
* Only show outstanding links in table
* Use new `ManalinkTxn` type
* /link -> /links
* Change manalinks page UI to use nice looking tabs
* Many fixes to manalinks UI
* Default to 1 use
* Tidying up
* Some copy changes based on feedback
* Add required index
Co-authored-by: Marshall Polaris <marshall@pol.rs>
* Update api pool and totalLiquidity
* fix pool type
* reverting totalLiquidity changes
* pool and totalLiquidity docs description
* Changed pool type to match elsewhere
* [Leaderboards] Added period toggle for leaderboards
* [Leaderboards] TopBettors now calculates by period correctly
* [Leaderboard] Use a subcollection for the portfolio caching
* [Leaderboard] Switches to a tab view, temporarily hides the missing topBettors periods
* [Leaderboard] Reverts random yarn.lock changes
* Fix type error from merge
* Increase timeout on update metrics
* Update firebase rules to allow reading user portfolioHistory
Co-authored-by: Pico2x <pico2x@gmail.com>
* Folds=>groups
* Show groups on user profile
* Allow group creation from /create
* Refactoring to groups
* Convert folds to groups
* Add new add to group notification
* Fix user profile tab bug
* Add groups nav and tab for my groups
* Remove bad profile pages
* remove comments
* Add group list dropdown to sidebar
* remove unused
* group cards ui
* Messages=>Comments, v2, groupDetails
* Discussion time
* Cleaning up some code
* Remove follow count
* Fix pool scoring for cpmm
* Fix imports
* Simplify rules, add GroupUser collection
* Fix group cards
* Refactor
* Refactor
* Small fixes
* Remove string
* Add api error detail handling
* Clear name field
* Componentize
* Spacing
* Undo userpage memo
* Member groups are already in my tab
* Remove active contracts reference for now
* Remove unused
* Refactoring
* Allow adding old questions to a group
* Rename
* Wording
* Throw standard v2 APIError
* Hide input for non-members, add about under title
* Multiple names to & # more
* Move comments firestore rules to appropriate subpaths
* Group membership, pool=>volume
* Cleanup, useEvent
* Raise state to parent
* Eliminate unused
* Cleaning up
* Clean code
* Revert tags input deletion
* Cleaning code
* Stylling
* Limit members to display
* Array cleanup
* Add categories back in
* Private=>closed
* Unused vars
* Create Top Followed Users leaderboard
* Switch to increment/decrement approach for caching user follower counts
* Backfill script for user follow counts
* Appease ESLint
* Address review comment
Co-authored-by: James Grugett <jahooma@gmail.com>
* New tooltip for binary market chart
* Tooltip on one line and rewrote date formatter
* Interpolate graph points and updated date format
* Reduced point count to 300 desktop, 50 mobile
* Clean the user's display name on update.
The user's display name should always be clean (see for example
functions/src/create-user.ts). However, change-user-info.ts does not
enforce this, thus potentially allowing a malicious user to change their
name to something that doesn't satisfy the rules for clean display
names.
Note: this cannot happen currently because all callers (in profile.tsx)
clean the name. However, doing it here is good defense in depth
(similar to how the userName is cleaned).
* Update display name max length to 30
* Add a script to hunt down too-long display names
* Make util.isProd a function
* Don't access admin.firestore() on top level of utils.ts
Co-authored-by: Jonas Wagner <ltlygwayh@gmail.com>
* Add tip arrows UI (visual)
* move tipper into its own component
* simplify score calculation
* Add tip txns
- more specific txn types
- fix transact cloud function to be able to create tip txns
- insert tips into comments via a context
* Refactor tipper to send tip txns
* Stop tipping yourself. Disable anons.
* Style tipper (smaller)
* remove default exports
* capitalize tooltips
* rename stuff
* add exhausting hook dependencies
* replace context with prop threading
* fix eslint unused vars
* fix: thread tips correctly into fr comments
* Add tip arrows UI (visual)
* move tipper into its own component
* simplify score calculation
* Add tip txns
- more specific txn types
- fix transact cloud function to be able to create tip txns
- insert tips into comments via a context
* Refactor tipper to send tip txns
* Stop tipping yourself. Disable anons.
* Style tipper (smaller)
* remove default exports
* capitalize tooltips
* rename stuff
* add exhausting hook dependencies
* replace context with prop threading
* fix eslint unused vars
* Consolidate metrics updates into one batch job
* Try batching updates of metrics
* Don't look up all bets again for all contracts
* Tidying up
* Make computeTotalPool less needlessly inefficient looking
* Added radio buttons to market creation (non functional)
* Ignoring vs code files
Should this be done in the repo or should everyone using VS Code do that himself globally on his machine(s)?
* Removed 'automatic' resolution
* added union type for resolution
* revert: resolution could be anything here (non binary markets)
* Expanded ChoicesToggleGroup for string choices
* Added combined resolution and required buttons to market creation
* restricted automatic resolution to binary markets
* added automatic resolution to contract
* added automatic resolution to contract overview
* string or number array to mixed array
* created const for resolutions
* Added comments for leading semicolons
* configuration of auto resolution on market creation
* v1.22.19
* v1.0.0
* v0.0.0
* v1.0.0
* v1.22.19
* Mock display automatic resolution
* Revert changes to market creation
* Revert "v1.22.19"
This reverts commit 22f59adc9c.
* Removed resolutiontype from contract creation
* Added auto resolution time to contract
* Auto resolution date editable
* refactoring
* Editable interface for auto resolution
* New edit interface for auto resolution
* Setting of auto resolve date when changing close date
* prohibited changing other peoples markets
* removed unnecessary export
* refactoring
(cherry picked from commit 4de86d5b08)
* Added comments for leading semicolons
(cherry picked from commit 60739c7853)
* Ignoring vs code files
Should this be done in the repo or should everyone using VS Code do that himself globally on his machine(s)?
(cherry picked from commit 944de9398a)
* removed unused imports and variables
* added type for binary resolution
* Prettier
* const for binary resolutions
* using the type "resolution"
* Prettier
* Re-added comment
* Update functions/src/create-contract.ts
* Revert "Ignoring vs code files"
This reverts commit 09aea5c207.
* launch config for debugging with vs code WIP
* "Launch Chrome" does not work since login via google is not possible in debugger-chrome
* Breakpoints are unbound when attached to chrome
* Revert "Added comments for leading semicolons"
* prettier
* linebreak crlf
* vscode settings
* correct linebreaks
* search exclusion
* automatic prettifier
* vscode settings
* correct linebreaks
* search exclusion
* automatic prettifier
* Working debugger config
* fix merge
* Removed comments, default resolution MKT
* removed vscode from gitignore
* refactoring description update
* Added auto resolution to LiteMarket
* fix date, setDate mutates object
* fixed firestore.rules
* script to add auto resolution to all markets
* regularely auto resolve markets
* fix description error
* moved calculate ts for access in firebase
* Revert "moved calculate ts for access in firebase"
This reverts commit 8380bf4f72.
* fix reference to calculate for firebase
* fixed references to time
* renamed function
* added description
* added auto resolution to description
* direct bool check instead of != null
* direct bool check instead of != undefined
* remove explicit type
* Fix free response markets
* removed contract from functionname
* interval set to 1h
* query instead of filter
* folds ~> contracts
* query instead of filter
* promise.all instead of foreach
* removed contractDoc from function header
* removed autoResolution from function header
* batchedWaitAll instead of promise.all
* removed unused parameter
* replaced auto resolution with constant
* suggestions from PR
* fix comment
* removed unused imports
* added scripts to add close dates on prod
* optimization
* removed test script
* security: only auto resolve markets which are closed
* consistency checks
* re-added type check for binary markets
* moved check of probability into switch case block
* removed unused import
* auto resolution every minute
* auto resolution time optional
* pr fixes
* split into two function to access the pool value as number
* rename function
* changes to the exported object
* removal of totalLiquidity: this value was only set for binary markets and it's value is identical to getPoolvalue(contract)
* pool: set in the same way as in the "Market Overview" from contract-info-dialog.tsx now
* totalShares: total shares of the contract. It's value is equal to the old "pool" value in case of binary markets
* update docs
* removal of totalShares
'The Patient Philanthropy Project aims to safeguard and benefit the long-term future of humanity',
description:`The Patient Philanthropy Project focuses on how we can collectively grow our resources to support the long-term flourishing of humanity. It addresses a crucial gap: as a society, we spend much too little on safeguarding and benefiting future generations. In fact, we spend more money on ice cream each year than we do on preventing our own extinction. However, people in the future - who do not have a voice in their future survival or environment - matter. Lots of them may yet come into existence and we have the ability to positively affect their lives now, if only by making sure we avoid major catastrophes that could destroy our common future.
@ -300,10 +300,29 @@ Future plans: We expect to focus on similar theoretical problems in alignment un
name:'Wild Animal Initiative',
website:'https://www.wildanimalinitiative.org/',
ein:'82-2281466',
tags:['Featured']asCharityTag[],
photo:'https://i.imgur.com/bOVUnDm.png',
preview:'We want to make life better for wild animals.',
description:
'Wild Animal Initiative (WAI) currently operates in the U.S., where they work to strengthen the animal advocacy movement through creating an academic field dedicated to wild animal welfare. They compile literature reviews, write theoretical and opinion articles, and publish research results on their website and/or in peer-reviewed journals. WAI focuses on identifying and sharing possible research avenues and connecting with more established fields. They also work with researchers from various academic and non-academic institutions to identify potential collaborators, and they recently launched a grant assistance program.',
preview:
'Our mission is to understand and improve the lives of wild animals.',
description:`Although the natural world is a source of great beauty and happiness, vast numbers of animals routinely face serious challenges such as disease, hunger, or natural disasters. There is no “one-size-fits-all” solution to these threats. However, even as we recognize that improving the welfare of free-ranging wild animals is difficult, we believe that humans have a responsibility to help whenever we can.
'FYXX Foundation: wildlife population management, without killing.',
description:`The future of our planet depends on the innovations of today, and the health of our wildlife are the first indication of our successful stewardship, which we believe can be improved by safe population management utilizing fertility control instead of poison and culling.`,
},
{
name:'New Incentives',
@ -516,6 +535,69 @@ The American Civil Liberties Union is our nation's guardian of liberty, working
'The Center for Election Science is a nonpartisan nonprofit dedicated to empowering voters with voting methods that strengthen democracy. We believe you deserve a vote that empowers you to impact the world you live in.',
description:`Founded in 2011, The Center for Election Science is a national, nonpartisan nonprofit focused on voting reform.
'Tackling the vast global inequalities in health, wealth and opportunity',
description:`Nearly half the world lives on less than $2.50 a day, yet giving by the world’s richest often overlooks the world’s poorest and most vulnerable. Despite the average American household being richer than 90% of the rest of the world, only 6% of US charitable giving goes to charities which work internationally.
'The California Renters Legal Advocacy and Education Fund’s core mission is to make lasting impacts to improve the affordability and accessibility of housing to current and future Californians, especially low- and moderate-income people and communities of color.',
Manifold Markets is a novel site where users can bet against each other to predict the outcomes of all types of questions. Engage in intense discussion, or joke with friends, whilst putting play-money where your mouth is.
## Mana
Mana (M$) is our virtual play currency that cannot be converted to real money.
- **Its Value**
You can redeem your Mana and we will [donate to a charity](https://manifold.markets/charity) on your behalf. Redeeming and purchasing Mana occurs at a rate of M$100 to $1. You will be able to redeem it for merch and other cool items soon too!
- **It sets us apart**
Using play-money sets us apart from other similar sites as we don’t want our users to solely focus on monetary gains. Instead we prioritize providing value in the form of an enjoyable experience and facilitating a more informed world through the power of prediction markets.
## How probabilities work
The probability of a market represents what the collective bets of users predict the chances of an outcome occurring is. How this is calculated depends on the type of market - see below!
## Types of markets
There are currently 3 types of markets: Yes/No (binary), Free response, and Numerical.
- **Yes/No (Binary)**
The creator asks a question where traders can bet yes or no.
Check out [Maniswap](https://www.notion.so/Maniswap-ce406e1e897d417cbd491071ea8a0c39) for more info on its automated market maker.
- **Free Response**
The creator asks an open ended question. Both the creator and users can propose answers which can be bet on. Don’t be intimidated to add new answers! The payout system and initial liquidity rewards users who bet on new answers early. The algorithm used to determine the probability and payout is complicated but if you want to learn more check out [DPM](https://www.notion.so/DPM-b9b48a09ea1f45b88d991231171730c5).
- **Numerical**
Retracted whilst we make improvements. You still may see some old ones floating around though. Questions which can be answered by a number within a given range. Betting on a value will cause you to buy shares from ‘buckets’ surrounding the number you choose.
## Compete and build your portfolio
Generate profits to prove your expertise and shine above your friends.
To the moon 🚀
- **Find inaccurate probabilities**
Use your superior knowledge on topics to identify markets which have inaccurate probabilities. This gives you favorable odds, so bet accordingly to shift the probability to what you think it should be.
- **React to news**
Markets are dynamic and ongoing events can drastically affect what the probability should look like. Be the keenest to react and there is a lot of Mana to be made.
- **Buy low, sell high**
Similar to a stock market, probabilities can be overvalued and undervalued. If you bet (buy shares) at one end of the spectrum and subsequently other users buy even more shares of that same type, the value of your own shares will increase. Sometimes it will be most profitable to wait for the market to resolve but often it can be wise to sell your shares and take the immediate profits. This can also be a great way to free up Mana if you are lacking funds.
- **Create innovative answers**
Certain free response markets provide room for creativity! The answers themselves can often affect the outcome based on how compelling they are.
More questions? Check out**[this community-driven FAQ](https://docs.manifold.markets/faq)**!
Manifold Markets lets anyone create a prediction market on any topic. Win virtual money betting on what you know, from**[chess tournaments](https://manifold.markets/SG/will-magnus-carlsen-lose-any-regula)**to**[lunar collisions](https://manifold.markets/Duncan/will-the-wayward-falcon-9-booster-h)**to**[newsletter subscriber rates](https://manifold.markets/Nu%C3%B1oSempere/how-many-additional-subscribers-wil)**- or learn about the future by creating your own market!
Manifold Markets lets anyone create a prediction market on any topic. Win virtual play money betting on what you know, from**[chess tournaments](https://manifold.markets/SG/will-magnus-carlsen-lose-any-regula)**to**[lunar collisions](https://manifold.markets/Duncan/will-the-wayward-falcon-9-booster-h)**to**[newsletter subscriber rates](https://manifold.markets/Nu%C3%B1oSempere/how-many-additional-subscribers-wil)**- or learn about the future by creating your own market!
### **What are prediction markets?**
@ -17,27 +17,13 @@ If I think the Democrats are very likely to win, and you disagree, I might offer
Now, you or I could be mistaken and overshooting the true probability one way or another. If so, there's an incentive for someone else to bet and correct it! Over time, the implied probability will converge to the**[market's best estimate](https://en.wikipedia.org/wiki/Efficient-market_hypothesis)**. Since these probabilities are public, anyone can use them to make better decisions!
### **How does Manifold Markets work?**
1. **Anyone can create a market for any yes-or-no question.**
You can ask questions about the future like "Will Taiwan remove its 14-day COVID quarantine by Jun 01, 2022?" If the market thinks this is very likely, you can plan more activities for your trip.
You can also ask subjective, personal questions like "Will I enjoy my 2022 Taiwan trip?". Then share the market with your family and friends and get their takes!
2. **Anyone can bet on a market using Manifold Dollars (M$), our platform currency.**
You get M$ 1,000 just for signing up, so you can start betting immediately! When a market creator decides an outcome in your favor, you'll win Manifold Dollars from people who bet against you.
More questions? Check out**[this community-driven FAQ](https://outsidetheasylum.blog/manifold-markets-faq/)**!
### **Can prediction markets work without real money?**
Yes! There is substantial evidence that play-money prediction markets provide real predictive power. Examples include**[sports betting](http://www.electronicmarkets.org/fileadmin/user_upload/doc/Issues/Volume_16/Issue_01/V16I1_Statistical_Tests_of_Real-Money_versus_Play-Money_Prediction_Markets.pdf)**and internal prediction markets at firms like**[Google](https://www.networkworld.com/article/2284098/google-bets-on-value-of-prediction-markets.html)**.
Our overall design also ensures that good forecasting will come out on top in the long term. In the competitive environment of the marketplace, bettors that are correct more often will gain influence, leading to better-calibrated forecasts over time.
Since our launch, we've seen hundreds of users trade each day, on over a thousand different markets! You can track the popularity of our platform at**[http://manifold.markets/analytics](http://manifold.markets/analytics)**.
Since our launch, we've seen hundreds of users trade each day, on over a thousand different markets! You can track the popularity of our platform at**[https://manifold.markets/stats](https://manifold.markets/stats)**.
### **Why is this important?**
@ -67,7 +53,7 @@ Manifold Markets is currently a team of three:
- Stephen Grugett
- Austin Chen
We've previously launched consumer-facing startups (**[Throne](https://throne.live/)**,**[One Word](http://oneword.games/platform)**), and worked at top tech and trading firms (Google, Susquehanna).
We've previously launched consumer-facing startups (**[Throne](https://throne.live/)**,**[One Word](https://oneword.games/platform)**), and worked at top tech and trading firms (Google, Susquehanna).
Gets a user by their username. Remember that usernames may change.
Requires no authorization.
### `GET /v0/user/by-id/[id]`
Gets a user by their unique ID. Many other API endpoints return this as the `userId`.
Requires no authorization.
### GET /v0/me
Returns the authenticated user.
### `GET /v0/groups`
Gets all groups, in no particular order.
Parameters:
- `availableToUserId`: Optional. if specified, only groups that the user can
join and groups they've already joined will be returned.
Requires no authorization.
### `GET /v0/group/[slug]`
Gets a group by its slug.
Requires no authorization.
Note: group is singular in the URL.
### `GET /v0/group/by-id/[id]`
Gets a group by its unique ID.
Requires no authorization.
Note: group is singular in the URL.
### `GET /v0/group/by-id/[id]/markets`
Gets a group's markets by its unique ID.
Requires no authorization.
Note: group is singular in the URL.
### `GET /v0/markets`
Lists all markets, ordered by creation date descending.
@ -50,30 +98,38 @@ Requires no authorization.
- Example request
```
http://manifold.markets/api/v0/markets?limit=1
https://manifold.markets/api/v0/markets?limit=1
```
- Example response
```json
[
{
"id":"FKtYX3t8ZfIp5gytJWAI",
"creatorUsername":"JamesGrugett",
"creatorName":"James Grugett",
"createdTime":1645139406452,
"closeTime":1647406740000,
"question":"What will be the best assessment of the Free response feature on March 15th?",
"description":"Hey guys, let's try this out!\nWe will see how people use the new Free response market type over the next month. Then I will pick the answer that I think best describes the consensus view of this feature on March 15th. Cheers.",
// Market attributes. All times are in milliseconds since epoch
closeTime?: number // Min of creator's chosen date, and resolutionTime
question: string
description: string
// A list of tags on each market. Any user can add tags to any market.
// This list also includes the predefined categories shown as filters on the home page.
tags: string[]
// Note: This url always points to https://manifold.markets, regardless of what instance the api is running on.
// This url includes the creator's username, but this doesn't need to be correct when constructing valid URLs.
// i.e. https://manifold.markets/Austin/test-market is the same as https://manifold.markets/foo/test-market
url: string
pool: number
outcomeType: string // BINARY, FREE_RESPONSE, MULTIPLE_CHOICE, NUMERIC, or PSEUDO_NUMERIC
mechanism: string // dpm-2 or cpmm-1
probability: number
pool: { outcome: number } // For CPMM markets, the number of shares in the liquidity pool. For DPM markets, the amount of mana invested in each answer.
p?: number // CPMM markets only, probability constant in y^p * n^(1-p) = k
totalLiquidity?: number // CPMM markets only, the amount of mana deposited into the liquidity pool
min?: number // PSEUDO_NUMERIC markets only, the minimum resolvable value
max?: number // PSEUDO_NUMERIC markets only, the maximum resolvable value
isLogScale?: bool // PSEUDO_NUMERIC markets only, if true `number = (max - min + 1)^probability + minstart - 1`, otherwise `number = min + (max - min) * probability`
volume: number
volume7Days: number
volume24Hours: number
isResolved: boolean
resolutionTime?: number
resolution?: string
resolutionProbability?: number // Used for BINARY markets resolved to MKT
lastUpdatedTime?: number
}
```
### `GET /v0/market/[marketId]`
Gets information about a single market by ID.
Gets information about a single market by ID. Includes comments, bets, and answers.
Requires no authorization.
@ -122,227 +198,204 @@ Requires no authorization.
```json
{
"id": "3zspH9sSzMlbFQLn9GKR",
"creatorUsername": "Austin",
"creatorName": "Austin Chen",
"createdTime": 1644103005345,
"closeTime": 1667894340000,
"question": "Will Carrick Flynn win the general election for Oregon's 6th District?",
"description": "The Effective Altruism movement usually stays out of politics, but here is a recent, highly-upvoted endorsement of donating to Carrick Flynn as a high-impact area: https://forum.effectivealtruism.org/posts/Qi9nnrmjwNbBqWbNT/the-best-usd5-800-i-ve-ever-donated-to-pandemic-prevention\nFurther reading: https://ballotpedia.org/Oregon%27s_6th_Congressional_District_election,_2022\n\n#EffectiveAltruism#Politics",
"description": "Resolves proportionally to the answer(s) which I find most compelling. (Obviously I’ll refrain from giving my own answers)\n\n(Please have at it with philosophy, ethics, etc etc)\n\n\nContract resolved automatically.",
"text": "It's a D+3 district, and the person we're pushing is functionally an outsider. I maxed my donation, but 25%, what I bought down to, implying even odds on both the general and the primary, seems if anything optimistic.",
"createdTime": 1644693740967,
"id": "fbU0DbmDWMnubggpQotw",
"betId": "fbU0DbmDWMnubggpQotw",
"userName": "Celer"
"id": "ZdHIyfQazHyl8nI0ENS7",
"userId": "qe2QqIlOkeWsbljfeF3MsxpSJ9i2",
"createdTime": 1655265807433,
"text": "ok what\ni did not resolve this intentionally",
Cancel the limit order of a bet with the specified id. If the bet was unfilled, it will be cancelled so that no other bets will match with it. This is action irreversable.
### `POST /v0/market`
Creates a new market on behalf of the authorized user.
Parameters:
- `outcomeType`: Required. One of `BINARY`, `FREE_RESPONSE`, or `NUMERIC`.
- `outcomeType`: Required. One of `BINARY`, `FREE_RESPONSE`, `MULTIPLE_CHOICE`, or `PSEUDO_NUMERIC`.
- `question`: Required. The headline question for the market.
- `description`: Required. A long description describing the rules for the market.
- Note: string descriptions do **not** turn into links, mentions, formatted text. Instead, rich text descriptions must be in [TipTap json](https://tiptap.dev/guide/output#option-1-json).
- `closeTime`: Required. The time at which the market will close, represented as milliseconds since the epoch.
- `tags`: Optional. An array of string tags for the market.
@ -439,6 +572,12 @@ For numeric markets, you must also provide:
- `min`: The minimum value that the market may resolve to.
- `max`: The maximum value that the market may resolve to.
- `isLogScale`: If true, your numeric market will increase exponentially from min to max.
- `initialValue`: An initial value for the market, between min and max, exclusive.
For multiple choice markets, you must also provide:
- `answers`: An array of strings, each of which will be a valid answer for the market.
"description":"I'm not going to type some long ass example description.", \
"closeTime":1700000000000, \
initialProb:25}'
"initialProb":25}'
```
### `POST /v0/market/[marketId]/add-liquidity`
Adds a specified amount of liquidity into the market.
- `amount`: Required. The amount of liquidity to add, in M$.
### `POST /v0/market/[marketId]/close`
Closes a market on behalf of the authorized user.
- `closeTime`: Optional. Milliseconds since the epoch to close the market at. If not provided, the market will be closed immediately. Cannot provide close time in past.
### `POST /v0/market/[marketId]/resolve`
Resolves a market on behalf of the authorized user.
Parameters:
For binary markets:
- `outcome`: Required. One of `YES`, `NO`, `MKT`, or `CANCEL`.
- `probabilityInt`: Optional. The probability to use for `MKT` resolution.
For free response or multiple choice markets:
- `outcome`: Required. One of `MKT`, `CANCEL`, or a `number` indicating the answer index.
- `resolutions`: An array of `{ answer, pct }` objects to use as the weights for resolving in favor of multiple free response options. Can only be set with `MKT` outcome. Note that the total weights must add to 100.
For numeric markets:
- `outcome`: Required. One of `CANCEL`, or a `number` indicating the selected numeric bucket ID.
- `value`: The value that the market may resolves to.
- `probabilityInt`: Required if `value` is present. Should be equal to
- If log scale: `log10(value - min + 1) / log10(max - min + 1)`
- Otherwise: `(value - min) / (max - min)`
Example request:
```
# Resolve a binary market
$ curl https://manifold.markets/api/v0/market/{marketId}/resolve -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: Key {...}' \
--data-raw '{"outcome": "YES"}'
# Resolve a binary market with a specified probability
$ curl https://manifold.markets/api/v0/market/{marketId}/resolve -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: Key {...}' \
--data-raw '{"outcome": "MKT", \
"probabilityInt": 75}'
# Resolve a free response market with a single answer chosen
$ curl https://manifold.markets/api/v0/market/{marketId}/resolve -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: Key {...}' \
--data-raw '{"outcome": 2}'
# Resolve a free response market with multiple answers chosen
$ curl https://manifold.markets/api/v0/market/{marketId}/resolve -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: Key {...}' \
--data-raw '{"outcome": "MKT", \
"resolutions": [ \
{"answer": 0, "pct": 50}, \
{"answer": 2, "pct": 50} \
]}'
```
### `POST /v0/market/[marketId]/sell`
Sells some quantity of shares in a binary market on behalf of the authorized user.
Parameters:
- `outcome`: Optional. One of `YES`, or `NO`. If you leave it off, and you only
own one kind of shares, you will sell that kind of shares.
- `shares`: Optional. The amount of shares to sell of the outcome given
above. If not provided, all the shares you own will be sold.
Example request:
```
$ curl https://manifold.markets/api/v0/market/{marketId}/sell -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: Key {...}' \
--data-raw '{"outcome": "YES", "shares": 10}'
```
### `POST /v0/comment`
Creates a comment in the specified market. Only supports top-level comments for now.
Parameters:
- `contractId`: Required. The ID of the market to comment on.
- `content`: The comment to post, formatted as [TipTap json](https://tiptap.dev/guide/output#option-1-json), OR
- `html`: The comment to post, formatted as an HTML string, OR
- `markdown`: The comment to post, formatted as a markdown string.
### `GET /v0/bets`
Gets a list of bets, ordered by creation date descending.
Parameters:
- `username`: Optional. If set, the response will include only bets created by this user.
- `market`: Optional. The slug of a market. If set, the response will only include bets on this market.
- `limit`: Optional. How many bets to return. The maximum and the default is 1000.
- `before`: Optional. The ID of the bet before which the list will start. For
example, if you ask for the most recent 10 bets, and then perform a second
query for 10 more bets with `before=[the id of the 10th bet]`, you will
- [WagerWith.me](https://www.wagerwith.me/) — Bet with your friends, with full Manifold integration to bet with M$.
- [Alignment Markets](https://alignmentmarkets.com/) - Bet on the progress of benchmarks in ML safety!
## API / Dev
- [PyManifold](https://github.com/bcongdon/PyManifold) - Python client for the Manifold API
- [PyManifold fork](https://github.com/gappleto97/PyManifold/) - Fork maintained by [@LivInTheLookingGlass](https://manifold.markets/LivInTheLookingGlass)
- [manifold-markets-python](https://github.com/vluzko/manifold-markets-python) - Python tools for working with Manifold Markets (including various accuracy metrics)
- [ManifoldMarketManager](https://github.com/gappleto97/ManifoldMarketManager) - Python script and library to automatically manage markets
- [manifeed](https://github.com/joy-void-joy/manifeed) - Tool that creates an RSS feed for new Manifold markets
- [manifold-sdk](https://github.com/keriwarr/manifold-sdk) - TypeScript/JavaScript client for the Manifold API
## Bots
- [@manifold@botsin.space](https://botsin.space/@manifold) - Posts new Manifold markets to Mastodon
- [James' Bot](https://github.com/manifoldmarkets/market-maker) — Simple trading bot that makes markets
- [mana](https://github.com/AnnikaCodes/mana) - A Discord bot for Manifold by [@arae](https://manifold.markets/arae)
## Writeups
- [Information Markets, Decision Markets, Attention Markets, Action Markets](https://astralcodexten.substack.com/p/information-markets-decision-markets) by Scott Alexander
- [Mismatched Monetary Motivation in Manifold Markets](https://kevin.zielnicki.com/2022/02/17/manifold/) by Kevin Zielnicki
- [Introducing the Salem/CSPI Forecasting Tournament](https://www.cspicenter.com/p/introducing-the-salemcspi-forecasting) by Richard Hanania
- [What I learned about running a betting market game night contest](https://shakeddown.wordpress.com/2022/08/04/what-i-learned-about-running-a-betting-market-game-night-contest/) by shakeddown
- [Free-riding on prediction markets](https://pedunculate.substack.com/p/free-riding-on-prediction-markets) by John Roxton
## Art
- Folded origami and doodles by [@hamnox](https://manifold.markets/hamnox) ![](https://i.imgur.com/nVGY4pL.png)
- Laser-cut Foldy by [@wasabipesto](https://manifold.markets/wasabipesto) ![](https://i.imgur.com/g9S6v3P.jpg)
## Alumni
_These projects are no longer active, but were really really cool!_
- [Research.Bet](https://research.bet/) - Prediction market for scientific papers, using Manifold
- [CivicDashboard](https://civicdash.org/dashboard) - Uses Manifold to for tracked solutions for the SF city government
Historically, Manifold used a special type of automated market marker based on a dynamic pari-mutuel (DPM) betting
system. Free response and numeric markets still use this system. Binary markets created prior to March 15, 2022 used
this system.
Binary markets created after March 15 use a constant-function market maker which holds constant the weighted geometric
mean, with weights equal to the probabilities chosen by the market creator at creation. This design was inspired by
Uniswap's CPMM and a suggestion from Manifold user Pepe.
# Basic facts
- Markets are structured around a question with a binary outcome.
- Traders can place a bet on either YES or NO and receive shares in the outcome in return.
- 1 YES share = M$1 if the event happens. 1 NO share = M$1 if the event does not happen.
- Notice that 1 YES share + 1 NO share = M$1. If you ever get multiple YES and NO shares, they will cancel out and you will be left with cash.
- When the market is resolved, you will be paid out according to your shares. If you own 100 YES shares, if the event resolves YES, you will earn M$100. (If the event resolves NO, you will earn M$0).
- The creator of each market is responsible for resolving each market YES or NO.
- Creators can also resolve N/A to cancel all transactions and return the money, or resolve to a particular probability (say 50%).
# Betting
- Betting on YES will increase the market’s implied probability; betting on NO will decrease the probability.
- Manifold's automated market automatically adjusts the market probability after each trade and determines how many shares a user will get for their bet.
- You can sell back your shares for cash. If you sell YES shares, the market probability will go down. If you sell NO shares, the probability will go up.
- Manifold charges fees on each trade. They are baked into the number of shares you receive.
- If you place a M$100 bet on YES when the probability is 50%, you may end up with 150 YES shares. These shares already include our fees. Notice also that when you buy, the probability goes up, so you are not getting in exactly at 200 shares or 50%.
- Our fee schedule is currently: 13% _ (1 - post-bet probability) _ bet amount
- The post-trade probability is what the market probability would be after your bet if there were no fees.
- Example:
- If you bet M$100 on NO and the resulting probability without fees would be 10%, then you pay M$100 _ 13% _ 10% = M$1.3.
- If you bet M$100 on YES and the resulting probability without fees would be 90%, then you pay `M$100 * 13% * 10% = M$1.3`.
- The fees are used to provide a commission to the market creator and to subsidize trading within the market.
- The market creator’s commission is paid out only after the market is resolved.
- No fees are levied on sales.
# Market creation
- Users can create a market on any question they want.
- When you create a market, you must choose an initial probability and a close date (after which trading will halt).
- You must also pay a M$ 50 market creation fee, which is used to subsidize trading on your market.
- You will earn a commission on all bets placed in your market.
- You are responsible for resolving your market in a timely manner. All the fees you earned as a commission will be paid out after resolution.
# Liquidity
- The liquidity in a market is the amount of capital available for traders to trade against.
- The more liquidity, the greater incentive there is for traders to bet, the more accurate the market will be.
- You can add liquidity to a market you are interested in to increase the incentives for traders to participate. You can think of added liquidity as a subsidy for getting your question answered.
- You can add liquidity to any market by opening up the market info popup window located in the (...) section of the header on the market page.
- For creating an awesome stats page which features and analyses various data sets! This can be found on the second tab of our [analytics page](https://manifold.markets/stats).
- For adding a bunch of charities to [Manifold for Good](https://manifold.markets/charity), working out market math with Austin, and excellent comment activity.
- For a variety of [open source code contributions](https://github.com/manifoldmarkets/manifold/commits?author=ForrestWeiswolf), making our code base easier to use and maintain.
- For responsible disclosure of an exploit involving liquidity withdrawal, which has [now been fixed](https://github.com/manifoldmarkets/manifold/pull/472)! Removing one infinite money glitch at a time.
- For spearheading the effort to [open-source Manifold](https://github.com/manifoldmarkets/manifold), by documenting our processes, triaging bugs, and improving the new contributor experience.
- Marshall contributed over 2 weeks of part-time volunteer work; as such, we are awarding an amount that reflects the extraordinary amount of effort he’s put in.
- For building and releasing https://github.com/vluzko/manifold-markets-python, a super cool Python visualization of the calibration accuracy of all Manifold markets. Turns out we’re doing okay!
- For writing up [Akhil’s Product Suggestions](https://www.notion.so/Akhil-s-Product-Suggestions-672e1cba393d4242852ff95ae79528df), an extensive, thoughtful list of improvements we could make to our platform.
**[Alex K. Chen](https://manifold.markets/AlexKChen): M$6,000**
- For the creation of a metric ton of innovative, long term questions. At the time of award, Alex was singlehandedly responsible for 20% of all markets posted in April.
- For the creation of [a focused set of questions on UK politics](https://twitter.com/TetraspaceWest/status/1516824123149848579), with relevant real-world predictions.
- For the idea and execution of using FR bounded buckets for mapping out a scalar range ([example market](https://manifold.markets/Tetraspace/if-ron-desantis-is-elected-presiden), [discussion here](https://manifold.markets/StephenMalina/how-many-daily-active-users-will-ma)).
- For identifying issues with our Dynamic Parimutuel Market Maker in an [excellent blog post](https://kevin.zielnicki.com/2022/02/17/manifold/) (and [associated market](https://manifold.markets/kjz/will-manifolds-developers-agree-wit)), leading us to change to a different mechanism.
- For developing the function used in our Constant Function Market Maker and working with us to polish it on Discord, making it easier for us to provision liquidity compared to a CPMM.
- For developing the function used in our Constant Function Market Maker, making it easier for us to provision liquidity compared to a CPMM.
- For concrete suggestions on Discord around improving our market maker algorithms, and creating useful graphs to make our different market makers more legible.
- For concrete suggestions around improving our market maker algorithms, and creating useful graphs to make our different market makers more legible.
- For [developing and publicizing the idea of providing interest-free loans on each market](https://astralcodexten.substack.com/p/play-money-and-reputation-systems), helping make long-term markets more accurate.
- For taking on the mantle of [@MetaculusBot](https://manifold.markets/MetaculusBot), which allows traders access to a wider spread of topics, and permits head-to-head comparisons between our prediction markets and other forecasting platforms.
- For [compiling a comprehensive FAQ](https://outsidetheasylum.blog/manifold-markets-faq/) that answers a variety of questions that new users commonly face, and also inspiring us to move to [this open-source docs platform](http://docs.manifold.markets/).
- For [compiling an FAQ](https://outsidetheasylum.blog/manifold-markets-faq/) that answers a variety of questions that new users commonly face, and also inspiring us to move to [this open-source docs platform](https://docs.manifold.markets/).
- For [calling out our mistake](https://manifold.markets/BlazingDarkness/was-it-an-unpleasant-surprise-when) in retroactively publicizing all market creator’s trades, leading us to revert this feature entirely.
- For [calling out our mistake](https://manifold.markets/BlazingDarkness/was-it-an-unpleasant-surprise-when) in retroactively publicizing the market creator’s trades, leading us to revert this feature entirely.
### Do I have to pay real money in order to participate?
Nope! Each account starts with a free M$ 1000. If you invest it wisely, you can increase your total without ever needing to put any real money into the site.
### What is the name for the currency Manifold uses, represented by M$?
Manifold Dollars, or mana for short.
Nope! Each account starts with a free 1000 mana (or M$1000 for short). If you invest it wisely, you can increase your total without ever needing to put any real money into the site.
### Can M$ be sold for real money?
No. Gambling laws put many restrictions on real-money prediction markets, so Manifold uses play money instead.
You can instead redeem your Mana and we will [donate to a charity](http://manifold.markets/charity) on your behalf. Redeeming and purchasing Mana occurs at a rate of M$100 to $1.
### How do the free response markets work?
Any user can enter a response and bet on it, or they can bet on on other people's responses. The response probabilities are weighted proportionally to how many people have bet on them. The market creator's ante goes into a "none of the above" pseudo-option that can't be bet on and can't be chosen as a correct answer when the market is resolved. (This means that free response markets tend to lose their creator almost their entire ante, whereas normal markets only lose them a small fraction that's proportional to how well they chose their starting odds. It also means that if there are only a finite number of options that could win, traders can make guaranteed money by investing in them all equally.) See[here](https://manifoldmarkets.substack.com/p/above-the-fold-milestones-and-new)for more information.
Any user can enter a response and bet on it, or they can bet on other people's responses. The response probabilities are weighted proportionally to how many people have bet on them. The market creator's ante goes into a "none of the above" pseudo-option that can't be bet on and can't be chosen as a correct answer when the market is resolved. (This means that free response markets tend to lose their creator almost their entire ante. It also means that if there are only a finite number of options that could win, traders can make guaranteed money by investing in them all equally.) See[here](https://manifoldmarkets.substack.com/p/above-the-fold-milestones-and-new)for more information.
### The payout probabilities I'm shown sometimes aren't right. For example if a market is at 15% and I bet M$1 on "no", it tells me that I'll make a 42% profit if I win, but the listed payout is just M$1. What's going on?
### The payout probabilities I'm shown sometimes aren't right. For example if a market is at 15% and I bet M$1 on "no", it tells me that I'll make a 42% profit if I win, but the listed payout is just M$1. What's going on?
Payout amounts are visually rounded to the nearest M$1, and only integer amounts can be put into markets. Behind the scenes however, your balance does track fractional amounts, so you're making a M$0.42 profit on that bet. Once you win another M$0.08, that fractional M$0.5 will display as an extra M$1 in your account. (There's no way to view your exact balance, you can only see the rounded value.)
Payout amounts are visually rounded to the nearest M$1, and only integer amounts can be put into markets. Behind the scenes however, your balance does track fractional amounts, so you're making a M$0.42 profit on that bet. Once you win another M$0.08, that fractional M$0.5 will display as an extra M$1 in your account. (There's no way to view your exact balance, you can only see the rounded value.)
### What are the rules about insider trading? (Using private information about a market to make a profit.)
@ -45,7 +43,7 @@ It's not only allowed, but encouraged. The whole point of a prediction market is
### Can I see who is buying/selling in a market?
Trading is anonymous by default. You'll only see their username if they leave a comment. As an exception, trading from the market's creator has their name attached.
All trades before June 1, 2022 are anonymous by default. Trades after that date can be viewed in the Bets tab of any market, and also on that user's profile.
## Creating and resolving markets
@ -63,12 +61,14 @@ A market being "closed" means that people can no longer place or sell bets, "loc
### What does "PROB" mean?
Resolving a market as "PROB" means that it's resolved at a certain probability, chosen by the market creator. PROB 100% is the same as "yes", and PROB 0% is the same as "no". For example, if a market is resolved at PROB 75%, anyone who bought "yes" at less than 75% will (usually) make a profit, and anyone who bought "yes" at greater than 75% will (usually) take a loss. Vice versa for "no".
Resolving a market as "PROB" means that it's resolved at a certain probability, chosen by the market creator. PROB 100% is the same as "yes", and PROB 0% is the same as "no". For example, if a market is resolved at PROB 75%, anyone who bought "yes" at less than 75% will (usually) make a profit, and anyone who bought "yes" at greater than 75% will (usually) take a loss. Vice versa for "no". This is also shown as "MKT" in the interface and API.
### What happens if a market creator resolves a market incorrectly, or doesn't resolve it at all?
Nothing. The idea is for Manifold Markets to function with similar freedom and versatility to a Twitter poll, but with more accurate results due to the dynamics of prediction markets. Individual market resolution is not enforced by the site, so if you don't trust a certain user to judge their markets fairly, you probably shouldn't participate in their markets.
That being said, manifold staff may manually send reminder emails to the creators of large markets if they have not been resolved in some time. There are also some projects in the works to enable automated market resolution after some time has passed.
### How do I tell if a certain market creator is trustworthy?
Look at their market resolution history on their profile page. If their past markets have all been resolved correctly, their future ones probably will be too. You can also look at the comments on those markets to see if any traders noticed anything suspicious. You can also ask about that person in the[Manifold Markets Discord](https://discord.gg/eHQBNBqXuh). And if their profile links to their website or social media pages, you can take that into account too.
@ -87,15 +87,15 @@ You'll get an automated email when they close. You can also go to your profile p
### When do market creators get their commission fees?
When the creator resolves their market, they get the commission from all the trades that were exectuted in the market.
When the creator resolves their market, they get the commission from all the trades that were executed in the market.
### How do I see markets that are currently open?
You can see the top 99 markets in various categories[here](https://manifold.markets/markets).
You can see the top markets in various categories[here](https://manifold.markets/markets).
### Can I bet in a market I created?
Yes. However if you're doing things that the community would perceive as "shady", such as put all your money on the correct resolution immediately before closing the market, people may be more reluctant to participate in your markets in the future. Betting "normally" in your own market is fine though.
Yes. However if you're doing things that the community would perceive as "shady", such as putting all your money on the correct resolution immediately before closing the market, people may be more reluctant to participate in your markets in the future. Betting "normally" in your own market is fine though.
## Miscellaneous
@ -103,6 +103,8 @@ Yes. However if you're doing things that the community would perceive as "shady"
Contact them via[email](mailto:info@manifold.markets), post in their[Discord](https://discord.gg/eHQBNBqXuh), or create a market about that bug/feature in order to draw more attention to it and get community input.
If you don't mind putting in a little work, fork the code and open a [pull request](https://github.com/manifoldmarkets/manifold/pulls) on GitHub.
### How can I get notified of new developments?
Being a very recent project, Manifold is adding new features and tweaking existing ones quite frequently. You can keep up with changes by subscribing to their[Substack](https://manifoldmarkets.substack.com/), or joining their[Discord server](https://discord.gg/eHQBNBqXuh).
@ -113,7 +115,7 @@ No, but the website is designed responsively and looks great on mobile.
Historically, Manifold used a special type of automated market maker based on a dynamic pari-mutuel (DPM) betting
system. Free response and numeric markets still use this system. Binary markets created prior to March 15, 2022 used
this system, but all of those markets have since closed.
Binary markets created after March 15 use a constant-function market maker which holds constant the weighted geometric
mean, with weights equal to the probabilities chosen by the market creator at creation. This design was inspired by
Uniswap's CPMM and a suggestion from Manifold user Pepe. The benefit of this approach is that the payout for any bet
is fixed at purchase time - 100 shares of YES will always return M$100 if YES is chosen.
Free response markets (and the depreciated numeric markets) still use the DPM system, as they have discrete "buckets"
for the pool to be sorted into.
## Market Creation
- Users can create a market on any question they want.
- When a user creates a market, they must choose a close date, after which trading will halt.
- They must also pay a M$100 market creation fee, which is used as liquidity to subsidize trading on the market.
- The market creator will earn a commission on all bets placed in the market.
- The market creator is responsible for resolving each market in a timely manner. All fees earned as a commission will be paid out after resolution.
- Creators can also resolve N/A to cancel all transactions and reverse all transactions made on the market - this includes profits from selling shares.
# Binary Markets
## Binary Markets: Overview
- Binary markets are structured around a question with a binary outcome, such as:
- [Will Bitcoin be worth more than $60,000 on Jan 1, 2022 at 12 am ET?](https://manifold.markets/SG/will-bitcoin-be-worth-more-than-600)
- [Will Manifold Markets have over $1M in revenue by Jan 1st, 2023?](https://manifold.markets/ManifoldMarkets/will-mantic-markets-have-over-1m)
- [Will we discover life on Mars before 2024?](https://manifold.markets/LarsDoucet/will-we-discover-life-on-mars-befor)
- Some binary markets are used as quasi-numeric markets, such as:
- [How many additional subscribers will my newsletter have by the end of February?](https://manifold.markets/Nu%C3%B1oSempere/how-many-additional-subscribers-wil)
- [How many new signups will Manifold have at the end of launch day?](https://manifold.markets/ManifoldMarkets/how-many-new-signups-will-manifold)
- [What day will US Covid deaths peak in February?](https://manifold.markets/JamesGrugett/what-day-will-us-covid-deaths-peak)
- These markets are made possible by the MKT option described below.
## Binary Markets: Betting & Payouts
- Traders can place a bet on either YES or NO and receive shares in the outcome in return.
- Betting on YES will increase the market’s implied probability; betting on NO will decrease the probability.
- Manifold's automated market automatically adjusts the market probability after each trade and determines how many shares a user will get for their bet.
- You can sell back your shares for cash. If you sell YES shares, the market probability will go down. If you sell NO shares, the probability will go up.
- 1 YES share = M$1 if the event happens. 1 NO share = M$1 if the event does not happen.
- Notice that 1 YES share + 1 NO share = M$1. If you ever get multiple YES and NO shares, they will cancel out and you will be left with cash.
- When the market is resolved, you will be paid out according to your shares. If you own 100 YES shares, if the event resolves YES, you will earn M$100. (If the event resolves NO, you will earn M$0).
- The creator of each market is responsible for resolving each market. They can resolve to YES, NO, MKT, or N/A.
- Resolving to MKT allows the creator to choose a percentage. The payout for any YES share is multiplied by this percentage, and vice versa for NO.
- For example, if a market resolves to MKT at 30%, if you have 100 shares of YES you will receive `M$100 * 30% = M$30`.
- In the same situation as above, if you have 100 shares of NO you will receive `M$100 * (100% - 30%) = M$70`.
- Note that even in this instance, 1 YES share plus 1 NO share still equals M$1.
## Binary Markets: Liquidity
- The liquidity in a market is the amount of capital available for traders to trade against. The more liquidity, the greater incentive there is for traders to bet, and the more accurate the market should be.
- When a market is created, the creation fee (also called the ante or subsidy) is used to fill the liquiity pool. This happens whether the creation fee is paid by the user or by Manifold for the daily free market.
- Behind the scenes, when a bet is placed the CPMM mechanism does [a bunch of math](http://bit.ly/maniswap). The end result is that for each M$1 bet, 1 YES share and 1 NO share is created. Some amount of shares are then given to the user who made the bet, and the rest are stored in the liquidity pool.
Due to this mechansim, the number of YES shares in the whole market always equals the number of NO shares.
- You can manually add liquidity to any market to increase the incentives for traders to participate. You can think of added liquidity as a subsidy for getting your question answered. You can do this by opening up the market info popup window located in the (...) section of the header on the market page.
- Adding liquidity provides you with a number of YES and NO shares, which can be withdrawn from the same interface. These shares resolve to M$ like normal when the market resolves, which will return you some amount of your investment.
- If the market moves significantly in either direction, your liquidity will become significantly less valuable. You are currently very unlikely to make money by investing liquidity in a market, it is a way to subsidize a market and encourage more people to bet, to achieve a more accurate answer.
- Adding liquidity to a market also makes it require more capital to move the market, so if you want to subsidize a market, first make sure the market price is roughly where you think it should be.
# Free-Response Markets
## Free-Response Markets: Overview
- Free-response markets are structured around a question with a multiple outcomes, such as:
- [Which team will win the NBA Finals 2022?](https://manifold.markets/howtodowtle/which-team-will-win-the-nba-finals)
- [Who will win "Top Streaming Songs Artist" at the 2022 Billboard Music Awards?](https://manifold.markets/Predictor/who-will-win-top-streaming-songs-ar)
- [What life improvement intervention suggested would I found most useful?](https://manifold.markets/vlad/what-life-improvement-intervention)
- Some free-response markets are used as quasi-numeric markets, such as:
- [What day will Russia invade Ukraine?](https://manifold.markets/Duncan/what-day-will-russia-invade-ukraine)
- [What will inflation be in March?](https://manifold.markets/ManifoldMarkets/what-will-inflation-be-in-march)
- [How many Manifold team members in the Bahamas will test positive for COVID?](https://manifold.markets/Sinclair/how-many-manifold-team-members-in-t)
## Free-Response Markets: Betting & Payouts
- Markets are structured around a list of answers, any of which can be bet on.
- When a Free Response market is created, the market creation fee goes into a hidden answer called the Ante and gets paid to the winner(s), to subsidize the market and create an incentive to bet. This happens whether the creation fee is paid by the user or by Manifold for the daily free market.
- This hidden answer is why a market's probabilities will not add up to 100%.
- If you want to further subsidize a market, it's customary to create an ANTE answer and put money in that.
- Anyone can add answers to a market as long as they stake some amount of M$ on it. Traders can place a bet on any answer and receive shares in the outcome in return.
- When a user places a bet, their M$ goes into the market's pool and they receive a certain amount of shares of the selected answer.
- When the market is resolved, you will be paid out according to your shares. If the creator resolves to answer #1, the entire pool is divided up amongst the users who bet on answer #1 proportional to their shares.
- The creator of each market is responsible for resolving each market. They can resolve to any single answer, or even multiple answers.
- Resolving to multiple answers allows the creator to choose a percentage for each selected answer (or distribute equally). The payout for any answer is taken from the amount of the total pool allocated to that answer.
- For example, let's take a free-response market with many answers. The pool for this market is $500, and you own 100 out of 500 total shares of answer #1.
- If the creator resolves to answer #1 only, you will receive `M$500 * (100 / 500) = M$100`.
- If the creator resolves 50% to answer #1 and 50% to answer #2, you will receive `(M$500 * 50%) * (100 / 500) = M$50`.
- Note that your payout is dependent on the total number of shares, and thus may decrease if more people buy shares in that answer.
# Fees
- Manifold charges fees on each trade. They are automatically calculated and baked into the number of shares you receive when you place a bet.
- Our CPMM fee schedule is currently: `10% * (1 - post-bet probability) * bet amount`
- Note that all current binary markets use this fee schedule.
- The post-bet probability is what the market probability would be after your bet if there were no fees.
- Example:
- If you bet M$100 on NO and the resulting probability without fees would be 10%, then you pay `M$100 * 10% * 10% = M$1.0`.
- If you bet M$100 on YES and the resulting probability without fees would be 50%, then you pay `M$100 * 10% * 50% = M$5.0`.
- 100% of this fee is used to provide a commission to the market creator, which is paid out after the market is resolved.
- Our DPM fee schedule is currently: `5% * (1 - post-bet probability) * bet amount`
- Note that all free-response markets use this fee schedule. The calculation for this is the same as above.
- 4% is used to provide a commission to the market creator, which is paid out after the market is resolved. 1% is "burnt" to prevent inflation.
- No fees are levied on sales. If you have existing shares in a binary market and buy shares on the opposite side, that is equivalent to selling your shares and you do not pay fees.
1. If you don't have java (or see the error `Error: Process java -version has exited with code 1. Please make sure Java is installed and on your system PATH.`): 0. `$ brew install java`
1. If you don't have java (or see the error `Error: Process java -version has exited with code 1. Please make sure Java is installed and on your system PATH.`):
2. `$ gcloud auth login` to authenticate the CLI tools to Google Cloud
3. `$ gcloud config set project <project-id>` to choose the project (`$ gcloud projects list` to see options)
4. `$ mkdir firestore_export` to create a folder to store the exported database
@ -32,10 +35,10 @@ Adapted from https://firebase.google.com/docs/functions/get-started
## Developing locally
0. `$ firebase use dev` if you haven't already
1. `$ yarn serve` to spin up the emulators 0. The Emulator UI is at http://localhost:4000; the functions are hosted on :5001.
Note: You have to kill and restart emulators when you change code; no hot reload =(
2. `$ yarn dev:emulate` in `/web` to connect to emulators with the frontend 0. Note: emulated database is cleared after every shutdown
0. `$ ./dev.sh localdb` to start the local emulator and front end
1. If you change db trigger code, you have to start (doesn't have to complete) the deploy of it to dev to cause a hard emulator code refresh `$ firebase deploy --only functions:dbTriggerNameHere`
- There's surely a better way to cause/react to a db trigger update but just adding this here for now as it works
2. If you want to test a scheduled function replace your function in `test-scheduled-function.ts` and send a GET to `http://localhost:8088/testscheduledfunction` (Best user experience is via [Postman](https://www.postman.com/downloads/)!)
## Firestore Commands
@ -51,13 +54,17 @@ Adapted from https://firebase.google.com/docs/functions/get-started
## Deploying
0. `$ firebase use prod` to switch to prod
1. `$ yarn deploy` to push your changes live!
0. After merging, you need to manually deploy to backend:
1. `git checkout main`
1. `git pull origin main`
1. `$ firebase use prod` to switch to prod
1. `$ firebase deploy --only functions` to push your changes live!
(Future TODO: auto-deploy functions on Git push)
## Secrets management
Secrets are strings that shouldn't be checked into Git (eg API keys, passwords). We store these using [Google Secret Manager](https://console.cloud.google.com/security/secret-manager), which provides them as environment variables to functions that require them. Some useful workflows:
- Set a secret: `$ firebase functions:secrets:set stripe.test_secret="THE-API-KEY"`
- Set a secret: `$ firebase functions:secrets:set STRIPE_APIKEY`
- Then, enter the secret in the prompt.
- Read a secret: `$ firebase functions:secrets:access STRIPE_APIKEY`
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.