Commit Graph

918 Commits

Author SHA1 Message Date
Forrest Wolf
397d90c6b7
Replace some more uses of any with more specific types (#389)
* Give confirmation button icon a type

* Give setBids a type

* Make StripeSession type more specific

* Give MenuButton buttonContent a type
2022-06-02 17:40:41 -07:00
mantikoros
4fbc7703ce create page: remove numeric markets 2022-06-02 14:27:01 -05:00
Ian Philips
78a359407d
Notifications reverted ux (#386)
* Revert "Revert "Notifications ux fixes - wip (#383)""

This reverts commit 699b03eb42.

* <p>=><div>
2022-06-01 12:26:41 -06:00
Ian Philips
699b03eb42 Revert "Notifications ux fixes - wip (#383)"
This reverts commit b5057f4028.
2022-06-01 11:52:27 -06:00
Ian Philips
b5057f4028
Notifications ux fixes - wip (#383)
* Notifications generating on comment,answer,contract update

* Notifications MVP

* Submitted an answer => answered

* Listen for unseen notifications

* Fix userlink formatting, move page

* Fix links

* Remove redundant code

* Cleanup

* Cleanup

* Refactor name

* Comments

* Cleanup & update notif only after data retrieval

* Find initial new notifs on user change

* Enforce auth rules in db

* eslint update

* Code review changes

* Refactor reason

* Add todos

* Show question in notifiation title

* Allow larger width on md

* Condense on mobile

* Decrease padding, hide title on mobile

* Line clamp notifications

* Shrink text
2022-06-01 11:31:46 -06:00
TrueMilli
29a09ad276
Made an actual comment (#384) 2022-06-01 10:20:45 -07:00
Ian Philips
1c980ba678
Notifications (#354)
* Notifications generating on comment,answer,contract update

* Notifications MVP

* Submitted an answer => answered

* Listen for unseen notifications

* Fix userlink formatting, move page

* Fix links

* Remove redundant code

* Cleanup

* Cleanup

* Refactor name

* Comments

* Cleanup & update notif only after data retrieval

* Find initial new notifs on user change

* Enforce auth rules in db

* eslint update

* Code review changes

* Refactor reason
2022-06-01 07:11:25 -06:00
Marshall Polaris
7c4ec2a8e3
Refactor contract typing to be more concise and more correct (#355)
* Refactor contract types slightly

* Refactor contract types greatly

* Kill dead binary DPM contract creation code

* Use BinaryContract, DPMContract, etc. type aliases
2022-05-31 19:42:35 -07:00
James Grugett
9cb24c9f3c Make categories work when signed out 2022-05-31 21:23:36 -05:00
Sinclair Chen
6106eeee95 copyedit: donations available after May 2022-05-31 13:23:01 -07:00
Austin Chen
3bc4e7b336 Embed @wasabipesto's charts on /analytics 2022-05-31 08:32:11 -07:00
Forrest Wolf
1e0845f4b9
Replace some uses of any with more specific types (#344)
* Add tsconfig.json for common

* Prefer `const` over `let` over `var`

* Kill dead code

* Fix some trivial Typescript issues

* Turn on Typescript linting in common except for no-explicit-any

* Correctly specify tsconfig dir name in functions eslintrc

* Give react children explicit types

* Add explicit types to removeUndefinedProps

* Create StripeSession type

* Give event in Dropdown an explicit type

* Revert "Give event in Dropdown an explicit type"

This reverts commit 80604310f2.

* Give bids in NewBidTable an explicit type

* Cast results of removeUndefinedProps when neccessary

* Fix type of JoinSpans

* Revert "Cast results of removeUndefinedProps when neccessary"

This reverts commit 5541617bc8.

* Revert "Add explicit types to removeUndefinedProps"

This reverts commit ccf8ffb0b5.

* Give React children types everywhere

* Give event a type

* Give event correct type

* Lint

* Standardize React import

Co-authored-by: Marshall Polaris <marshall@pol.rs>
2022-05-26 15:22:44 -07:00
Marshall Polaris
420ea9e90e
Add more linting to web package (#343)
* Import React a lot

* Fix misc. linting concerns

* Turn on many recommended lints for `web` package
2022-05-26 14:41:24 -07:00
Marshall Polaris
5217270073
Serious business API validation & big cleanup of createContract, placeBet (#302)
* Add the great Zod as a dependency to help us

* Tweak eslint

* Rewrite a ton of stuff in createContract and placeBet

* Clean up error reporting in API

* Make sure the UI is enforcing validated limits on lengths

* Remove unnecessary Math.abs

* Better type on `BetInfo`

* Kill `manaLimitPerUser`

* Clean up hacky parameters on bet info functions

* Validate `closeTime` as a valid timestamp in the future
2022-05-26 14:37:51 -07:00
Austin Chen
eb68d059e2 Extend analytics to 90 days 2022-05-25 19:22:50 -07:00
Marshall Polaris
b8b1c0d056
Add tsconfig, more linting to common package (#324)
* Add tsconfig.json for common

* Prefer `const` over `let` over `var`

* Kill dead code

* Fix some trivial Typescript issues

* Turn on Typescript linting in common except for no-explicit-any

* Correctly specify tsconfig dir name in functions eslintrc
2022-05-25 17:12:36 -07:00
Ian Philips
d117ff600a Adjust spacing on % input 2022-05-25 12:47:44 -06:00
Ian Philips
959ee5f8d1
Improve create market UI (#336)
* Move to tailwindui

* Remove commented code

* Prettier

* Show custom prob toggle, limit to 5-95%

* match left margin

* Show prob, date, time, other ui changes

* fix for firefox
2022-05-25 12:13:51 -06:00
Ian Philips
d69f4f9a0a
Move to tailwindui for create market page (#332)
* Move to tailwindui

* Remove commented code

* Prettier

* Show custom prob toggle, limit to 5-95%

* match left margin

* Show prob, date, time, other ui changes
2022-05-25 11:54:28 -06:00
Marshall Polaris
2d8ad40e70
Add outcome type to API market descriptors (#325) 2022-05-24 14:31:49 -07:00
mantikoros
c3be126337
Revert "Update leaderboards.tsx (#314)" (#317)
This reverts commit d19d60eb6a.
2022-05-24 09:31:42 -05:00
SirSaltyy
d19d60eb6a
Update leaderboards.tsx (#314)
Renamed top creators header from "market volume" to "market liquidity".
2022-05-24 14:05:12 +01:00
Ian Philips
fc320ca1e4
Shrink avatar, paddding, gaps for mobile screens (#275)
* Shrink avatar, paddding, gaps for mobile screens

* Adjust padding, add arrow to input area

* Padding and reply ui adjustments
2022-05-23 16:09:40 -06:00
Marshall Polaris
3987baa11b
Add Vercel routes for public write API (#280)
* Improve typing of client CORS helper

* Take node-fetch as a dependency

* Add explicit Firebase region into config

* Add new Vercel proxy API routes that talk to backend

* Call Vercel proxy routes from `api-call` module

* Tweak import to try to get Vercel happy

* Tidy up a tiny bit
2022-05-23 14:16:56 -07:00
Ian Philips
d0347ff5c2
Add countdown timer for daily free market (#276)
* Add countdown timer for daily free market

* Reset example numbers

* Remove daily

* Free market reset => 4pm UTC
2022-05-23 08:43:11 -06:00
Ian Philips
355b2261a7 Show numeric bet panel between sm-xl 2022-05-23 08:04:55 -06:00
Ian Philips
e94d204a87
Simplify market creation page (#268)
* Simplify market creation page

* Minor improvements

* Prettier
2022-05-23 06:35:50 -06:00
James Grugett
21527275d1 Fix numeric market embeds 2022-05-22 22:03:05 -05:00
James Grugett
f85b10e517 Exclude partial day from analytics 2022-05-22 17:35:10 -05:00
Marshall Polaris
d072216d2d
Kill /about page (#293) 2022-05-22 12:40:16 -07:00
Marshall Polaris
47f10301c8
Change lodash stuff so that it can be tree-shaken out of build (#233)
* Set common package.json sideEffects: false

* Configure SWC to modularize lodash imports

* Import specific lodash functions instead of _

* Add an eslint rule to avoid full lodash import
2022-05-22 01:36:05 -07:00
Marshall Polaris
540476f65a
Public API improvements (#266)
* Remove needless wrappers from API requests and responses

* Return real HTTP status codes instead of status field

* More robustly handle API errors

* Fix broken error handling in NumericResolutionPanel warmup
2022-05-20 14:58:14 -07:00
Austin Chen
52ad4c42b0 Persist homepage sort 2022-05-20 15:08:00 -04:00
Austin Chen
5d96fdafd6 Add padding to homepage 2022-05-20 13:53:12 -04:00
Sinclair Chen
4c7836abc7
Show embed view of normal market links in iframes (#254) 2022-05-19 17:34:08 -07:00
Marshall Polaris
20f4b97d8b
Rewrite client for new public APIs to use fetch instead of callables (#241)
* Rename `lib/firebase/api-call` -> `lib/firebase/fn-call`

This relieves ambiguity now that we will be using our actual
public API in the client.

* Rewrite client API calls to createContract, placeBet

* Tiny fixup for client market creation code
2022-05-19 15:04:34 -07:00
James Grugett
d4a49789d1 Add daily signups 2022-05-19 17:13:30 -04:00
James Grugett
a275b3a9c2 Fix analytics 2022-05-19 16:53:49 -04:00
James Grugett
4396456ed1 Add tooltip to analytics charts 2022-05-19 16:14:27 -04:00
James Grugett
76f27d1a93
Numeric range markets!! (#146)
* Numeric contract type

* Create market numeric type

* Add numeric graph (coded without testing)

* Outline of numeric bet panel

* Update bet panel logic

* create numeric contracts

* remove batching for antes for numeric markets

* Remove focus

* numeric market range [1, 100]

* Zoom graph

* Hide bet panels

* getNumericBets

* Add numeric resolution panel

* Use getNumericBets in bet panel calc

* Switch bucket count to 100

* Parallelize ante creation

* placeBet for numeric markets

* halve std of numeric bets

* Update resolveMarket with numeric type

* Set min and max for contract

* lower std for numeric bets

* calculateNumericDpmShares: use sorted order

* Use min and max to map the input

* Fix probability calc

* normpdf variance mislabeled

* range input

* merge

* change numeric graph color

* fix getNewContract params

* bet panel labels

* validation

* number input

* fix bucketing

* bucket input, numeric resolution panel

* outcome label

* merge

* numeric bet panel on mobile

* Make text underneath filled green answer bar selectable

* Default to 'all' feed category when loading page.

* fix numeric resolution panel

* fix numeric bet panel calculations

* display numeric resolution

* don't render NumericBetPanel for non numeric markets

* numeric bets: store shares, bet amounts across buckets in each bet object

* restore your bets for numeric markets

* numeric pnl calculations

* remove hasUserHitManaLimit

* contrain contract type

* handle undefined allOutcomeShares

* numeric ante bet amount

* use correct amount for numeric dpm payouts

* change numeric graph/outcome color

* numeric constants

* hack to show correct numeric payout in calculateDpmPayoutAfterCorrectBet

* remove comment

* fix ante display in bet list

* halve bucket count

* cast to NumericContract

* fix merge imports

* OUTCOME_TYPES

* typo

* lower bucket count to 200

* store raw numeric value with bet

* store raw numeric resolution value

* number input max length

* create page: min, max to undefined if not numeric market

* numeric resolution formatting

* expected value for numeric markets

* expected value for numeric markets

* rearrange lines for readability

* move normalpdf to util/math

* show bets tab

* check if outcomeMode is undefined

* remove extraneous auto-merge cruft

* hide comment status for numeric markets

* import

Co-authored-by: mantikoros <sgrugett@gmail.com>
2022-05-19 12:42:03 -05:00
James Grugett
6a30a41b10 Make analytics show data up to current hour 2022-05-18 18:53:53 -04:00
Austin Chen
f17675bbcf Fix typo 2022-05-18 12:07:36 -04:00
Austin Chen
39870dd933
Bets on profile, again (#251)
* Revert "Revert "Show every user's bets on their profile (#170)""

This reverts commit 142206b79a.

* Fix typo

* Delete portfolio page
2022-05-18 11:52:12 -04:00
James Grugett
142206b79a Revert "Show every user's bets on their profile (#170)"
This reverts commit d50cc39c27.
2022-05-18 10:59:08 -04:00
Boa
7b3c21cf98
Comments ux improvements and bugfixes (#246)
* Show majority stake on comments

* Darken comment input text

* Fix old FR comments displayed in general section

* Refactor feed comments and bets into files

* Only allow user to comment on most recent bet

* Fix overlapping sign in to comment

* Only calculate current users bets once

* Minor tweaks & is betting @ prob
2022-05-18 08:42:13 -06:00
Austin Chen
d50cc39c27
Show every user's bets on their profile (#170)
* Show user bets on their profile

* Add an alert for current users

* Replace `/portfolio` with `/Austin?tab=Bets`

* Replace `/Austin?tab=Bets` with `/Austin/bets`

* Use replaceState for better browser history

* Remove two console.logs

* Note a bug

* Fix path

* Write in description of why we're doing this
2022-05-18 10:36:17 -04:00
James Grugett
7da46050e5
Swap home and explore (#244)
* Add activity page. Copy explore page into home

* Update navbar with activity. Show explore instead if signed out.

* Move category selector into contract search

* Make algolia filter by category

* Default tag page to all filter
2022-05-17 12:56:10 -05:00
Sinclair Chen
f8601af45c
Bet embed (#204)
* Add bet buttons to embed

- Make only title link to market
- Prevent avatar / username from being clicked on

* refactor: remove extra elem, de-indent

* adjust embed info row styles

* make bet panel smaller

* make sell panel smaller
2022-05-17 10:31:19 -07:00
mantikoros
b98468c7ea show none option in categories 2022-05-17 12:02:46 -04:00
Austin Chen
a3c1cd2cc1 Unhardcode M$ in more locations 2022-05-17 08:17:22 -04:00
Marshall Polaris
cd7efb03ca
Implement onRequest versions of createContract, placeBet functions (#227)
* Reimplement createContract and placeBet cloud functions

* Fix broken warmup function error handling
2022-05-16 21:43:40 -07:00
Marshall Polaris
72b21925e5
Allow users to generate an API key in their profile (#182)
* Add /private-users/apiKey to DB

* Add field to edit API key on profile

* Move API key to bottom of profile page

Austin thinks this is better since most people don't care about it.
2022-05-15 20:41:07 -07:00
James Grugett
19da0c6c82 Default to 'all' feed category when loading page. 2022-05-15 23:09:49 -04:00
James Grugett
c85b806bc1 Change analytics to 45 days instead of 90 to fix timeout 2022-05-15 15:50:28 -04:00
Marshall Polaris
07ded756d9
Remove unused imports from random files (#224) 2022-05-13 18:30:52 -07:00
Marshall Polaris
33c0471c29
Clean up some markup around the top of the page (#189)
* Remove unnecessary wrapper div around sidebar

* Remove extra column used for alignment on homepage

* Remove extra wrapper div around whole page
2022-05-13 16:47:50 -07:00
Marshall Polaris
babca140f1
Fix random errors (#205)
* Fix warning in ShareMarket component

* Fix NewContract component to use keys on category list

* Refactor NewContract component to assign `value` to `select`
2022-05-13 16:42:48 -07:00
James Grugett
e660acab56 Put back hotjar code, but deactivate from hotjar site 2022-05-13 15:07:32 -04:00
James Grugett
b195dcdfd2 Print build info only once 2022-05-13 14:33:02 -04:00
James Grugett
5f59623be8 Disable hotjar 2022-05-13 14:31:03 -04:00
Austin Chen
805a997ba0 Fix hotjar typo
Copy+pasting is hard >.>
2022-05-13 10:59:47 -04:00
Austin Chen
bf07b45467 Add id to hotjar script
Apparently needed by NextJS
2022-05-13 10:49:01 -04:00
Austin Chen
c99cf7579b Try out Hotjar 2022-05-13 10:11:57 -04:00
mantikoros
9a4e5763f5
Categories (#132)
* basic market categories

* use tags to store market category

* display category in market

* display full category

* category selector component on feed

* Move feed data fetching to new file

* Decrease batch size for updating feed to prevent out-of-memory error

* Compute and update category feeds!

* Show feeds based on category tabs

* Add react-query package!

* Use react query to cache contracts

* Remove 'other' category

* Add back personal / friends to feed categories

* Show scrollbar temporarily for categories

* Remove 5 categories, change geopolitics to world

* finance => economics

* Show categories on two lines on larger screens

Co-authored-by: James Grugett <jahooma@gmail.com>
2022-05-12 10:07:10 -05:00
Boa
02ed9bf7e1
Single threaded comments (#175)
* Remove unused hideOutcome in comments

* Remove unused hideOutcome in comments

* Add replyToComment fields to Comment

* Add 1 threaded replies to comments & answers

* Allow smooth scrolling within pages via #

* remove yarn-error log

* correct spelling

* Remove smooth-scroll-to-hashtag component

* Cleanup & show user position/bets in replies
2022-05-11 15:11:46 -06:00
Marshall Polaris
b55e807c62
Truncate multi-line commit messages in console build info (#180) 2022-05-10 21:12:00 -07:00
Marshall Polaris
22c594eb79
Print out build info in console (#179)
* Print out build info in console

* Fix up build info printing per feedback
2022-05-10 20:57:09 -07:00
Marshall Polaris
9b376fb11a
Reinstate eslint warning cleanup (#174)
* Reinstate eslint upgrade and related fixes

* Another shot at improving ContractLeaderboard
2022-05-10 14:49:24 -07:00
Marshall Polaris
4565430db5 Revert "Upgrade eslint, fix eslint warnings (#149)"
It's not 100% clear, but this could have caused some production
problems on the contract page, so let's revert it for now.
2022-05-10 14:22:57 -07:00
Marshall Polaris
167cf20bfc
Upgrade eslint, fix eslint warnings (#149)
* Add a couple missing dependencies for hooks

* Upgrade eslint

This newer eslint and typescript-eslint fixes some spurious warnings
that were bugs and supports our version of Typescript.

* Use Next Script component the way it wants us to

* Rephrase ContractLeaderboard component to avoid useEffect woes

* Use perhaps more idiomatic type for ContractLeaderboard props

* Make Folds data fetching more correct and more clear
2022-05-10 13:58:38 -07:00
Sinclair Chen
a297f6492d
move manaToUSD to format.ts (#172) 2022-05-10 11:14:24 -07:00
Austin Chen
b97301c6fa Hardcode two new frontpage markets 2022-05-10 13:03:53 -04:00
mantikoros
264e5058ea
Separate out fees (#169)
* deduct market ante from profits

* display creator fees in stats

* show creator earnings in stats

* separate out creator, liquidity fees in payouts and deduct from profits

* include creator payout in resolution emails

* deduct liquidity from profits

* hide cost tooltip if daily free market
2022-05-10 08:49:14 -05:00
James Grugett
e8ab863557
🔍 Algolia search (#136)
* Add algolia and instantsearch packages

* Switch to hooks-web package

* Implement algolia search!

* Fix types

* Fix tags page

* Closed sort option

* Implement select for filtering on open, closed, resolved, all.

* Support search in dev environment

* Fix runtime error in landing page
2022-05-09 12:38:33 -05:00
Marshall Polaris
acc9c84e2e
More absolute imports (#156)
* Configure functions module to allow absolute imports

* Convert common imports in functions to be absolute

* Convert common imports in web to be absolute

* Convert lib imports in web to be absolute

* Convert hooks imports in web to be absolute

* Convert components imports in web to be absolute
2022-05-09 09:04:36 -04:00
Marshall Polaris
5efcf61289
Configure compiler to allow absolute imports from root (#147) 2022-05-08 13:33:58 -07:00
Austin Chen
2eed1c432a Hardcode in 8 frontpage markets 2022-05-07 19:44:01 -04:00
Austin Chen
cea9422802 Update site copy 2022-05-07 10:10:25 -04:00
James Grugett
4de0fcd198 Revert "Represent DB avatar URLs as non-null (#128)"
This reverts commit bf8e09b6c1.
2022-05-06 14:29:15 -04:00
SirSaltyy
e41f646b42
Remove all spaces between M$ and the associated number (#134)
* Remove all spaces between M$ and the associated number

* Update index.tsx
2022-05-05 22:19:47 -04:00
Boa
bbf419953e
Show comments on profile (#137)
* WIP - got comments on the user page

* Remove number from chosen FR answer

* Distinguish wining and losing FR answers

* Show no answers text

* Simplify get answer items logic

* Show answer number

* Show answer # when resolving

* Fix import path

* Add user's collated comments onto profile

* Allow linking to comments/markets in profile

* Allow preload of users contracts in profile

* Remove unused check

* Small code improvements
2022-05-05 16:30:30 -06:00
Austin Chen
b42e77858f Search through charity preview, description, and tags too 2022-05-05 10:12:16 -04:00
Marshall Polaris
bf8e09b6c1
Represent DB avatar URLs as non-null (#128) 2022-05-04 11:07:22 -07:00
Ian Philips
a004d3a4bf Always show answer panel 2022-05-03 17:54:00 -04:00
Ian Philips
278bcb9724 Show resolved FR answers 2022-05-03 16:57:39 -04:00
Sinclair Chen
f2217d1d8b
Improve donate box UI in mid-size window (#126) 2022-05-03 13:36:00 -07:00
Sinclair Chen
abf23a1462
Pre-load charity order to prevent "jump" (#122) 2022-05-03 10:25:14 -07:00
mantikoros
14544d064a charity page: remove centering 2022-05-03 11:26:02 -04:00
Sinclair Chen
3434b3de3f
Move all charity images to imgur + Next (#120) 2022-05-03 07:00:33 -07:00
James Grugett
ab4dbc798c Change analytics to 90 days. Default to DAU / MAU chart instead of DAU / WAU. 2022-05-02 18:18:42 -04:00
Sinclair Chen
2f6a3c4e00
Replace email with free response market (#118) 2022-05-02 12:48:15 -07:00
Sinclair Chen
db695875c4
CPM: sort charities by amount raised (#117)
* Sort charities by amount raised (after Featured)

* Sort donations chronologically

* refactor charities query to remove parens
2022-05-02 10:55:40 -07:00
James Grugett
6232284e92 Larger font on amount input 2022-05-02 12:15:00 -04:00
Sinclair Chen
fdbcffcfbc
CPM simple feed (#116)
* Add minimal feed

* Display full cent amount for raised < $1
2022-05-02 08:23:12 -07:00
James Grugett
06b7e49e98
[In progress] Server-side feed computation (#106)
* Store view counts & last viewed time

* Schedule updating user recommendations. Compute using tf-idf.

* Update contract's lastBetTime and lastCommentTime on new bets and comments.

* Remove contract's lastUpdatedTime

* Remove folds activity feed

* Implement getFeed cloud function

* Hook up client to use getFeed

* Script to cache viewCounts and lastViewTime

* Batched wait all userRecommendations

* Cache view script runs on all users

* Update user feed each hour and get feed from cache doc.

* Delete view cache script

* Update feed script

* Tweak feed algorithm

* Compute recommendation scores from updateUserFeed

* Disable lastViewedScore factor

* Update lastCommentTime script

* Comment out console.log

* Fix timeout issue by calling new cloud functions with part of the work.

* Listen for contract updates to feed.

* Handle new user: use default feed of top markets this week

* Track lastUpdatedTime

* Tweak logic of calling cloud functions in batches

* Tweak cloud function batching
2022-05-01 11:36:54 -05:00
Austin Chen
bbc8915f79 Clean up prediction market on charities 2022-04-30 17:42:08 -04:00
Austin Chen
53a584f37d Add in LTFF, ARC, RC 2022-04-30 17:35:10 -04:00
Marshall Polaris
731e5d5b7c
Apply permissive CORS headers to API (#115)
* Take cors package as dependency

* Apply permissive CORS headers to all API routes
2022-04-30 13:30:49 -07:00
mantikoros
a3311bd5aa embed total donations market on charity page 2022-04-30 16:27:19 -04:00
Austin Chen
f5e5af0b7a Revert "bound initial probability to [0.1, 0.9]"
This reverts commit da153ceea9.
2022-04-30 13:05:43 -04:00
Austin Chen
ccd0e42734 Revert "give@ isn't set up, use info@"
This reverts commit d2218b5b8b.
2022-04-30 11:19:20 -04:00
Austin Chen
d2218b5b8b give@ isn't set up, use info@ 2022-04-30 09:45:24 -04:00
Austin Chen
5c03f1581a Fix lowercase search, tweak copy 2022-04-30 08:42:25 -04:00
Austin Chen
774ba6fba6 Show confetti on donate 2022-04-30 08:18:25 -04:00
Austin Chen
c51aa0b6b4 Simpify Donate panel 2022-04-30 08:13:38 -04:00
Austin Chen
bd98e8810e Disable "Read more..." for now 2022-04-30 08:09:57 -04:00
James Grugett
3bb4111445 Make charity cards extend same length in row. Tweak image padding 2022-04-29 23:55:32 -04:00
Austin Chen
78e8927de4
Image preview: truncate to 100 chars, show avatar url (#111)
* Truncate image preview to 120 chars

* Try 100 chars instead

* Pass along creatorAvatarUrl

Hoping nothing breaks if the avatarUrl is empty

* Thread through avatarUrl all the way

* Fix typescript
2022-04-29 19:38:31 -04:00
Sinclair Chen
73fc67955d
Send M$ to Charity & txns (#81)
* Add components for CPM landing and charity pages

* Remove misc.ts to fix build

* Set up cloud function for writing txns

* More plumbing for txns

* Fix up API call

* Use Date.now() to keep timestamps simple

* Some styles for charity list page

* Hard code charities data

* Pass charity data to charity page

* Update txn type

* Listen for charity txns

* Handle txn to non-user by burning it

* Read txns for charity card and charity page.

* Set images to object contain

* Clean up txn types

* Move pic to top of card. Other misc styling.

* Update charity short & long descriptions

* Add `token` and `category` to Txn

* Fix breakages

* Show Charity link in the sidebar

* Fix typing issues

* Fix not reading from the right type

* Switch out icon

* Also show Charity icon on mobile

* Update copy

Co-authored-by: Austin Chen <akrolsmir@gmail.com>
Co-authored-by: James Grugett <jahooma@gmail.com>
2022-04-29 19:35:56 -04:00
Boa
78997c1e45
Show comments position (#110)
* Add betting activity back to feed

* Show position in bin. markets, no comments on bets

* Degroup bets on Bets tab

* Show users position or recent bet with comments

* Add tooltip on answer to FR comments

* Style improvements

* Only use bets by current user for comment input
2022-04-29 15:11:04 -06:00
James Grugett
fa8ebe36bd Move loading indicator into SearchableGrid. 2022-04-29 10:05:32 -04:00
James Grugett
7e9007aad1 Fetch markets client side on explore page (to avoid vercel 5MB limit for static props) 2022-04-29 09:53:51 -04:00
Ian Philips
ca8420d61b Allow free daily market with M-zsh 2022-04-29 07:38:46 -06:00
Marshall Polaris
2ddd95e904
Make tags page filter on server side (#108) 2022-04-28 22:39:39 -07:00
Boa
4ec59be46f
Free daily market (#107)
* Allow users a free daily market

* Show confetti on recent created market

* remove unused import

* remove comment

* Did create market -> hook, capitalize buttons

* Check for confetti with interval

* Just check once

* Capitalize create market button on feed
2022-04-28 17:01:50 -06:00
mantikoros
da153ceea9 bound initial probability to [0.1, 0.9] 2022-04-28 10:47:18 -04:00
mantikoros
5a5069a419 sitemap: market changefreq; homepage priority = 1 2022-04-27 13:47:51 -04:00
mantikoros
e926741177 sitemap: remove non-public pages; sort by 24hr volume; make market page priority depend on volume 2022-04-27 13:40:02 -04:00
Ian Philips
9fbd521732 Top traders -> Top bettors 2022-04-26 08:42:45 -06:00
Boa
7b70b9b3bd
Free comments (#88)
* Allow free comments with optional bets

* Send emails for comments without bets

* Refactor to share logic

* No free comments on free response questions

* Minor fixes

* Condense line
2022-04-21 11:09:06 -06:00
James Grugett
c592a3ab59 Fix type error take 2 2022-04-20 01:04:53 -05:00
James Grugett
987e36c357 Fix type error 2022-04-19 22:36:19 -05:00
Marshall Polaris
30d92becd6
Kill allowTransparency on 404 Discord widget (#84) 2022-04-19 21:42:04 -05:00
James Grugett
190a39b2d6 Autofocus question input on /create page 2022-04-19 11:04:07 -05:00
James Grugett
e8e19e0e5d Add monthly retention (code suggested by co-pilot) 2022-04-19 01:57:27 -05:00
James Grugett
3c6369726e Add weekly activiation rate 2022-04-19 01:47:58 -05:00
James Grugett
a6e6e2f52f Include top answer in answer card. 2022-04-18 21:44:31 -05:00
James Grugett
9c74f88b4a
Improve Free response UI (#78)
* Add legend to free response graph

* Hide answers panel unless resolving. Correctly order answers

* No gray background for add answer & resolve panel. Tweak spacing

* Max answer length 240 chars

* Show answer text in resolution for market page, card instead of number.

* Remove remaining answer #'s. Refactor outcome/resolution labels.

* Move answer panel back up

* Tweak spacing

* Update placement of bet button on mobile for FR answer feed item

* Fix reversed feed for binary markets

* Show multi resolve options

* Clean up unused parts of answer item

* Lighten resolve buttons

* Show answer text in market resolve email
2022-04-18 18:02:40 -05:00
James Grugett
b637ab1536 Analytics: Add ratios of daily, weekly, monthly active users 2022-04-15 20:56:07 -05:00
Austin Chen
624d99fc1d Show number of traders in "More" panel 2022-04-13 12:11:49 -07:00
James Grugett
75b39cbf6f Remove loans: no new loans 2022-04-13 12:52:12 -05:00
James Grugett
4268e03293 Redirect to contract page if home loads initially with query params 2022-04-12 23:11:10 -05:00
James Grugett
e53cde5b34 Quick back navigation into feed 2022-04-11 16:13:26 -05:00
mantikoros
ea07edcbd3 add funds: remove M$500 purchase option 2022-04-09 18:56:05 -05:00
James Grugett
ec49a73c74
Algo feed (#77)
* Implement algo feed

* Remove 'See more...' from feed items

* Fix problem with useUpdatedContracts.

* Tweak some params
2022-04-09 18:10:58 -05:00
mantikoros
2fe71731e4 create: fixed ante of $100 2022-04-09 13:51:22 -05:00
mantikoros
ab41404d07
contract tabs: separate market timeline from your trades (#76)
* contract tabs: separate market timeline from your trades

* contract tabs: use pre-existing tab component

* tab styling
2022-04-08 16:13:10 -05:00
James Grugett
f773a59676 FR: Move description above answers 2022-04-07 16:19:27 -05:00
James Grugett
aff6acc8f4 Refactor contract components into contract directory 2022-04-07 16:15:51 -05:00
James Grugett
5e8decfa4e Move tweet, embed buttons plus communities and tags into a market info dialog 2022-04-07 15:52:54 -05:00
mantikoros
7e6545a669 app: viewport meta tag to prevent Safari from automatically zooming in 2022-04-06 22:54:44 -05:00
James Grugett
a2344492a2 Simplify useContractWithPreload 2022-04-06 13:56:08 -05:00
mantikoros
e3800612ea "A market for every question" 2022-04-06 13:20:16 -05:00
James Grugett
8ccf834724 Fix url link to fold page tab: markets and leaderboard 2022-04-04 13:28:33 -05:00
mantikoros
18bba89507 raise min ante to M$50 2022-04-04 10:47:29 -05:00
mantikoros
9c11104110 create panel: remove add tags section 2022-04-04 10:32:04 -05:00
James Grugett
6d25494713 Add Manifold Markets logo on signed out home. 2022-04-04 00:45:23 -05:00
James Grugett
20db898753 Home: remove tabs for Recent activity vs Explore 2022-04-04 00:27:25 -05:00
James Grugett
6ce53a4418 Only show one of bet panel or bet row. Bring back sticky bet panel & sidebar 2022-04-03 18:43:30 -05:00
James Grugett
9420b10bd9 Fix overlapping bet panel 2022-04-03 16:57:38 -05:00
James Grugett
d7b702fe00 Portfolio page! Add to sidebar when signed in, move about into more. 2022-04-03 15:48:25 -05:00
Austin Chen
34e7a27125
Standardize on a single Tabs component (#72)
* Extract out Tabs component

* Use tabs component on /home

* Use Tabs on Fold pages too
2022-03-30 23:24:35 -07:00
Austin Chen
75e48204ef
Add left sidebar (with mobile support this time) (#71)
* Revert "Reverting side navbar for now"

This reverts commit a90441d9d5.

* Use padding instead of margin for bg color

* Use a slideout menu on mobile

* Remove "wide" page option

* Stick right sidebar on page bottom

* Darken bg on hover
2022-03-30 22:35:20 -07:00
James Grugett
a90441d9d5 Reverting side navbar for now 2022-03-30 22:51:15 -05:00
Austin Chen
5c12da140d
Add a left sidebar on desktop (#70)
* Copy in nav from TailwindUI

* Split up nav files

* Hook up sidebar options to the current page

* Tweak padding

* Insert a right sidebar on folds & contracts

* Keep column always centered

* Remove markets and folds from top navbar

* Extract out sidebaricon; link to /about

* Rename to "useFollowedFoldIds"

* Cache followed folds in localstorage

* Remove unused mobile sidebar (for now)

* Remove unused code

* Remove sidebar from landing page

* Tweak resolution panel styling

* Remove the top navbar entirely

* Completely remove the old navbar

* Add "more" and profile link

* Rearrange sidebar ordering

* Remove unused component

* Add Sign In button for logged-out users

* Remove extra options for signed-out users
2022-03-30 16:56:51 -07:00
James Grugett
ed5f69db7a
Sell shares panel (#69)
* Split BuyAmountInput out of AmountInput

* Buy and sell tabs. Compute some sell info

* In progress

* BuyPanel & SellPanel with banner above that shows current shares and toggle button

* Remove "Remaining balance"

* Bring back 'Place a trade'. Tweaks

* Sell shares cloud function.

* Sell all shares by default. Switch back to buy if sell all your shares.

* Cache your shares in local storage so sell banner doesn't flicker.

* Compute sale value of shares with binary search to keep k constant.

* Update bets table to show BUY or SELL

* Fixes from Stephen's review

* Don't allow selling more than max shares in cloud function

* Use modal for sell shares on desktop.

* Handle floating point precision in max shares you can sell.
2022-03-29 14:56:56 -05:00
Austin Chen
a40d593d32 Refactor useQueryAndSortParams into the SearchableGrid component 2022-03-29 08:09:46 -07:00
Sinclair Chen
50eb9bd4bd
Remove resize handles from input fields (#67) 2022-03-25 09:27:28 -07:00
Austin Chen
bad58652b8 Tweak copy 2022-03-24 22:53:12 -07:00
James Grugett
7d8a87615a Embed market: dynamically adjust graph height 2022-03-24 12:03:17 -05:00
Austin Chen
b6281b0b56 Generate sitemap server-side 2022-03-24 09:52:13 -07:00
Austin Chen
1374309de3 Only show profitable trades in "Smartest Money" 2022-03-23 12:06:39 -07:00
James Grugett
9c19966ef9 Show fewer graph ticks on mobile so they don't overlap. padding 2022-03-22 21:05:31 -05:00
James Grugett
cbc01d8160 Fix analytics tabs on mobile 2022-03-22 18:26:06 -05:00
Austin Chen
c40c7af0b0 Condense analytics graphs using tabs 2022-03-22 15:53:06 -07:00
James Grugett
6d5a4d6e3f Week-on-week retention graph 2022-03-22 16:24:26 -05:00
James Grugett
09da7fcb7c Add weekly active users chart. Put daily active first. 2022-03-21 17:42:12 -05:00
Austin Chen
a3067527ee Fix crash when there aren't any bets 2022-03-21 15:19:42 -07:00
James Grugett
4a617a4c07 Share embed button 2022-03-21 15:23:21 -05:00
Austin Chen
37b8cc9687
Show a top 5 leaderboard on resolved markets (#66)
* Show a top5 leaderboard on resolved markets

* Only show profitable traders

* Include sales in profits

* Copy Leaderboard styling

* Also show the top comment and trade

* Fix padding for solo bets

* Only show both comment & bet if they differ
2022-03-20 18:07:45 -07:00
James Grugett
7df69dda4d Embedded market: Make only top section a link 2022-03-20 18:17:37 -05:00
James Grugett
cc15eb2044 Make embedded market link a clickable link 2022-03-20 18:12:33 -05:00
James Grugett
ee6f91a52f Created embed page for analytics 2022-03-20 17:21:28 -05:00
James Grugett
087a2a1f8f Monthly active users 2022-03-20 16:23:25 -05:00
James Grugett
48f5c28d75 Simplified contract embed 2022-03-20 16:05:16 -05:00
James Grugett
164f5fba06 Simple market embed page 2022-03-20 12:45:17 -05:00
mantikoros
927a5137a2 update api to include cfmm props 2022-03-17 11:55:06 -05:00
Austin Chen
e39f6d4125 Move fold items into folds/ 2022-03-17 00:56:25 -07:00
Austin Chen
318da1bd6f Move nav items into nav/ 2022-03-17 00:50:45 -07:00
James Grugett
addc883440 Track seen contracts in feed. Order feed by seen time priority. 2022-03-17 02:29:19 -05:00
mantikoros
c183e00d47
Cfmm (#64)
* cpmm initial commit: common logic, cloud functions

* remove unnecessary property

* contract type

* rename 'calculate.ts' => 'calculate-dpm.ts'

* rename dpm calculations

* use focus hook

* mechanism-agnostic calculations

* bet panel: use new calculations

* use new calculations

* delete markets cloud function

* use correct contract type in scripts / functions

* calculate fixed payouts; bets list calculations

* new bet: use calculateCpmmPurchase

* getOutcomeProbabilityAfterBet

* use deductFixedFees

* fix auto-refactor

* fix antes

* separate logic to payouts-dpm, payouts-fixed

* liquidity provision tracking

* remove comment

* liquidity label

* create liquidity provision even if no ante bet

* liquidity fee

* use all bets for getFixedCancelPayouts

* updateUserBalance: allow negative balances

* store initialProbability in contracts

* turn on liquidity fee; turn off creator fee

* Include time param in tweet url, so image preview is re-fetched

* share redemption

* cpmm ContractBetsTable display

* formatMoney: handle minus zero

* filter out redemption bets

* track fees on contract and bets; change fee schedule for cpmm markets; only pay out creator fees at resolution

* small fixes

* small fixes

* Redeem shares pays back loans first

* Fix initial point on graph

* calculateCpmmPurchase: deduct creator fee

* Filter out redemption bets from feed

* set env to dev for user-testing purposes

* creator fees messaging

* new cfmm: k = y^(1-p) * n^p

* addCpmmLiquidity

* correct price function

* enable fees

* handle overflow

* liquidity provision tracking

* raise fees

* Fix merge error

* fix dpm free response payout for single outcome

* Fix DPM payout calculation

* Remove hardcoding as dev

Co-authored-by: James Grugett <jahooma@gmail.com>
2022-03-15 17:27:51 -05:00
James Grugett
93287f8dc1
Answers in feed (#63)
* Compute answer group feed items

* Refactor feed code into 5 files under feed directory.

* Convert to typed ActivityItems

* Use feed "mode". Clean up cases.

* Implement feed answer groups!

* FR: Use nested comments/bets under answers for contract page. filter more items out of FR feed.

* Linkify answer text on activity feed

* Default feed excluded tags are case insensitive

* Show followed folds first

* Allow filtering your trades

* Store users's last sort in localstorage

* Use avatar of user that submitted answer and name instead of pencil icon. Spacing. Show up to 3 comments in asnwer group.

* Don't reveal market creator's bets

* Fix communites feed to be abbreviated

* Remove complicated answer group logic

Co-authored-by: Austin Chen <akrolsmir@gmail.com>
2022-03-14 15:29:32 -05:00
Austin Chen
14e2071b1d Show followed folds first 2022-03-13 11:55:05 -07:00
Austin Chen
917e066a45 Add a searchbar over all folds 2022-03-10 10:14:06 -08:00
James Grugett
fe49ae4d5a Hide fast fold follow widget for now 2022-03-09 22:08:55 -06:00
James Grugett
79bd299b68 Enforce max question length, description length, and tag length. 2022-03-09 11:08:57 -06:00
Austin Chen
da4ce99755
Merge Manifold for Teams infra into main codebase (#61)
* Add dev target for TheoremOne

* Restrict signups to theoremone.co emails

* Add new indices

* Forbid reads from unauthenticated users

* Client-side render pages that need auth

These pages are now client-side rendered:
- /home
- /leaderboards
- /market/...
- /fold/...

* Hide 404 for private Manifolds

* Brand instance for TheoremOne

* Hide "Add Funds" and "Personalize your feed"

* "M$" =>  "T$"

* Hide Discord & About Page too

* Update placeholders for teams

* Update firestore.indexes.json

* Switch /analytics to propz

* Migrate per-env code into common/

* More migrations to PROJECT_ID

* Conditionally use SSG depending on public vs private instance

* Fix props to be empty object

* Move more logic into access

* Spin out config files for each environment

* Generify most of the customizable brand stuff

* Move IS_PRIVATE_MANIFOLD to access.ts

* Rename access.ts to envs/constants.ts

* Add "dev:dev" alias

* Rever firestore rules to existing settings

* Fixes according to James's review
2022-03-08 18:43:30 -08:00
Austin Chen
a32bb57167 Update about page 2022-03-07 10:40:53 -08:00
James Grugett
d7d8fb94c4
Trim activity feed (#60)
* Trim activity feed: show only items from last 24 hours, remove contract description, shorter width.

* Preserve feed ordering based on initial fetch of bets

* Add see more button, description to explore items
2022-03-04 18:06:11 -06:00
James Grugett
e49b64ee9f Flex shrink 0 on bet panel container 2022-03-04 10:33:38 -08:00
James Grugett
cb9fa0ceb2 Daily active users & comments 2022-03-03 12:59:12 -08:00
Austin Chen
ef77779cec Format Tailwind classes with Prettier
Not sure why Husky hooks aren't enforcing this 🤷
2022-03-03 01:09:32 -08:00
Austin Chen
d9fb2c0557 Tweak padding 2022-03-03 01:07:21 -08:00
James Grugett
c30962bf80 Create bet count and market count charts in our analytics 2022-03-02 17:52:41 -08:00
James Grugett
6abf235505 Show correct remaning balance for ante input when creating market 2022-03-02 13:50:19 -08:00
James Grugett
2a03751d49 Widen bet panel 2022-03-02 13:43:48 -08:00
James Grugett
985cdd2537
🏦 Per-market loans! (#57)
* Loan backend: Add loanAmount field to Bet, manage loans up to max loan amount per market -- buy, sell, and resolve.

* Loan frontend: show your loan amount in bet panel, answer bet panel

* Resolve emails include full payout not subtracting loan

* Exclude sold bets from current loan amount

* Handle bets table for loans. Sell dialog explains how you will repay your loan.

* Floor remaining balance

* Fix layout of create answer bet info

* Clean up Sell popup UI

* Fix bug where listen query was not updating data.

* Reword loan copy

* Adjust bet panel width

* Fix loan calc on front end

* Add comment for includeMetadataChanges.

Co-authored-by: Austin Chen <akrolsmir@gmail.com>
2022-03-01 21:31:48 -06:00
James Grugett
ce30b34480 Fetch somewhat less data for fold static props 2022-03-01 18:08:46 -08:00
James Grugett
c372a0af9d Filter out undefined contracts in fold 2022-03-01 12:40:46 -08:00
James Grugett
71faee584c Add funds menu option, and Add funds page 2022-02-28 17:32:53 -08:00
Austin Chen
445e90f2b9 Link to analytics page from /about 2022-02-28 17:11:37 -08:00
James Grugett
a680d80793 Free response: Show invested and payouts on market page, don't show payout if yes/no 2022-02-28 15:58:13 -08:00
James Grugett
c6eb729e46 Remove border on feed tabs 2022-02-28 15:22:01 -08:00
James Grugett
8884f1beb9
Expose resolutionTime in API (#56)
* Expose resolutionTime. Compute closeTime to be the min of resolution and close time

* Rename settled to resolved, newest to most recent
2022-02-28 11:40:48 -08:00
James Grugett
0ccba20d5c Add explore tab on home feed that shows random inactive markets. 2022-02-27 13:37:11 -08:00
James Grugett
a3592f388b Fix feed to actually sort by last bet 2022-02-25 16:19:32 -06:00
James Grugett
ab5ea0181d Feed: Send only contracts with bets in last 24 hours. Instead of all contracts: 2.2MB => 0.8MB 2022-02-25 02:11:10 -06:00
James Grugett
cd590031e7 Feed updates: 1. Order by any bet instead of top 10 & comments 2. No resolved contracts 3. Show loading while fetching recent bets clientside so order preserved 4. Don't change order from new bets 2022-02-25 01:59:53 -06:00
James Grugett
185e68fa23 Fix 'undefined chance' in metatag description 2022-02-22 14:17:58 -06:00
James Grugett
207a12df55 Listen to followed folds. Follow button retreives from local storage. 2022-02-20 23:12:35 -06:00
James Grugett
8580698c15 Split answers panel into 5 files 2022-02-20 16:25:58 -06:00
mantikoros
42f88766b3 api: remove userId from bets 2022-02-19 22:51:51 -06:00
mantikoros
096a9e773a refactor /home logic to useActiveContracts 2022-02-19 18:02:40 -06:00
mantikoros
60f72fa6ab FastFoldFollowing: check if followedFoldIds is defined 2022-02-19 17:26:49 -06:00
mantikoros
2c572dd89a FastFoldFollowing: check if user defined 2022-02-19 17:23:03 -06:00
mantikoros
13727bb19f
Fast fold following (#51)
* fast follow folds

* FastFoldFollowing component on homepage
2022-02-19 17:17:36 -06:00
James Grugett
2a5172cb48 Switch to sending only recent bets and comments from static props 2022-02-18 12:43:13 -06:00
Austin Chen
a17342e55c
New, pretty user page (#48)
* Show bio, banner, and social links on user page

* Minor tweaks

* Allow edits to their user page

* Fix build; add a white ring around users

* From userpage, link to /profile (which is always editable now)

* Update userpage SEO

* Clean up Profile menu

* Fixes according to Stephen's code review
2022-02-17 17:16:58 -08:00
James Grugett
20ec09b7c6 Remove filter out of binary contracts 2022-02-17 18:39:06 -06:00
James Grugett
0a3b14883c Update SEO for non-binary markets 2022-02-17 18:34:17 -06:00
James Grugett
c48913d91e Sort bets/comments on client. Somehow server order is getting flipped? 2022-02-17 18:18:43 -06:00
Austin Chen
8f40350a75 API: Rename to LiteMarket/FullMarket; include creator avatar url 2022-02-17 16:04:05 -08:00
James Grugett
b2501d8145
Free response (#47)
* Answer datatype and MULTI outcome type for Contract

* Create free answer contract

* Automatically sort Tailwind classes with Prettier (#45)

* Add Prettier Tailwind plugin

* Autoformat Tailwind classes with Prettier

* Allow for non-binary contracts in contract page and related components

* logo with white inside, transparent bg

* Create answer

* Some UI for showing answers

* Answer bet panel

* Convert rest of calcuate file to generic multi contracts

* Working betting with ante'd NONE answer

* Numbered answers. Layout & calculation tweaks

* Can bet. More layout tweaks!

* Resolve answer UI

* Resolve multi market

* Resolved market UI

* Fix feed and cards for multi contracts

* Sell bets. Various fixes

* Tweaks for trades page

* Always dev mode

* Create answer bet has isAnte: true

* Fix  card showing 0% for multi contracts

* Fix grouped bets feed for multi outcomes

* None option converted to none of the above label at bottom of list. Button to resolve none.

* Tweaks to no answers yet, resolve button layout

* Show ante bets on new answers in the feed

* Update placeholder text for description

* Consolidate firestore rules for subcollections

* Remove Contract and Bet type params. Use string type for outcomes.

* Increase char limit to 10k for answers. Preserve line breaks.

* Don't show resolve options after answer chosen

* Fix type error in script

* Remove NONE resolution option

* Change outcomeType to include 'MULTI' and 'FREE_RESPONSE'

* Show bet probability change and payout when creating answer

* User info change: also change answers

* Append answers to contract field 'answers'

* sort trades by resolved

* Don't include trailing !:,.; in links

* Stop flooring inputs into formatMoney

* Revert "Stop flooring inputs into formatMoney"

This reverts commit 2f7ab18429.

* Consistently floor user.balance

* Expand create panel on focus

From Richard Hanania's feedback

* welcome email: include link to manifold

* Fix home page in dev on branches that are not free-response

* Close emails (#50)

* script init for stephen dev

* market close emails

* order of operations

* template email

* sendMarketCloseEmail: handle unsubscribe

* remove debugging

* marketCloseEmails: every hour

* sendMarketCloseEmails: check undefined

* marketCloseEmails: "every hour" => "every 1 hours"

* Set up a read API using Vercel serverless functions (#49)

* Set up read API using Vercel serverless functions

Featuring:
/api/v0/markets
/api/v0/market/[contractId]
/api/v0/slug/[contractSlug]

* Include tags in API

* Tweaks. Remove filter for only binary contract

* Fix bet probability change for NO bets

* Put back isProd calculation

Co-authored-by: Austin Chen <akrolsmir@gmail.com>
Co-authored-by: mantikoros <sgrugett@gmail.com>
Co-authored-by: mantikoros <95266179+mantikoros@users.noreply.github.com>
2022-02-17 17:00:19 -06:00
Austin Chen
51aa8df010
Set up a read API using Vercel serverless functions (#49)
* Set up read API using Vercel serverless functions

Featuring:
/api/v0/markets
/api/v0/market/[contractId]
/api/v0/slug/[contractSlug]

* Include tags in API
2022-02-17 12:56:24 -08:00
James Grugett
d6f15deff4 Fix home page in dev on branches that are not free-response 2022-02-17 01:02:48 -06:00
mantikoros
443acdbcf8 beautify trades page 2022-02-14 16:00:46 -06:00
Austin Chen
e4f1fbde3f Link to each question from Admin page 2022-02-13 16:09:30 -08:00
Austin Chen
7338bdd47a
Automatically sort Tailwind classes with Prettier (#45)
* Add Prettier Tailwind plugin

* Autoformat Tailwind classes with Prettier
2022-02-11 10:40:22 -08:00
James Grugett
dc0c9cf1d4 Filter undefined contracts 2022-02-10 17:06:27 -06:00
James Grugett
4150479aa3 Break words and linkify fold about text 2022-02-10 14:57:41 -06:00
James Grugett
00fbe711e5 Only show leaderboard scores that round up to M$ 1 or more 2022-02-10 14:51:14 -06:00
Austin Chen
bcc011c1fd Allow admins to edit questions 2022-02-09 10:58:33 -08:00
James Grugett
2d7c895964 Shrink about headers to h2 2022-02-08 00:21:47 -06:00
James Grugett
19baf86963 Sort fold & tag markets by 24-hour-vol 2022-02-07 23:03:55 -06:00
James Grugett
546005139b Fix recent activity label on mobile 2022-02-07 22:06:58 -06:00
James Grugett
2b5a0b1111 Require at least 2 follows to show a community (or show it if you are the curator) 2022-02-07 20:56:25 -06:00
James Grugett
faa49b750e Always show follow a community prompt 2022-02-06 20:03:42 -06:00
Austin Chen
ab6cfd2564 Show all recent activity if user has no folds 2022-02-06 16:03:36 -08:00
James Grugett
25e498ab3c Create market includes tags input. 2022-02-06 17:14:07 -06:00
James Grugett
63b7f64683 Listen for folds in contract page 2022-02-06 16:55:14 -06:00
Austin Chen
5aebd7eb41 Use font-weight: 600 for bold text 2022-02-06 01:23:45 -08:00
Austin Chen
516656f194 Clean up About page 2022-02-06 00:35:58 -08:00
Austin Chen
d2f5742231 Export all users to a CSV with name and email 2022-02-05 21:34:36 -08:00
mantikoros
dc2fada751 create: handle null 2022-02-05 19:10:26 -06:00
mantikoros
fae28fed7c create: don't replace undefined antes 2022-02-05 19:02:13 -06:00
James Grugett
1c8c2a4126 Fix home error after new contracts 2022-02-05 15:56:42 -06:00
James Grugett
d0a56cd1af Merge branch 'send-all-data' 2022-02-04 20:22:43 -06:00
James Grugett
31fbd6b900 Send all comments and bets to home page, so feed loads immediately 2022-02-04 20:09:34 -06:00
mantikoros
f7b981c55c "winnings" => "trader profits" 2022-02-04 17:42:08 -06:00
mantikoros
d439a2e1c0 create page: fix ante resetting 2022-02-04 17:40:03 -06:00
mantikoros
1ab7a4162c fix market close date time 2022-02-04 17:38:40 -06:00
James Grugett
637a76cf34 Cache first step of generating feed: folds you follow and contracts you bet on. 2022-02-04 17:24:54 -06:00
Austin Chen
a46c311a99 Clean up titles on /home 2022-02-04 10:30:13 -08:00
mantikoros
b4a68bf436 redirect signed out users on /profile and /trades to homepage 2022-02-03 21:19:42 -06:00
mantikoros
03f36cf954
User profile (#44)
* add id, userId to comment

* change user info cloud function and script; move cleanUsername to common

* change user info script

* fix rules

* add fund button: useLocation hook

* profile page

* merge

* profile stuff

* avatar uploading to storage bucket

* changeUserInfo: use transaction

* Styles for profile page

* Edit mode for profile, and more styles

Co-authored-by: James Grugett <jahooma@gmail.com>
2022-02-03 21:04:56 -06:00
James Grugett
ca89fd158d Make home communities look better on mobile. Add Covid & AI. 2022-02-03 19:00:17 -06:00
James Grugett
00f632ec47 Remove tw-elements for now 2022-02-03 18:10:19 -06:00
James Grugett
c36ce3e521 Change home tags to communities 2022-02-03 17:40:37 -06:00
James Grugett
e5f553fa1a Merge branch 'main' into custom-feed 2022-02-03 17:33:12 -06:00
James Grugett
587e1e5d61 Add loading spinner while feed loads 2022-02-03 17:12:09 -06:00
James Grugett
8e06e4351e Add tw-elements UI library 2022-02-03 17:11:38 -06:00
mantikoros
4294481b5b change fee structure 2022-02-03 16:59:59 -06:00
James Grugett
3cf4cb7a77 Show custom feed of contracts from folds your follow or have bet on. 2022-02-03 16:54:08 -06:00
James Grugett
6c9f566d3d Add hashtag in tags of fold card 2022-02-03 14:13:51 -06:00
Austin Chen
426d41ba44 Surface a list of tags on /home 2022-02-03 11:00:49 -08:00
Austin Chen
193b9ae6bf Restyle /folds page 2022-02-03 10:47:26 -08:00
James Grugett
a90e9b7083 Reorder fold page queries to be more in parallel 2022-02-03 00:19:59 -06:00
James Grugett
fdbaa5270b Show hot markets in fold feed 2022-02-02 23:58:27 -06:00
James Grugett
00ac581736 Show your performance in fold 2022-02-02 23:34:35 -06:00
James Grugett
95268844aa Add text to fold "about" explaining how markets are included. 2022-02-02 14:20:04 -06:00
James Grugett
f80ef1cd34 Add hot markets to home feed 2022-02-02 00:40:46 -06:00
James Grugett
b95f258763 Add package.json to common directory, and lodash dependency 2022-02-01 12:59:51 -06:00
James Grugett
96c1410f01 Rename Fold => Community in UI 2022-02-01 12:12:55 -06:00
James Grugett
565ded1063 Add folds links in market, hide tags behind Show tags toggle. 2022-02-01 12:06:42 -06:00
James Grugett
4e1174a4dc Option to disallow market creation from fold 2022-01-31 22:10:02 -06:00
James Grugett
5b5e6c78d6 Use expanding text area for description on make-predictions 2022-01-31 21:33:43 -06:00
James Grugett
3bbe6062e9 Change description input to use textarea 2022-01-31 21:31:49 -06:00
James Grugett
bc208df597 Add tags input for make-predictions 2022-01-31 21:13:37 -06:00
James Grugett
6525ffc6c3 Add ante and close date to make predictions 2022-01-31 20:58:41 -06:00
James Grugett
08eac5b0ef Add my calendly to about 2022-01-31 20:44:49 -06:00
James Grugett
2e1fdd7d7a Add border bottom back on fold page 2022-01-31 19:29:59 -06:00
mantikoros
d49656cb77 create: market close includes time 2022-01-30 23:20:27 -06:00
James Grugett
00b7f3505f Listen for contract updates in folds feed 2022-01-30 22:12:12 -06:00
James Grugett
9d2b99f237 Listen for updates of contracts on home 2022-01-30 22:03:20 -06:00
James Grugett
997f13d986 Make leaderboard not error on non-existant users 2022-01-30 21:25:52 -06:00
mantikoros
f06ca8305c
Resolve prob (#41)
* rename MKT to PROB; show resolved probability; move format utilities to common

* ProbabilitySelector

* resolve to PROB

* prob and mkt labels
2022-01-30 15:51:30 -06:00
jahooma
482654d06b Update folds SEO to include curator. 2022-01-28 13:45:32 -06:00
jahooma
f04d66d5c8 Don't focus feed create unless there's no question yet 2022-01-28 13:23:44 -06:00
jahooma
f75dc0200d Remove link create a market in placeholder 2022-01-28 12:54:15 -06:00
jahooma
53a6748c6d Hide negative earners on leaderboard. Show empty message if none on leaderboard. 2022-01-28 12:43:35 -06:00
jahooma
764790c1e1 Add simple Fold page SEO 2022-01-28 12:34:13 -06:00
jahooma
d5742900b0 Remove border on ask question form. Add padding to fold title on mobile 2022-01-28 12:13:12 -06:00
James Grugett
649c6f4642
Make navbar render signed in or signed out by page (#39) 2022-01-27 17:06:31 -06:00
mantikoros
bd6c215cd3
use img instead of next js image for avatar, logo (#38) 2022-01-27 16:50:55 -06:00
jahooma
9b59ea9fbe Bring back global leaderboards linked from profile menu 2022-01-27 16:43:45 -06:00
jahooma
f2c4d3e9c1 Change to white backgrounds for content. Remove page's margin, set individually. 2022-01-27 16:37:43 -06:00
jahooma
4ca1d33d65 Make tag page check lowercase tag field 2022-01-27 15:11:32 -06:00
mantikoros
f58126e630 create: remove default close date 2022-01-27 14:31:09 -06:00
mantikoros
9acb07aa14 home: remove hot, closing soon sections 2022-01-27 14:23:55 -06:00
jahooma
bb788d5201 Change placeholder in fold create question 2022-01-27 14:05:59 -06:00
mantikoros
d2e78eb5de markets: make 24hr vol default sort 2022-01-27 12:48:47 -06:00
jahooma
9764a03189 Add create market to top of fold activity. Auto-adds the primary tag of the fold. 2022-01-27 12:45:35 -06:00
jahooma
61d2557c35 Launch folds in nav bar, update copy. 2022-01-27 01:10:28 -06:00
jahooma
769763d006 Tweaks 2022-01-27 00:38:42 -06:00
Austin Chen
c047365bb4 Include "Buy" tag inside buttons 2022-01-26 16:28:57 -06:00
jahooma
b1abfcda8b Placeholder when no activity on folds page 2022-01-26 14:39:25 -06:00
jahooma
ef8157025f Compute fold follower count from cloud function. 2022-01-26 14:27:16 -06:00
Austin Chen
e4377ee3a3
Allow betting directly from the activity feed (#36)
* Show a popup for betting on the Activity feed

* Replace the popup with a YES/NO selector

* Autofocus the bet amount

* Hide BetRow when not appropriate

* Make bet modal larger on desktop

* Default to YES if no bet choice has been made yet
2022-01-26 14:08:03 -06:00
jahooma
76841e53b1 Follow and unfollow folds 2022-01-26 14:03:32 -06:00
jahooma
c3f49c44a0 Cardify folds in fold list 2022-01-26 12:44:16 -06:00
jahooma
8e511e7cc9 Add about to top of fold page on mobile. Layout tweaks 2022-01-26 12:02:53 -06:00
jahooma
2ea05f8913 Folds query on lowercase tags. Adding to description updates tags & lowercaseTags fields. 2022-01-25 17:52:21 -06:00
jahooma
8b0091f30d Split out create fold button. Show about description on /folds 2022-01-25 17:02:02 -06:00
jahooma
897eb0c27b Handle 404 errors for non-existent fold subpages 2022-01-25 15:44:32 -06:00
James Grugett
8b9d0e5dba
New fold page UI with tabs (#37)
* Tabbed fold page

* Implement market, leaderboard tab views for fold. And edit dialog

* Add about field to Fold
2022-01-25 14:47:25 -06:00
jahooma
ed9285dbc1 Make folds page more understandable. Add additional tags on fold creation 2022-01-24 16:58:51 -06:00
jahooma
705d5cada7 Add lowercaseTags field to contracts. ante / closeTime non-optional in new contract code 2022-01-24 16:33:10 -06:00
Austin Chen
13590bf5d1 Surface user emails in /admin 2022-01-24 00:48:10 -06:00
jahooma
0e3e4b8192 Show unresolved markets first in fold 2022-01-23 23:55:48 -06:00
jahooma
bc3e43802b Listen for new folds on /folds 2022-01-23 23:48:10 -06:00
jahooma
b059a44acc Use fold hook 2022-01-23 00:51:19 -06:00
jahooma
6cc2e6692e Fix DOM error for nested forms 2022-01-22 18:38:37 -06:00
mantikoros
fd03eb841f home: remove incomplete loading of contract data 2022-01-22 18:36:35 -06:00
mantikoros
7c124c1390 home: handle undefined props 2022-01-22 18:32:50 -06:00
jahooma
cff2611582 Add back dynamically loading feed 2022-01-22 18:26:56 -06:00
mantikoros
80776186aa
/home for signed in users (#35) 2022-01-22 18:16:23 -06:00
jahooma
aa1022546d Implement leaderboards for folds! 2022-01-22 17:59:50 -06:00
jahooma
bc1decdbfc Initialize folds with one primary tag 2022-01-22 15:47:24 -06:00
jahooma
789df9a76d Add some catches 2022-01-22 15:21:52 -06:00
jahooma
fe912921eb Use nicer tag component for folds 2022-01-22 14:52:49 -06:00
jahooma
be82406c4d Include older contracts in fold feed 2022-01-22 11:50:09 -06:00
jahooma
0617fedb17 Add /markets for fold 2022-01-22 11:39:35 -06:00
mantikoros
4698d119b4 activity, withoutAnteBets: check for undefined 2022-01-22 11:15:14 -06:00
jahooma
affa9a5ab6 Change default sort of all markets to most traded 2022-01-21 18:31:20 -06:00
jahooma
9733056ce7 Hide hot and closing soon markets on all markets 2022-01-21 18:30:27 -06:00
jahooma
d357f51883 Reorg homepage. No feed when not signed in, add back hot & closing soon for signed 2022-01-21 18:28:12 -06:00
James Grugett
60f68b178d
Folds (#34)
* Fold type, fold page, query for fold contracts

* Tsconfig: target esnext, nounused locals: false

* Store tags in field on contract. Script to update contract tags

* Show tags on fold page

* Load all fold comments server-side to serve better feed

* Fix the annoying firebase already initialized error!

* Add links to /edit and /leaderboards for fold

* Page with list of folds

* UI for creating a fold

* Create a fold

* Edit fold page
2022-01-21 17:21:46 -06:00
Austin Chen
5be6a75e4b
Create new markets directly from the feed (#33)
* Move hot & closing markets to All Markets

Soon to be named "Explore"

* Set up a question box on the homepage

* Show Leaderboards by default instead of Create

* Support full contract creation from homepage

* Force mt-0 on /markets

* Move description into info tooltip

* Add hint to ask a question

* Initialize close date to 1 week from today

* Add a promo section for logged-out users

* Add hashtags, remove mobile padding

* Rewrite promo copy

* Store hotContracts as static props
2022-01-21 12:33:58 -06:00
Austin Chen
9457ac9337 Show resolved markets on Admin page; show create & resolve times 2022-01-20 01:55:10 -05:00
mantikoros
4c0a994174 about: remove open beta disclaimer, barb about praying mantises 2022-01-19 16:13:56 -06:00
Austin Chen
b3282c4302 Improve SEO descriptions 2022-01-19 12:57:35 -05:00
jahooma
d3031e0f10 Admin contracts tabel: Add visibility column, filter out resolved 2022-01-18 16:29:49 -06:00
jahooma
aa164cd5f5 Add contracts table to admin page 2022-01-18 16:10:40 -06:00
mantikoros
908c8c03e6
Create user cloud function (#31)
* createUser cloud function; change User object

* initial commit

* listenForLogin: avoid race condition

* createUser: allow capital letters in username

* remove debugging

* leaderboard: empty url for undefined avatar image
2022-01-18 01:18:38 -06:00
James Grugett
6625983bb7
Leaderboards 🏅 (#30)
* Simple leaderboards

* Filter out SG from traders. Center leaderboard. Use Nextjs Image.

* Add leaderboards menu option

* Put leaderboards side-by-side on large screens

* Add medal emoji
2022-01-17 21:20:25 -06:00
jahooma
4d975ff512 Add closing soon section to home 2022-01-17 16:54:00 -06:00
Austin Chen
673c432bb9 Expose Firestore analytics on /analytics 2022-01-17 13:34:28 -05:00
Austin Chen
279437ba08
List users on admin page (#28)
* Admin page using gridjs

* Move hook into separate file

* Link to each user's Manifold and Firestore /user entry

* Gate admin access to Austin/James/Stephen

* Don't leak the existence of /admin

* Add a custom 404 page that directs to Discord.

* Fix broken window.location.href on NextJS server
2022-01-15 22:09:15 -05:00
Austin Chen
07709cdccb Fix Calendly link 2022-01-15 21:05:26 -05:00
jahooma
c13b71b754 Center create market page. Tweak labels 2022-01-15 19:02:01 -06:00
mantikoros
615d5874b3 Merge branch 'main' of https://github.com/manticmarkets/mantic 2022-01-15 17:31:56 -06:00
mantikoros
43c67b2820 create page info tooltips; small bug fix: use balance instead of remainingBalance 2022-01-15 17:30:48 -06:00
jahooma
1aa88a917b Fix missing key 2022-01-15 17:29:38 -06:00
jahooma
0069846335 Turn off hook for fetching hot contracts for now. 2022-01-15 12:43:39 -06:00
jahooma
f6079e68d0 Choose random hot contracts from top 16 every 5 minutes. 2022-01-15 00:44:33 -06:00
jahooma
e12e399679 Fix feed order moving around on load 2022-01-14 19:12:38 -06:00
jahooma
9d44c40415 Preserve scroll on back 2022-01-14 18:43:00 -06:00
jahooma
895eba4553 Get static props of just data for feed: active contracts, their bets & comments. 2022-01-14 18:16:32 -06:00
mantikoros
3fa2926559 create page design; require minimum ante; lower phantom ante amount; createContract checks 2022-01-14 17:39:17 -06:00
jahooma
c70ec1dad3 Remove 3 unnecessary DOM elements from card 2022-01-14 12:28:48 -06:00
jahooma
40c853e595 Reimplement hot markets with flex box, since I can't figure out how to make the css grid version not flash bad layout. 2022-01-14 00:55:35 -06:00
jahooma
07a7fc219b Axe landing page, show home feed 2022-01-13 14:54:31 -06:00
jahooma
2b618be3ac Increase padding on contract page 2022-01-13 12:58:49 -06:00
jahooma
de043de589 Add visibility field to contracts. Hot contracts & activity feed show only visibility 'public'. 2022-01-12 19:53:50 -06:00
jahooma
1fbde3646f Bump up feed padding on mobile 2022-01-12 15:32:50 -06:00
jahooma
33f4965fa4 Change activity feed to white bg, no hover bg, smaller width, centered 2022-01-12 15:23:29 -06:00
mantikoros
9d5490cf9a
Switch to new dpm mechanism (#26)
* initial commit

* antes

* rename path, compute to contractPath, contractMetrics

* merge

* Include antes as bets; more calculations

* fees on estimated winnings

* mkt payout calculation

* contract: remove startPool, add phantomShares

* Merge branch 'main' into new-dpm

* dpm migration script

* my service account
2022-01-12 13:01:04 -06:00
Austin Chen
7c1d70313b Uncardify activity feed 2022-01-12 13:20:28 -05:00
Austin Chen
edb3809f1c Standardize on max-w-4xl 2022-01-12 02:13:01 -05:00
jahooma
8839ffc492 Require close date for new markets. Update description placeholder to say it's optional. 2022-01-11 23:40:41 -06:00
jahooma
ca38640b89 Tweak positioning of add funds button, no green initial probability 2022-01-11 23:29:50 -06:00
jahooma
2f88a5cdab Remove Activity Feed from create page per Stephen 2022-01-11 21:59:44 -06:00
jahooma
19c0f83b85 Activity feed on home page! All markets navbar option. 2022-01-11 21:56:11 -06:00
jahooma
ebb1bc7359 Fix feed layout on mobile, adjust spacing, max width. 2022-01-11 14:57:53 -06:00
Austin Chen
5b431226d4
Show all recent activity on a central feed (#24)
* Tracks all market activity on a single page

* Support both global and per-contract feeds

* UI tweaks

* Include contract description in activity feed

* Show activity feed on Create page
2022-01-11 11:56:26 -05:00
James Grugett
bfd0af1c80
New logo: oragami crane (#25)
* new logo

* Switch out mantis for crane in logos

* White svg on dark background. Align correctly on landing page.

* Mobile navbar: hide your name, write out Manifold Markets

Co-authored-by: mantikoros <sgrugett@gmail.com>
2022-01-11 00:16:58 -06:00
jahooma
7fbecbc102 Extract bet amount input to component. 2022-01-10 21:41:42 -06:00
jahooma
a04c978408 Keep page wide if showing resolve panel 2022-01-10 10:33:02 -06:00
mantikoros
01506fedeb about page 2022-01-10 01:12:14 -06:00
Austin Chen
feca042e47
Use the generated OpenGraph card in all markets (#23)
* Run OpenGraph server on dev port 3001

* Cut '%' since frontend already passes it

* Use the generated card in markets

* Rename to ogCardProps

* Don't show creator avatar url, for now

* Remove bad comment
2022-01-10 02:05:24 -05:00
Austin Chen
ed37d93868
Dynamically generate Opengraph images for each market (#21)
* Start customizing opengraph image

* Fix cover image size to 1200x630

* Design a text-based, dynamic preview card

* Load designed html into template.ts

Remove twemoji for now too

* Take in params to configure Manifold card

* Switch back to hardcoded png for default case
2022-01-10 00:50:31 -05:00
jahooma
cedd8df45c Show hot market 24 hour volume instead of pool 2022-01-09 15:21:30 -06:00
jahooma
d1c6e5bc91 Change useContracts to return undefined instead of 'loading'. Serve static props on tag page 2022-01-09 14:51:20 -06:00
jahooma
16ab0e0c37 Query hot contracts from volume24Hours field. 2022-01-09 14:26:51 -06:00
jahooma
6d4554e9ef Don't show resolved markets in hot markets 2022-01-09 12:14:20 -06:00
jahooma
519dda6473 Use gray-500 instead of gray-400 for text against gray bg. 2022-01-08 23:10:08 -06:00
mantikoros
abb5d53431 ensure bet amounts are positive 2022-01-08 11:51:42 -06:00
jahooma
6398f93ffe Show just the hot markets on homepage. 2022-01-08 00:23:50 -06:00
James Grugett
af6387bbf3
Stripe (#22)
* basic working payments

* Select funds amount and prettier funds button / dialog

* Add funds page and nav menu option

* Format funds amount. Use ghost button for back.

* Add mantic dollars description

* Improve styles of add funds page

* about styling

* change faq => about

* change default font to Courier

* header sign out menu item; remove user  card

* keep logo font

* fix header issue

* stripe webhook: handle repeat events

* Make add funds button a gradient

* add funds referer url

* Fix add funds page after merge

* Slight VisD tweaks

* Update add funds button position. Mantic => Manifold

* Remove Add funds menu option for now.

* Set up product ids and endpoint for stripe prod

* Swap back order in profile menu

Co-authored-by: mantikoros <sgrugett@gmail.com>
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
2022-01-07 16:56:14 -06:00
Austin Chen
fccf52eb34 Use our new dynamic opengraph image 2022-01-07 12:19:17 -08:00
mantikoros
a7c42ee8ec meta image tag 2022-01-06 21:54:11 -06:00
mantikoros
59034839a9 meta tag image 2022-01-06 21:41:29 -06:00
jahooma
bdb46fc7c1 Tweaks for create market page 2022-01-06 21:32:46 -06:00
James Grugett
85b5ee5cbc
Rename to Manifold Markets! (#19)
* Update logo and about page to manifold

* Change urls, titles / metatags, landing page
2022-01-06 12:48:30 -06:00
Austin Chen
f218a74a0c Add probability slider to Create Market 2022-01-06 00:45:30 -08:00
mantikoros
95b28bd536 create page: disable form elements after submitting 2022-01-05 21:10:06 -06:00
Austin Chen
22894cb44e Update Notion link 2022-01-05 15:51:56 -08:00
mantikoros
0b8ad76b0f global warming: warm up all cloud functions on client 2022-01-05 12:30:16 -06:00
jahooma
5eaf50612d Advanced metrics for bet panel 2022-01-05 12:23:44 -06:00
jahooma
1bc323d575 Hot markets! 🔥 2022-01-05 00:33:01 -06:00