* /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
2022-06-22 11:35:50 -05:00
641 changed files with 54498 additions and 19213 deletions
'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.',
"description":"I'm supposed to, or else Beeminder charges me $90.\nTentative topic ideas:\n- \"Manifold funding, a history\"\n- \"Markets and bounties allow trades through time\"\n- \"equity vs money vs time\"\n\nClose date updated to 2022-05-29 11:59 pm",
"tags":[
"personal",
"commitments"
@ -101,24 +148,26 @@ Requires no authorization.
// 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
outcomeType: string // BINARY, FREE_RESPONSE, or NUMERIC
outcomeType: string // BINARY, FREE_RESPONSE, MULTIPLE_CHOICE, NUMERIC, or PSEUDO_NUMERIC
mechanism: string // dpm-2 or cpmm-1
pool: number // sum of YES and NO shares in liquidity pool for CPMM, null for DPM
probability: number
p?: number // probability constant in y^p * n^(1-p) = k
totalLiquidity?: 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
@ -127,6 +176,9 @@ Requires no authorization.
isResolved: boolean
resolutionTime?: number
resolution?: string
resolutionProbability?: number // Used for BINARY markets resolved to MKT
"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.",
"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.",
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.
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
@ -8,15 +8,40 @@ A list of community-created projects built on, or related to, Manifold Markets.
## Sites using Manifold
- [CivicDashboard](https://civicdash.org/dashboard) - Uses Manifold to for tracked solutions for the SF city government
- [Research.Bet](https://research.bet/) - Prediction market for scientific papers, using Manifold
- [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
### 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.
- 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 creation fee for the first market created each day is provided by Manifold.
- 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.
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.