Commit Graph

438 Commits

Author SHA1 Message Date
FRC
1f8c72b4c9
Overview page on groups (#961)
* Frontpage on groups

wip

* Fix James's nits
2022-10-03 00:02:31 +01:00
mantikoros
09e4864b32 consistent tip amount (M$10) 2022-10-01 15:57:47 -05:00
James Grugett
1e2df99054 Change format money to round up if within epsilon 2022-09-30 15:05:49 -05:00
Ian Philips
ac97e62f2e Add portfolio updates to notification settings 2022-09-30 13:45:57 -06:00
Ian Philips
a90b765670
Bounty comments (#944)
* Adding, awarding, and sorting by bounties

* Add notification for bounty award as tip

* Fix merge

* Wording

* Allow adding in batches of m250

* import

* imports

* Style tabs

* Refund unused bounties

* Show curreantly available, reset open to 0

* Refactor

* Rerun check prs

* reset yarn.lock

* Revert "reset yarn.lock"

This reverts commit 4606984276.

* undo yarn.lock changes

* Track comment bounties
2022-09-30 09:27:42 -06:00
Sinclair Chen
b7df1a7043
Add ||spoilers|| (#942)
* Add ||spoilers||
* Add spoiler button to format menu
2022-09-29 14:28:04 -07:00
James Grugett
13dad9a10c Date doc: Remove photo as first-class feature 2022-09-27 19:03:14 -04:00
James Grugett
b21daa1248
Date docs on Manifold (#941)
* Date docs

* Create date doc

* Create and show a date market as well

* Move url to date-docs

* Date doc individual page

* Add share button

* Edit date docs

* Layout

* Add comments for create-post

* Add comments and back nav

* Fix urls

* Tweaks
2022-09-27 17:30:07 -05:00
Barak Gila
7ba19c274b
basic sprig integration with possible page URL events (#932)
* basic sprig integration with possible page URL events

* iteration 0

* iteration 1

* run prettier; attempt to remove expect error

* readd expect error messages

* typescript comment fixes

* add identify

* remove package-lock.json

* extract to separate file

* fix linting

* fix lint

* fix lint

* fix missing config
2022-09-27 12:02:03 -05:00
Ian Philips
df316fc4da
Portfolio update emails (#928)
* Stats computing correctly

* Styles propagating - testing in prod now

* Formatting html

* Reset portfolio flag on mondays at 12am

* Add profit, styling

* More styling, less reports

* Cleanup

* Comments

* comment

* Try to send higher signal emails

* Send emails to proper email address
2022-09-26 17:49:06 -04:00
Ian Philips
a10e4c115e Fix dpm MULTI resolution payouts bug 2022-09-26 15:57:21 -04:00
James Grugett
1a5dcdedcc Delay prefetch by 1000ms. Don't prefetch portfolio history. 2022-09-23 16:30:44 -04:00
FRC
5a10132e2b
Add a "Posts" tab to groups (#926)
* Add a "Posts" sidebar item to groups

* Fix James's nits

* Show "Add Post" button only to users
2022-09-23 15:11:50 -04:00
James Grugett
c6d034545a
Home: Prob change cards. Sort by daily score. (#925)
* Add dailyScore: product of unique bettors (3 days) and probChanges.day

* Increase memory and duration of scoreContracts

* Home: Smaller prob change card for groups. Use dailyScore for sort order (algolia)

* Add back hover
2022-09-22 16:57:48 -05:00
Ian Philips
6c3338f5d7 Remove unused unsubscribe attributes 2022-09-20 09:59:48 -04:00
James Grugett
c338dce3ce Add daily activation rate. Remove top tenth actions. Cleanup 2022-09-20 00:10:05 -05:00
James Grugett
4dc3eada1f Add more stats. Fix timezone. Group retention and new user retention 2022-09-19 18:41:24 -05:00
mantikoros
24cf42284f replace "predictor" => "trader" 2022-09-19 14:03:52 -05:00
James Grugett
b93af31d2f Add D1 and W1 (new users) to stats 2022-09-19 01:28:18 -05:00
Marshall Polaris
58dcbaaf6e
Precalculate and store current positions for users who make comments (#878) 2022-09-18 15:57:50 -07:00
Marshall Polaris
39119a3419
Twitch bot deployment work (#892)
* Point at production Twitch bot endpoint

* Move Twitch endpoints into env config
2022-09-18 01:13:10 -07:00
mantikoros
f71791bdd5 fix labels 2022-09-17 19:10:34 -05:00
mantikoros
fdde57e334 'predictor' => 'trader' 2022-09-17 15:10:16 -05:00
mantikoros
340b21c53e halve referral bonus 2022-09-17 14:38:52 -05:00
mantikoros
fc5807ebbe halve MAX_QUESTION_LENGTH 2022-09-17 14:38:52 -05:00
James Grugett
25ee793208
🏠 New home (#889)
* Factor out section header

* Remove daily balance change

* Remove dead code

* Layout, add streak

* Fix visibility observer to work on server

* Tweak

* Search perserved by url

* Add pill query param

* Add search page

* Extract component for ProbChangeRow

* Explore groups page

* Add search row

* Add trending groups section

* Add unfollow option for group

* Experimental home: accommodate old saved sections.

* Tweaks to search layout

* Rearrange layout

* Daily movers page

* Add streak grayed out indicator

* Use firebase query instead of algolia search for groups

* Replace trending group card with pills

* Hide streak if you turned off that notification

* Listen for group updates

* Better UI for adding / removing groups

* Toast feedback for join/leave group. Customize button moved to bottom.

* Remove Home title

* Refactor arrange home

* Add new for you section

* Add prefetch

* Move home out of experimental!

* Remove unused import

* Show non-public markets from group
2022-09-16 16:12:24 -05:00
Phil
52ecd79736
Twitch prerelease (#887)
* Bot linking button functional.

* Implemented initial prototype of new Twitch signup page.

* Removed old Twitch signup page.

* Moved new Twitch page to correct URL.

* Twitch account linking functional.

* Fixed charity link.

* Changed to point to live bot server.

* Slightly improve spacing and alignment on Twitch page

* Tidy up, handle some errors when talking to bot

* Seriously do the thing where Twitch link is hidden by default

* Fixed secondary Get Started button. Copy overlay and dock link now functional.

* Add/remove bot from channel working.

* Removed legacy Twitch controls from user profile.

* Links provided by dock/overlay buttons are now correct.

* Minor profile cleanup post merge.

* Fixed unnecessary relinking Twitch account when logging in on Twitch page.

* Added confirmation popup to refresh API key. Refreshing API key now requires a user to relink their Twitch account.

* Removed legacy twitch-panel.tsx

Co-authored-by: Marshall Polaris <marshall@pol.rs>
2022-09-16 08:43:49 -07:00
Ian Philips
a2d912bb5a Add more info to limit order notif 2022-09-16 09:02:58 -06:00
Ian Philips
6a5873f8d4 Try more restrictive detault notification settings 2022-09-16 07:43:27 -06:00
mantikoros
5a1cc4c19d getCpmmInvested: fix NaN issue 2022-09-15 18:32:38 -05:00
Ian Philips
7628713c4b Enrich contract resolved notification 2022-09-15 15:25:19 -06:00
Ian Philips
8c6a40bab7 Enrich limit order notification 2022-09-15 13:39:46 -06:00
Ian Philips
b3e6dce31e Capitalize 2022-09-15 09:57:14 -06:00
Ian Philips
be91d5d5e0 Avatars don't link during contract selection 2022-09-15 09:51:52 -06:00
Ian Philips
e9f136a653 Single source of truth for predict 2022-09-15 09:12:56 -06:00
Ian Philips
733d206517 Add txn types 2022-09-15 07:50:35 -06:00
Ian Philips
4a5c6a42f6 Store bonus txn data in data field 2022-09-15 07:45:11 -06:00
ingawei
ccf02bdba8
Inga/admin rules resolve (#880)
* Giving admin permission to resolve all markets that have closed after 7 days.
2022-09-14 22:28:40 -05:00
Ian Philips
3efd968058 Allow one-click unsubscribe, slight refactor 2022-09-14 17:17:32 -06:00
Ian Philips
7ba2eab65e Rename user notification preferences 2022-09-14 10:26:08 -06:00
Ian Philips
d6b0a1edc0 Betting streak reset to 7am UTC and store streak data on notif 2022-09-14 07:27:20 -06:00
mantikoros
a2d61a1daa
Twitch integration (#815)
* twitch account linking; profile page twitch panel; twitch landing page

* fix import

* twitch logo

* save twitch credentials cloud function

* use user id instead of bot id, add manifold api endpoint

* properly add function to index

* Added support for new redirect Twitch auth.

* Added clean error handling in case of Twitch link fail.

* remove simulator

* Removed legacy non-redirect Twitch auth code. Added "add bot to channel" button in user profile and relevant data to user type.

* Removed unnecessary imports.

* Fixed line endings.

* Allow users to modify private user twitchInfo firestore object

* Local dev on savetwitchcredentials function

Co-authored-by: Phil <phil.bladen@gmail.com>
Co-authored-by: Marshall Polaris <marshall@pol.rs>
2022-09-14 01:52:31 -07:00
Marshall Polaris
7144e57c93
Denormalize user display fields onto bets (#853)
* Denormalize user display fields onto bets

* Make bet denormalization script fast enough to run it on prod

* Make `placeBet`/`sellShares` immediately post denormalized info
2022-09-14 01:33:59 -07:00
mantikoros
e7d8cfe7e0
House liquidity (#876)
* add house liquidity for unique bettors

* hide notifications from house liquidity

* up bonus liquidity to  M$20
2022-09-14 00:26:47 -05:00
James Grugett
483838c1b2 Revert "Make parse.richTextToString more efficient (#848)"
This reverts commit cb143117e5.
2022-09-12 19:06:37 -05:00
Marshall Polaris
cb143117e5
Make parse.richTextToString more efficient (#848) 2022-09-12 16:11:03 -07:00
Sinclair Chen
22d2248951
Add floating menu (bold, italic, link) (#867)
* Add floating menu (bold, italic, link)
* Sanitize and href-ify user input
2022-09-12 16:10:32 -07:00
FRC
ff81b859d1
"Fix "500 internal error" in large groups (#872)
* Fix "500 internal error" in large groups (#856)

This reverts commit 28f0c6b1f8.

* Ship without touching prod and with some logs.
2022-09-12 20:54:11 +01:00
Ian Philips
5c6328ffc2
[WIP] Fully customizable notifications (#860)
* Notifications Settings page working

* Update import

* Linked notification settings to notification rules

* Add more subscribe types

* It's alive... It's alive, it's moving, it's alive, it's alive, it's alive, it's alive, IT'S ALIVE'

* UI Tweaks

* Clean up comments

* Direct & highlight sections for notif mgmt from emails

* Comment cleanup

* Comment cleanup, lint

* More comment cleanup

* Update email templates to predict

* Move private user out of getDestinationsForUser

* Fix resolution messages

* Remove magic

* Extract switch to switch-setting

* Change tab in url

* Show 0 as invested or payout

* All emails use unsubscribeUrl
2022-09-12 10:34:56 -06:00
FRC
28f0c6b1f8
Revert "Fix "500 internal error" in large groups (#856)" (#871)
This reverts commit a6ed8c9228.
2022-09-12 17:26:46 +01:00
FRC
a6ed8c9228
Fix "500 internal error" in large groups (#856)
* Members to memberIds

* Moved to update-metrics
2022-09-12 16:44:24 +01:00
James Grugett
c1287a4a25
Small updates to experimental home (#870)
* Line clamp question in prob change table

* Tweaks

* Expand option for daily movers

* Snap scrolling for carousel

* Add arrows to section headers

* Remove carousel from experimental/home

* React querify fetching your groups

* Edit home is its own page

* Add daily profit and balance

* Merge branch 'main' into new-home

* Make experimental search by your followed groups/creators

* Just submit, allow xs on pills

* Weigh in

* Use next/future/image component to optimize avatar images

* Inga/challenge icon (#857)

* changed challenge icon to custom icon
* fixed tip button alignment

* weighing in and trading "weigh in" for "trade"

* Delete closing soon, mark new as New for you, trending is site-wide

* Delete your trades. Factor out section item

* Don't allow hiding of home sections

* Convert daily movers into a section

* Tweaks for loading daily movers

* Prob change table shows variable number of rows

* Fix double negative

Co-authored-by: Ian Philips <iansphilips@gmail.com>
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
Co-authored-by: ingawei <46611122+ingawei@users.noreply.github.com>
Co-authored-by: mantikoros <sgrugett@gmail.com>
2022-09-12 00:39:04 -05:00
jahooma
11ba65ec4a Auto-remove unused imports 2022-09-09 22:43:33 +00:00
FRC
26f83ac4f6
Adds investmentValue to group leaderboard calculation (#855)
* Adds investmentValue to group leaderboard calculation

* Initial investment is no longer counted, only the profit

* Simplify scoring calculation

* Remove console.log

* Group bets by user first

Co-authored-by: James Grugett <jahooma@gmail.com>
2022-09-09 17:42:51 -05:00
akrolsmir
cca870ced5 Auto-remove unused imports 2022-09-09 21:27:16 +00:00
Austin Chen
fdf123b875 Remove console.logs from common code
This makes it easier to debug in local; we shouldn't be checking in console.log into the codebase, as a general rule
2022-09-09 14:26:23 -07:00
James Grugett
cf74a195b2 Redeem shares: pay back a smaller frac of your loan 2022-09-08 22:59:25 -05:00
Pico2x
1e645f911a Add Fede to admin pt2 2022-09-08 17:14:40 +01:00
James Grugett
54c227cf6c
Updates to experimental home (#858)
* Line clamp question in prob change table

* Tweaks

* Expand option for daily movers

* Snap scrolling for carousel

* Add arrows to section headers

* Remove carousel from experimental/home

* React querify fetching your groups

* Edit home is its own page

* Add daily profit and balance

* Merge branch 'main' into new-home

* Make experimental search by your followed groups/creators

* Just submit, allow xs on pills

* Weigh in

* Use next/future/image component to optimize avatar images

* Inga/challenge icon (#857)

* changed challenge icon to custom icon
* fixed tip button alignment

* weighing in and trading "weigh in" for "trade"

Co-authored-by: Ian Philips <iansphilips@gmail.com>
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
Co-authored-by: ingawei <46611122+ingawei@users.noreply.github.com>
Co-authored-by: mantikoros <sgrugett@gmail.com>
2022-09-08 01:36:34 -05:00
FRC
0acdec787d
Adds comments to posts (#844)
* Adds comments to posts

* Uncoupled CommentInput from Contracts

* Fix nits
2022-09-07 23:09:20 +01:00
Ian Philips
2ee067c072 Remove member and contract ids from group doc 2022-09-06 08:14:13 -06:00
Marshall Polaris
6ef2beed8f
Denormalize betAmount and betOutcome fields on comments (#838)
* Create and use `betAmount` and `betOutcome` fields on comments

* Be robust to ridiculous bet IDs on dev
2022-09-04 14:28:45 -07:00
James Grugett
9060abde8e Cache prob and prob changes on cpmm contracts 2022-09-03 15:06:42 -05:00
Ian Philips
cf508fd8b6
Members and contracts now subcollections of groups (#847)
* Members and contracts now documents

* undo loans change?

* Handle closed group

* Slight refactoring

* Don't allow modification of private groups contracts

* Add back in numMembers

* Update group field names

* Update firestore rules

* Update firestore rules

* Handle updated groups

* update start numbers

* Lint

* Lint
2022-09-02 18:06:48 -06:00
James Grugett
2f53cef36f Move metrics calculation to common 2022-09-02 18:45:42 -05:00
James Grugett
8029ee49a4 Fix loans bug 2022-09-01 23:06:57 -05:00
Ian Philips
00ba3b0c48
Show avatars of tippers and unique bettors (#837)
* Show avatars of tippers and unique bettors

* Make transparent the avatar bg

* fix import
2022-09-01 16:23:12 -06:00
Ian Philips
8d853815d6
Show resolution on og card image (#834)
* Handle resolved markets

* Add in group names as hashtags
2022-09-01 13:55:24 -06:00
FRC
96be4e8992
Add embedded ContractGrid to Posts (#822)
* Add embedded market grids

* Hacky way to set height

I haven't figured out a way yet to get the height of the actual iframe's content, so I did some bad estimate for now to unblock shipping the feature, while I continue investigating.
2022-09-01 17:47:45 +01:00
Marshall Polaris
0568322c82
Dramatically improve server auth stuff (#826) 2022-08-31 22:13:26 -07:00
James Grugett
849402ed70 Rearrange home sections. Load more in carousel. 2022-08-30 23:47:09 -05:00
Ian Philips
aad5f6528b
new market view (#819)
* Show old details on lg, don't unfill heart

* Hide tip market if creator

* Small ui tweaks

* Remove contract. calls

* Update high-medium-low

* Remove unused bets prop

* Show uniques

* Remove unused bets prop
2022-08-30 17:13:25 -06:00
Ian Philips
a0402830c5
liking markets with tip/heart (#798)
* WIP liking markets with tip

* Refactor Userlink, add MultiUserLink

* Lint

* Lint

* Fix merge

* Fix imports

* wip liked contracts list

* Cache likes and liked by user ids on contract

* Refactor tip amount, reduce to M

* Move back to M

* Change positioning for large screens
2022-08-30 09:38:59 -06:00
FRC
e1f19c52ab
Post in a group about page. (#803)
* Dashboards in Group about page

* Rename group dashboard to 'About Post'

* Fixed James nits
2022-08-30 13:39:10 +01:00
Marshall Polaris
1369f3b967
WIP persistence work (#762)
* WIP persistence work

* Fix up close date filter, kill custom scroll restoration

* Use built-in Next.js scroll restoration machinery

* Tweaking stuff

* Implement 'history state' idea

* Clean up and unify persistent state stores

* Respect options for persisting contract search

* Fix typing in common lib

* Clean up console logging
2022-08-29 21:56:11 -07:00
FRC
851cffd73e
Dashboards (#791)
* Create backend for Dashboards

* Rm lastupdatetime for now

* Added a create-dashboard and sharable view dashboard page

* Various nit fixes.

* Renamed Dashboards to Posts

* Fix nits
2022-08-29 16:06:17 +01:00
mantikoros
03e07037ea
ban users from posting (#810) 2022-08-28 00:23:25 -05:00
James Grugett
2acc1a8433 Double daily loans rate to 2% 💰💰 2022-08-28 00:11:28 -05:00
James Grugett
d7793841d1 Fix NaN invested (floating point error) 2022-08-27 17:13:29 -05:00
James Grugett
a9ea335cd1 Fix create page serverside vs clientside render discrepancy console error 2022-08-27 01:07:39 -05:00
James Grugett
86cf956894 Add eslint plugin to remove unused imports 2022-08-26 23:49:03 -05:00
Sinclair Chen
1b029ce8dd
bump tiptap version to fix multi-italic bug (#801) 2022-08-25 20:56:38 -07:00
Ian Philips
90e1fdb586 Add david to admins 2022-08-25 07:54:50 -06:00
Ian Philips
dc89d5d4d0 Feature markets on trending 2022-08-25 07:05:26 -06:00
Ian Philips
b9f0da9d3b Give all users 5 free markets 2022-08-25 05:51:56 -06:00
James Grugett
cffd5dcd31 Weekly => daily loans 2022-08-24 22:03:07 -05:00
Ian Philips
535e50eeac Betting streak bonus per day:10, max:50 2022-08-24 17:40:03 -06:00
Ian Philips
bca34dad60 Set max betting bonus to M 2022-08-24 17:31:35 -06:00
mantikoros
d390b39e0a eliminate fees 2022-08-24 15:29:48 -05:00
Ian Philips
f50b4775a1
Allow to follow/unfollow markets, backfill as well (#794)
* Allow to follow/unfollow markets, backfill as well

* remove yarn script edit

* add decrement comment

* Lint

* Decrement follow count on unfollow

* Follow/unfollow button logic

* Unfollow/follow => heart

* Add user to followers in place-bet and sell-shares

* Add tracking

* Show contract follow modal for first time following

* Increment follower count as well

* Remove add follow from bet trigger

* restore on-create-bet

* Add pubsub to dev.sh, show heart on FR, remove from answer trigger
2022-08-24 10:49:53 -06:00
Ian Philips
e1775681aa Add weekly email sent flag, filter out manifold grouped markets 2022-08-22 16:36:39 -06:00
Austin Chen
0cd61eb214 DX: Link to Firestore console from "..." 2022-08-22 10:48:21 -07:00
James Grugett
e6db99e810 Check loans calc for isFinite 2022-08-22 10:20:22 -05:00
Austin Chen
88bf678ce3
Allow custom environments to override any economic aspect (#787)
* Extract monetary constants to a single file economy.ts

* Add missing import

* Allow environments to override any econ variable

* Update imports

* Update more imports

* Fix import
2022-08-21 22:37:26 -07:00
James Grugett
8b7cd20b6f
Loans2: Bets return you some capital every week (#588)
* Remove some old loan code

* Almost complete implementation of updateLoans cloud function

* Merge fixes

* Use invested instead of sale value, check if eligible, perform payouts

* Run monday 12am

* Implement loan income notification

* Fix imports

* Loan update fixes / debug

* Handle NaN and negative loan calcs

* Working loan notification

* Loan modal!

* Move loans calculation to /common

* Better layout

* Pay back loan on sell shares

* Pay back fraction of loan on redeem

* Sell bet loan: negate buy bet's loan

* Modal tweaks

* Compute and store nextLoanCached for all users

* lint

* Update loans with newest portfolio

* Filter loans to only unresolved contracts

* Tweak spacing

* Increase memory
2022-08-22 00:22:49 -05:00
James Grugett
09e8993cd4 Implement visibility option for new markets 2022-08-20 14:31:32 -05:00
Ian Philips
03d98a7ad7 Reset hour to 12am utc 2022-08-19 17:16:17 -06:00
Ian Philips
36bfbe8f42 Change betting streak modal, tweak trending email query 2022-08-19 14:37:16 -06:00
Ian Philips
a0f62ba172
Markets emails (#764)
* Send out email template for 3 trending markets

* Rich text to plaintext descriptions, other ui changes

* Lint

* Filter for closed markets

* Change sign

* First order must be closeTime

* Send 6 emails, check flag twice

* Exclude contracts with trump and president in the name

* interesting markets email

* sendInterestingMarketsEmail

* Change subject line back

Co-authored-by: mantikoros <sgrugett@gmail.com>
2022-08-19 11:43:57 -06:00
Ian Philips
00c9fa61c3
betting streaks (#777)
* Parse notif, show betting streaks modal, schedule function

* Ignore streaks of 0

* Pass notifyFills the contract

* Turn 9am into a constant

* Lint

* Up streak reward, fix timing logic

* Change wording
2022-08-19 11:10:32 -06:00