Commit Graph

930 Commits

Author SHA1 Message Date
Marshall Polaris
1063897c7c
Clean up extra wrapper and CSS on BetRow (#178) 2022-05-11 14:35:50 -07: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
Sinclair Chen
aa433e309c
restyle home page (separation between markets) (#186) 2022-05-11 12:51:45 -07:00
Austin Chen
2fd9759bc1 Fix hyperlinks when starting with an open paren 2022-05-11 15:28:28 -04:00
James Grugett
2b9e639281 Default to 'all' search filter for markets on user page 2022-05-11 00:19:29 -04:00
James Grugett
948d878222 Prevent 500 error on markets with no collected fees 2022-05-10 23:01:07 -04:00
Marshall Polaris
6c9df223d8
Feed container markup cleanup (#173)
* Move FeedContainer stuff into ActivityFeed

* Greatly clean up ActivityFeed container markup
2022-05-10 13:59:19 -07:00
Sinclair Chen
a297f6492d
move manaToUSD to format.ts (#172) 2022-05-10 11:14:24 -07:00
Marshall Polaris
d34907681a
Remove some random unnecessary wrapper divs (#163)
* Remove wrapper div in user comment feed item

* Remove wrapper div around feed market card title link

* Remove wrapper div around BetRow
2022-05-09 15:50:20 -07:00
mantikoros
ef43e46153 include fees in tooltip 2022-05-09 17:33:24 -04:00
Marshall Polaris
8a99f3772a
Cleanup avatar again (#161)
* Reinstate avatar component cleanup

This was reverted due to a bug, fixed in the subsequent commit.

* Kill additional wrapper divs around avatars

This also fixes a bug where the `w-8` answer row wrapper div was
constraining the width of the `w-10` avatar, leading it to be `w-8`
and `h-10` and appear as an oval.
2022-05-09 14:32:59 -07:00
mantikoros
5135135e79
Separate out fees (#159)
* 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
2022-05-09 16:04:40 -05:00
Boa
a5b0372a6e
Free response markets with investment cap (#157)
* Show error message for FR bet

* Allow M$ limit for markets

* Allow M$ limit for markets

* Apply M$ limit to FR answer bets

* Improve error message

* Improve error message

* Only check stats if mana limit set

* Consolidate logic

* Remove unused variable

* absolute import

* absolute imports
2022-05-09 14:09:07 -06:00
James Grugett
d55990d5d4 Fix contract search not adjusting to new user 2022-05-09 15:47:18 -04: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
Ian Philips
8fbbeffd38 Revert one more avatar component change 2022-05-09 10:33:52 -04:00
Ian Philips
5c1bc78408 Revert avatar component changes 2022-05-09 10:18:05 -04: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
Austin Chen
b47e4364ad Remove circle around markets/comments count 2022-05-08 22:53:02 -04: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
Austin Chen
22a9901148 Feature Nonlinear as a charity 2022-05-07 08:15:40 -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
87b43e6bdb
Add link to twitter with svg icon to the sidebar and profile menu. Remove Discord hero icon and replace it with discord svg. (#135) 2022-05-05 22:20:18 -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
Marshall Polaris
2e214cab7a
Kill warmup spam (#133)
* Only warm up sell bet function once

* Only warm up create user function once
2022-05-05 09:51:09 -07:00
Marshall Polaris
adefd3259c
Cleanup avatar component rendering (#130)
* Remove unnecessary classes on avatar img

I don't believe these have any visible effect.

* Don't apply Tailwind 'avatar' class in menu

We don't use this class elsewhere when displaying avatars (instead our
avatar has manual styles that do the stuff Tailwind is trying to do)
and it just assigns a weird size that we don't want.

If we want to use the Tailwind avatar styles we should refactor further.

* Remove unnecessary avatar wrapper div

* Remove old prop from avatar
2022-05-05 09:50:58 -07:00
Austin Chen
1caed44552 Show /charity in signed-out sidebar 2022-05-05 10:15:12 -04:00
Boa
9480f9f34c
Improve free response answer ux (#131)
* 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
2022-05-04 16:03:06 -06:00
Marshall Polaris
bf8e09b6c1
Represent DB avatar URLs as non-null (#128) 2022-05-04 11:07:22 -07:00
mantikoros
95b67c05e2 another sell shares rounding bug 2022-05-04 11:47:45 -04:00
Ian Philips
0d63e471be Only show cursor if focused 2022-05-03 16:45:21 -04:00
Boa
3a33efa8db
Threaded free response comments & general comments sections (#121)
* Allow comments to reference answers

* Add comment inputs for free response answers

* condense comment logic in one component

* Add General Comments section to FR answers

* Prompt signin even if no comment

* Remove unused & refactor

* Simplify general comments logic, toggle comment boxes

* Clarify rendering logic
2022-05-03 14:38:40 -06:00
Sinclair Chen
100821e34c
Ask user to buy more mana when insufficient funds (#124) 2022-05-03 13:36:54 -07:00
Sinclair Chen
f2217d1d8b
Improve donate box UI in mid-size window (#126) 2022-05-03 13:36:00 -07:00
Sinclair Chen
2da5423f36
Add padding too charity images (#123) 2022-05-03 08:12:42 -07:00
Sinclair Chen
3434b3de3f
Move all charity images to imgur + Next (#120) 2022-05-03 07:00:33 -07:00
Boa
8da36298e5
condense comment logic in one component (#119) 2022-05-03 07:51:25 -06:00
James Grugett
beece64ae5 Tweak contract info dialog 2022-05-02 12:18:55 -04:00
mantikoros
43d3662db1 fixed negative shares bug 2022-05-02 12:16:36 -04:00
James Grugett
6232284e92 Larger font on amount input 2022-05-02 12:15:00 -04:00
James Grugett
bec8cdb3e8 Add share market widget shown if you are the creator 2022-05-02 11:23:54 -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
0b5b0bb9d3 Clear comment after submitting, for multiple bets 2022-05-02 10:43:17 -04:00
James Grugett
d6a9b89c43 Fix answers not wrapping in cards 2022-05-02 10:35:49 -04:00
Austin Chen
b63cc17630 Hide charity names on cards 2022-05-02 08:45:05 -04: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
46bf09f182 Feature 1Day Sooner & QURI 2022-04-30 15:47:47 -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
04c42e7835 Tweak copy ("You with" => "You have") 2022-04-30 10:20:03 -04:00
James Grugett
a4c722550a Don't truncate comments for contract page 2022-04-30 10:07:39 -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
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
Austin Chen
2e17f9f917 Add a "Show more..." button when there are more contracts 2022-04-28 18:45:26 -04:00
mantikoros
da153ceea9 bound initial probability to [0.1, 0.9] 2022-04-28 10:47:18 -04:00
Boa
1db1a739cf
Misc comment ux improvements (#103)
* Separate comments and bets via tabs

* Normalcase comment button

* Note about abbreviated and all mode

* Revese,abbreviate,limit comments in feed
2022-04-26 15:08:50 -06:00
Boa
d6c7230d6a
Moved answers (#102)
* Moved answers

* Remove unnecessary code
2022-04-26 09:53:12 -06:00
Ian Philips
8ba2a55180 Your trades -> Your bets 2022-04-26 08:38:28 -06:00
Boa
7722c723c4
Separate free response answers & comments (#100)
* Just for playing with, bad code

* Whiten answer cards

* Separate answers and comments in FR markets

* Highlight FR answer in bet w/ comment

* Darken answer text and move classname

* Normalcase Comment
2022-04-26 07:24:57 -06:00
Marshall Polaris
4d48c98975
Fix generation of create market placeholder text (#92)
* Fix generation of create market placeholder text

* Capitalize comment
2022-04-24 17:14:20 -05:00
Marshall Polaris
06f9f53951
Link to /home, not / (#93) 2022-04-22 21:39:29 -05:00
Ian Philips
4e4ffe8e20 Sell either type of share for dpm market 2022-04-22 04:43:34 -06:00
Ian Philips
3f471e7e8e Sell either type of share for dpm market 2022-04-22 04:30:13 -06:00
Ian Philips
8109f3d9a9 Show free comments in feed 2022-04-22 04:16:54 -06:00
James Grugett
a525ad82ec Filter out markets you sold out of from most of the views on portfolio page. 2022-04-21 18:32:46 -05:00
mantikoros
004969aa66
user-added liquidity provision panel (#90)
* user-added liquidity provision panel

* AddLiquidityPanel: handle loading, errors

* ContractInfoDialog: don't show add liquidity when market is closed

* ContractInfoDialog: hide add liquidity for FR
2022-04-21 12:58:12 -05: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
Austin Chen
9ce82b1b6f Show "New" badge on contract cards too 2022-04-20 23:03:16 -07:00
James Grugett
7847a9e781 Track latency of feed and portfolio page. 2022-04-21 01:00:08 -05:00
James Grugett
8c8a9be6a1 Show new label instead of 0 volume 2022-04-20 17:25:29 -05:00
James Grugett
01e43abd17 Add factors to weight new contracts higher, contracts with unseen comments, and contracts with prob closer to 50% 2022-04-20 16:37:01 -05:00
Ian Philips
0390ec0f47 Prepare user website urls for external link 2022-04-20 10:13:17 -06:00
Ian Philips
d6d72aa619 Clean twitter and website user urls 2022-04-20 09:47:14 -06:00
Boa
9ba7c04524
Sell shares mobile (#86)
* Abstract sell shares row to component

* Allow sell row to show just a button

This is nice for the feed and on a bet's mobile interface.

* Add and use floor shares

* Allow sell button on the same line as bet button

* Move use save shares to own file

* Make sure to sell non-integer shares

* Create SellButon & sell non-integer shares

* Remove props prefixes

* Break out sell modal and button
2022-04-20 08:13:39 -06:00
James Grugett
3c1e16b815 Move contract details components to their own file. 2022-04-19 22:34:41 -05:00
James Grugett
3b413e52e5 Clean up FR answer on card 2022-04-19 22:31:45 -05:00
James Grugett
d19debfd19 Close time label: show relative time iff same day. Show year iff not same year. 2022-04-19 12:55:22 -05:00
James Grugett
24a9a79f16 Decrease padding so sell shares label fits in one line 2022-04-19 12:53:04 -05:00
Ian Philips
7ccdc6d683 Hide bet panel on FR after successful submit 2022-04-19 09:01:40 -06:00
Boa
7c7d6815f8
Add create market button (#79) 2022-04-19 08:15:05 -06:00
James Grugett
280ae97070 Track clicks from feed 2022-04-19 00:16:08 -05:00
James Grugett
a6e6e2f52f Include top answer in answer card. 2022-04-18 21:44:31 -05:00
James Grugett
88b8d39c7c Remove filterToOutcome 2022-04-18 20:54: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
mantikoros
790aec9baf
Cfmm migration (#80)
* cfmm migration script

* save dpm shares, pool

* formatMoney: use floor instead of round

* migrate cfmm: use sale amount as shares for sold bets

* migration: make up fake share qty for sold shares

* migration: also convert resolved markets

* migration: don't migrate resolved markets after all

* migration: error checking
2022-04-18 17:02:53 -05:00
James Grugett
102e22e111 Recent trade => recent 2022-04-15 17:55:26 -05:00
James Grugett
72a56b46fd Switch portfolio default sort to recent trade 2022-04-14 00:16:08 -05:00
James Grugett
43b8c16fcc Compact-ify cards in portfolio page 2022-04-14 00:06:13 -05:00
James Grugett
8a59ab3180 Tweak current investment calculation 2022-04-13 22:28:29 -05:00
James Grugett
2a3593c269 Fix profit calculation for dpm sales 2022-04-13 20:42:47 -05:00
James Grugett
e58ec54546 Clean up portfolio sorts 2022-04-13 18:56:28 -05:00
James Grugett
ec63464461 Remove Communities: Not shown in navigation or market info 2022-04-13 18:14:03 -05:00
James Grugett
a09af526a0 Switch summary stat from payout at current % to profit 2022-04-13 17:57:46 -05:00
James Grugett
bfb708d477 Fix profit calculation for cpmm sales. Change totalValue to investment value excluding sales 2022-04-13 17:25:32 -05:00
James Grugett
a9028b0a94 Remove invested metric for cfmm markets 2022-04-13 15:47:12 -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
ff1cb68077 Copy contract url doesn't use current url 2022-04-11 17:06:51 -05:00
James Grugett
e53cde5b34 Quick back navigation into feed 2022-04-11 16:13:26 -05:00
James Grugett
9f2ac17ffb Add copy link button in market share options 2022-04-10 19:59:01 -05:00
James Grugett
8c9da833bf Don't match parenthses in link url 2022-04-10 19:47:26 -05:00
James Grugett
4a9fc7bc9b Don't show portfolio when signed out. Home navigates to '/' when signed out. 2022-04-10 00:26:28 -05:00
mantikoros
642fedbbb4 fix error 2022-04-09 19:09:06 -05:00
mantikoros
ea07edcbd3 add funds: remove M$500 purchase option 2022-04-09 18:56:05 -05:00
mantikoros
5bf36d1963 market stats: pool 2022-04-09 18:23:24 -05:00
mantikoros
2d8e85ab5e ContractInfoDialog: volume 2022-04-09 18:13:15 -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
7c11df6147 market info stats 2022-04-09 18:04:13 -05:00
mantikoros
fe5fba184f FeedQuestion: hide close time 2022-04-09 17:15:05 -05:00
mantikoros
6e38540d58 contract tabs: always show timeline tab 2022-04-09 16:34:43 -05:00
mantikoros
13300326fd bet panel styling 2022-04-09 16:26:43 -05:00
mantikoros
b624ec045e "buy" => "bet" 2022-04-09 16:13:36 -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
mantikoros
108f0afb95 contract card: remove created time; inline info dialog button 2022-04-08 14:27:17 -05:00
James Grugett
238af975e3 Reverse FR acitivty as well 2022-04-07 18:00:44 -05:00
James Grugett
7dfc3fb966 Reverse contract feed on contract page! 2022-04-07 16:29:36 -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
14cef9ffc3 Move contract description out of activity feed 2022-04-07 16:09:19 -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
20052b61ec AmountInput: filter non-numeric, show numeric keyboard on ios 2022-04-06 22:48:06 -05:00
James Grugett
849248376b Memo-ize graph components for better performance 2022-04-06 13:56:08 -05:00
James Grugett
a524b952ee FR: Hide contract activity on mobile when betting 2022-04-06 00:22:43 -05:00
James Grugett
f749eb1df8 Log views of contracts in feed 2022-04-04 22:28:38 -05:00
James Grugett
f577437a8b Show your avatar and balance in mobile bottom bar instead of 'More' 2022-04-04 16:49:14 -05:00
James Grugett
708773e9a6 Fix FR not having correct loan info 2022-04-04 11:30:49 -05:00
James Grugett
d0aa9c710c "A market for every question" 2022-04-04 01:07:58 -05:00
James Grugett
1ec8fc5b45 Deemphasize sign in button on sidebar. Change bet panel to use 'sign up' wording. 2022-04-04 00:58:56 -05:00
James Grugett
6d25494713 Add Manifold Markets logo on signed out home. 2022-04-04 00:45:23 -05:00
James Grugett
076f2979b4 Reinstate Manifold Markets logo 2022-04-04 00:09:01 -05:00
James Grugett
3760cd576b Tweak padding/margin 2022-04-03 23:37:14 -05:00
James Grugett
7cd4b5d454 Remove communities from top-level nav. List out options in mobile 2022-04-03 23:20:41 -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
ef0408dcdf Mobile navbar includes Portfolio instead of Communities. Each option is labeled! 2022-04-03 18:26:50 -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
James Grugett
5dcd43f5b2 Refactor tricky bet calculations to one function 2022-04-03 14:48:53 -05:00
James Grugett
1b9a38ff66 Tweak current value calculation 2022-04-03 11:18:31 -05:00
James Grugett
6b2f6f7185 Calculate invested differently. Sort trades by value and profit, including sales profit. Display profit when sorting by profit. 2022-04-03 01:08:57 -05:00
Austin Chen
55c6481d5b Don't require sign in for bottom navbar 2022-04-02 09:42:01 -07:00
Austin Chen
80728ff4f9 Switch confirmation buttons to the new modal 2022-03-31 02:09:08 -07:00
Austin Chen
94b7ebe5e8 Minor fixes: typo, React keys 2022-03-31 01:38:57 -07: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
James Grugett
925e623a64 Prevent flash of sign in button on navigate 2022-03-30 19:15:38 -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
3eb0bb1711 Throw error if sell conditions don't hold 2022-03-29 21:30:04 -05: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
6e387ef938
Keep FR answer panel open after betting (#68) 2022-03-25 13:33:57 -07:00
Sinclair Chen
50eb9bd4bd
Remove resize handles from input fields (#67) 2022-03-25 09:27:28 -07:00
James Grugett
7d8a87615a Embed market: dynamically adjust graph height 2022-03-24 12:03:17 -05:00
James Grugett
7696dd84b5 Fix 'undefined' shares in DPM tooltip 2022-03-23 00:40:05 -05:00
James Grugett
a967f7459d Sort most traded by volume instead of pool size 2022-03-23 00:27:22 -05:00
James Grugett
510e4400d3 Rename liquidity label to volume label 2022-03-23 00:02:47 -05: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
6d5a4d6e3f Week-on-week retention graph 2022-03-22 16:24:26 -05:00
James Grugett
1a44124a59 Preserve new lines in answer feed item 2022-03-22 00:20:52 -05:00
James Grugett
cc0beb4ca4 DPM: label payout 'Estimated' in bet panel 2022-03-22 00:18:08 -05:00
James Grugett
a37ab956db Hide answers in graph if M$ 0 is bet on it 2022-03-21 19:48:48 -05:00
James Grugett
28e3adcdff Fix embed button on top of profile menu 2022-03-21 19:34:29 -05:00
Austin Chen
a9cdeb46a2 Clean up button styling 2022-03-21 14:54:09 -07:00
James Grugett
033ff3e150 Implement copy for non-standard browsers. Fix flaky embed copy 2022-03-21 16:44:11 -05:00
James Grugett
cf2b54ab8d Rearrange contract overview (-10 LOC!) 2022-03-21 16:19:08 -05:00
James Grugett
2eeaeff92d Normal case Embed. Tweak gap so contract details fit in one row on more markets 2022-03-21 15:36:03 -05:00
James Grugett
4a617a4c07 Share embed button 2022-03-21 15:23:21 -05:00
James Grugett
0592909248 Subtract loan amount from investment 2022-03-21 01:29:53 -05:00
Austin Chen
03592f9c3e Add sort by close time 2022-03-20 19:30:04 -07: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
cc15eb2044 Make embedded market link a clickable link 2022-03-20 18:12:33 -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
47f95678bd Fix closing soon sort 2022-03-19 11:22:24 -05:00
James Grugett
f00064732d Only answers with less than 0.01% are filtered from feed. 2022-03-19 01:13:40 -05:00
Austin Chen
d6a751d9a2 Show decimals on 98%+ 2022-03-18 20:02:04 -07:00
Austin Chen
434c7b6b97 Add most likely, least likely sort options 2022-03-18 19:22:59 -07:00
James Grugett
5f4908b072 Invert closed markets sort 2022-03-18 21:15:30 -05:00
James Grugett
e638bf1b32 Filter out closed markets from most sort options on markets page 2022-03-18 21:07:06 -05:00
Austin Chen
758385f044 Invert Tweet button 2022-03-18 17:05:31 -07:00
Austin Chen
4c8b7bbc3d Hide buy button when market has closed 2022-03-17 17:15:07 -07:00
James Grugett
e0989bdfde Fix loan amount label to account for sales. 2022-03-17 12:04:48 -05:00
mantikoros
f14a87c9b3 remove bio placeholder text again, preserve spacing 2022-03-17 12:03:15 -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
Austin Chen
3b933923e2 Revert "user page: remove bio placeholder text"
This reverts commit 3009c6cc01.
2022-03-17 00:07:10 -07:00
mantikoros
3009c6cc01 user page: remove bio placeholder text 2022-03-16 23:48:38 -05:00
Austin Chen
e4c9508340 Show "Buy" and % directly in FR feed 2022-03-16 21:42:24 -07:00
Austin Chen
94f6f08784 Disable submissions without eating the comment after 1h 2022-03-16 19:55:03 -07:00
Austin Chen
01884bd3df Remove 'pool' from label 2022-03-16 19:42:42 -07:00
Austin Chen
9426cc2b94 Stop showing creator's trades in all cases 2022-03-16 19:37:43 -07:00
Austin Chen
d4af15714c Remove delete button from the UI 2022-03-16 19:25:39 -07:00
James Grugett
727911816c Fix graph bug for sold bets. 6 lines. Clean up. 2022-03-16 18:47:12 -05:00
James Grugett
0390e851fc Show loan summary above bets table. Remove parenthetical loan amount per bet. 2022-03-16 18:08:33 -05:00
James Grugett
4847939e8c Filter out redemption bets from feeds 2022-03-16 17:55:11 -05:00
James Grugett
ecc87c7989 Correctly render resolve prob % 2022-03-15 21:46:14 -05:00
Austin Chen
958dc2b431 Use a stacked line graph for FR answers 2022-03-15 17:26:59 -07: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
bd62d8fbcd FR graph: Truncate answer labels further 2022-03-15 15:32:39 -05:00
Austin Chen
1444d60e11 Visual touchups on FeedAnswerGroups 2022-03-15 13:11:14 -07:00
James Grugett
1bb5d3b8cd
Answers graph (#65)
* In progress

* Calculate correct graph probabilites
2022-03-15 14:42:04 -05:00
Austin Chen
f17c4ac40f Fix username link 2022-03-15 12:22:21 -07:00
James Grugett
db7eee495c Answer group feed: Always include answer of last bet. 2022-03-14 19:39:40 -05:00
James Grugett
a82b3577d4 Group older bets by 7-days 2022-03-14 17:11:10 -05:00
James Grugett
7ca0b3662f Small avatars for nested feed items 2022-03-14 16:56:53 -05:00
James Grugett
5524889d48 FR answer group: Choose one outcome for having a comment 2022-03-14 16:39:59 -05:00
James Grugett
f2d26b631d Filter out undefined answer 2022-03-14 16:08:08 -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
d053fb6cb7 Store users's last sort in localstorage 2022-03-13 14:46:09 -07:00
Austin Chen
e5d02dde06 Allow filtering your trades 2022-03-13 13:55:42 -07:00
James Grugett
719ec5cc54 Linkify answer text on activity feed 2022-03-11 11:13:16 -06:00
James Grugett
7bb663891f Put back outcome labels for non-free response. 2022-03-10 12:37:42 -06:00
James Grugett
eaa1a26af4 Show bets where you can add a comment on contract page feed. 2022-03-10 00:29:36 -06:00
James Grugett
404f3a6b0c FR: Show answer in feed for single bets. Show your bets on contract page feed 2022-03-10 00:12:00 -06:00
James Grugett
c24c9404a7 Hide bets on free response feed (except for feedType 'multi') 2022-03-09 21:23:17 -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
9fbed63eaf Show the market creator's bets in feed 2022-03-08 16:24:06 -08:00
James Grugett
b0e4f6d27a Add time param to Twitter share url, so that the image preview is re-fetched 2022-03-08 15:36:15 -06:00
James Grugett
a8fd4c8014 Better fix the create market focus issues. Expand to 4 lines when you add many chars to a question. 2022-03-06 00:48:08 -08:00
James Grugett
d8681b043c Only autofocus question input if no question text and not focused. 2022-03-05 23:58:54 -08:00
James Grugett
4ee458d3f5 Align "See more..." right on mobile 2022-03-05 23:48:35 -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
cb9fa0ceb2 Daily active users & comments 2022-03-03 12:59:12 -08:00
mantikoros
ed9b20b5ad fast folds: add russia-ukraine 2022-03-03 13:57:59 -05:00
Austin Chen
b4f8fcf38e Show profit/loss in sale panel 2022-03-03 02:10:20 -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
c0ace53df2 Improve VisD & copy on landing page 2022-03-03 00:56:03 -08:00
Austin Chen
76c4cd6d68
Render timestamps client-side to fix timezone (#58)
* Render timestamps client-side to fix timezone

* Fix compilation error
2022-03-02 23:51:58 -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
4d8af33c85 Invested value => Investment value 2022-03-02 15:48:38 -08:00
James Grugett
6285212a1e Update your trades to show total profit, invested value 2022-03-02 15:42:59 -08:00
James Grugett
fa817c34a9 Fix more places where insufficient balance error was not accounting for loans 2022-03-02 14:28:23 -08:00
James Grugett
cd8b336635 Enforce a max comment length 2022-03-02 14:09:53 -08:00
James Grugett
405604adef Fix insufficient balance error to use bet amount net loan 2022-03-02 14:02:44 -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
1dd078562a Fix to actually show investment instead of current value. And subtract bet amount from current value. 2022-03-01 21:09:33 -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
Austin Chen
a3973b3481 Comment on cmd+enter too 2022-03-01 18:52:50 -08:00
Austin Chen
6243f132aa Add "closed" sort option 2022-03-01 18:02:07 -08:00
James Grugett
5944cada77 Quick fix: don't show points in graph when > 100 bets 2022-03-01 17:43:06 -08:00
James Grugett
415bd4990a Check each word individually in markets search 2022-02-28 17:52:41 -08:00
James Grugett
71faee584c Add funds menu option, and Add funds page 2022-02-28 17:32:53 -08:00
James Grugett
5a39ca4c5e Don't show payout if chosen column for resolved markets 2022-02-28 16:44:25 -08:00