Commit Graph

364 Commits

Author SHA1 Message Date
Ian Philips
deaa595f07 Exclude contract creator in both places 2022-07-14 09:32:50 -06:00
Ian Philips
eb6b1b9f89 Rename on-delete-group 2022-07-14 08:02:54 -06:00
Ian Philips
ee01328553 Remove group slugs from contracts on delete group 2022-07-14 07:53:41 -06:00
Sinclair Chen
664e55a40b
Add typing, pasting links (#646) 2022-07-13 15:56:15 -07:00
Sinclair Chen
f08d6bda93
when adding package, don't put ^ before version (#645) 2022-07-13 15:14:06 -07:00
Ian Philips
55c91dfcdd
Categories to groups (#641)
* start on script

* Revert "Remove category filters"

This reverts commit d6e808e1a3.

* Convert categories to official default groups

* Add new users to default groups

* Rework group cards

* Cleanup

* Add unique bettors to contract and sort by them

* Most bettors to most popular

* Unused vars

* Track unique bettor ids on contracts

* Add followed users' bets to personal markets

* Add new users to welcome, bugs, and updates groups

* Add users to fewer default cats
2022-07-13 15:11:22 -06:00
Sinclair Chen
9a11f55762
Rich content (#620)
* Add TipTap editor and renderer components

* Change market description editor to rich text

* Type description as JSON, fix string-based logic

- Delete make-predictions.tsx
- Delete feed logic that showed descriptions

* wip Fix API validation

* fix type error

* fix extension import (backend)

In firebase, typescript compiles imports into common js imports
like `const StarterKit = require("@tiptap/starter-kit")`

Even though StarterKit is exported from the cjs file, it gets imported
as undefined. But it magically works if we import *

If you're reading this in the future, consider replacing StarterKit with
the entire list of extensions.

* Stop load on fail create market, improve warning

* Refactor editor as hook / fix infinite submit bug

Move state of editor back up to parent
We have to do this later anyways to allow parent to edit

* Add images - display, paste + uploading

* add uploading state of image

* Fix placeholder, misc styling

min height, quote

* Fix appending to description

* code review fixes: rename, refactor, chop carets

* Add hint & upload button on new lines

- bump to Tailwind 3.1 for arbitrary variants

* clean up, run prettier

* rename FileButton to FileUploadButton

* add image extension as functions dependency
2022-07-13 11:58:22 -07:00
James Grugett
50eee33a6e Redeem shares of makers after matching with limit bets 2022-07-13 12:51:19 -05:00
mantikoros
24896e44b4 "limit bet" => "limit order" 2022-07-12 16:46:03 -05:00
Marshall Polaris
5fd42df1ed
Don't run share redemption after adding liquidity (#631) 2022-07-12 12:36:31 -07:00
mantikoros
61300e93a4 more validation for creating numeric markets 2022-07-11 11:38:51 -05:00
Marshall Polaris
4700ceb14c
Refactor some backend-related stuff (#639)
* web/lib/firebase/api-call -> common/api, web/lib/firebase/api

* Reuse `APIError` type in server code

* Reuse `getFunctionUrl` in server code
2022-07-10 15:03:15 -07:00
Marshall Polaris
6462d4a2ed
Migrate createUser function to v2 (#633) 2022-07-10 14:02:32 -07:00
Marshall Polaris
eb9b14d6d5
Migrate unsubscribe function to v2 (#637)
* Migrate unsubscribe function to v2

* Move Stripe import because I forgot to do it before
2022-07-10 13:46:00 -07:00
James Grugett
f2df32e710 PseudoNumeric markets store resolveValue in resolved notification and render it 2022-07-10 14:52:31 -05:00
James Grugett
900fc75506 Add sourceContractId to bet_fill notification 2022-07-10 13:45:32 -05:00
James Grugett
80ae551ca9
🧾 Limit orders! (#495)
* Simple limit order UI

* Update bet schema

* Restrict bet panel / bet row to only CPMMBinaryContracts (all binary DPM are resolved)

* Limit orders partway implemented

* Update follow leaderboard copy

* Change cpmm code to take some state instead of whole contract

* Write more of matching algorithm

* Fill in more of placebet

* Use client side contract search for emulator

* More correct matching

* Merge branch 'main' into limit-orders

* Some cleanup

* Listen for unfilled bets in bet panel. Calculate how the probability moves based on open limit orders.

* Simpler switching between bet & limit bet.

* Render your open bets (unfilled limit orders)

* Cancel bet endpoint.

* Fix build error

* Rename open bets to limit bets. Tweak payout calculation

* Limit probability selector to 1-99

* Deduct user balance only on each fill. Store orderAmount of bet. Timestamp of fills.

* Use floating equal to check if have shares

* Add limit order switcher to mobile bet dialog

* Support limit orders on numeric markets

* Allow CORS exception for Vercel deployments

* Remove console.logs

* Update user balance by new bet amount

* Tweak vercel cors

* Try another regexp for vercel cors

* Test another vercel regex

* Slight notifications refactor

* Fix docs edit link (#624)

* Fix docs edit link

* Update github links

* Small groups UX changes

* Groups UX on mobile

* Leaderboards => Rankings on groups

* Unused vars

* create: remove automatic setting of log scale

* Use react-query to cache notifications (#625)

* Use react-query to cache notifications

* Fix imports

* Cleanup

* Limit unseen notifs query

* Catch the bounced query

* Don't use interval

* Unused var

* Avoid flash of page nav

* Give notification question priority & 2 lines

* Right justify timestamps

* Rewording

* Margin

* Simplify error msg

* Be explicit about limit for unseen notifs

* Pass limit > 0

* Remove category filters

* Remove category selector references

* Track notification clicks

* Analyze tab usage

* Bold more on new group chats

* Add API route for listing a bets by user (#567)

* Add API route for getting a user's bets

* Refactor bets API to use /bets

* Update /markets to use zod validation

* Update docs

* Clone missing indexes from firestore

* Minor notif spacing adjustments

* Enable tipping on group chats w/ notif (#629)

* Tweak cors regex for vercel

* Your limit bets

* Implement selling shares

* Merge branch 'main' into limit-orders

* Fix lint

* Move binary search to util file

* Add note that there might be closed form

* Add tooltip to explain limit probability

* Tweak

* Cancel your limit orders if you run out of money

* Don't show amount error in probability input

* Require limit prob to be >= .1% and <= 99.9%

* Fix focus input bug

* Simplify mobile betting dialog

* Move mobile limit bets list into bet dialog.

* Small fixes to existing sell shares client

* Lint

* Refactor useSaveShares to actually read from localStorage, use less bug-prone interface.

* Fix NaN error

* Remove TODO

* Simple bet fill notification

* Tweak wording

* Sort limit bets by limit prob

* Padding on limit bets

* Match header size

Co-authored-by: Ian Philips <iansphilips@gmail.com>
Co-authored-by: ahalekelly <ahalekelly@gmail.com>
Co-authored-by: mantikoros <sgrugett@gmail.com>
Co-authored-by: Ben Congdon <ben@congdon.dev>
Co-authored-by: Austin Chen <akrolsmir@gmail.com>
2022-07-10 13:05:44 -05:00
Marshall Polaris
67a05c2f1b
Migrate transact function to v2 (#635) 2022-07-09 13:54:15 -07:00
Marshall Polaris
581a42f288
Migrate stripeWebhook and createCheckoutSession to v2 (#636) 2022-07-09 13:43:18 -07:00
mantikoros
e7e686d579 return creator liquidity after resolution 2022-07-09 13:53:50 -04:00
Marshall Polaris
c1ca1471a1
Migrate createAnswer function to v2 (#634)
* Migrate createAnswer function to v2

* Remove unhelpful toString on APIError
2022-07-09 00:26:56 -07:00
Marshall Polaris
fdde73710e
Migrate claimManalink function to v2 (#628)
* Implement helpful `toString` on client `APIError`

* Migrate claimManalink function to v2
2022-07-08 15:28:04 -07:00
Marshall Polaris
d9f42caa6a
Migrate addLiquidity and withdrawLiquidity functions to v2 (#627) 2022-07-08 15:08:17 -07:00
Marshall Polaris
ed0544212d
Migrate changeUserInfo function to v2 (#626) 2022-07-08 15:00:03 -07:00
Ian Philips
b1b016f9e0
Enable tipping on group chats w/ notif (#629) 2022-07-07 17:23:13 -06:00
Ian Philips
de20ee9fb9
Show tip notifications (#623)
* Show tip notifications

* Optimizing notifications for mobile

* Unused vars

* Move income reason logic to income notif

* Remove unnecessary icons

* Unused vars
2022-07-06 13:30:51 -06:00
Ian Philips
3a6d28e2c2
Bold groups with recent chat activity (#621)
* Bold groups with recent chat activity

* Cleanup

* Cleanup
2022-07-05 17:18:37 -06:00
Marshall Polaris
5eca9def9d
Don't accidentally make meaningless zero bets (#619) 2022-07-05 14:01:57 -07:00
Marshall Polaris
4d1c50a6cc
Redemption refactoring (#614)
* Refactor share redemption code into a few sensible functions

* Put very general share redemption code into common
2022-07-05 12:35:39 -07:00
Marshall Polaris
7f2bbdcb87
Allow people to sell all their shares (#599) 2022-07-05 12:26:51 -07:00
Marshall Polaris
a9e74e7111
Add functions framework as explicit dependency (#613) 2022-07-05 12:25:58 -07:00
Marshall Polaris
9bff858696
Fix up lint configuration, lint line endings (#615)
* Make sure we ignore all built code in common and functions

* Add lint for Unix line endings

* Fix line endings in withdraw-liquidity.ts
2022-07-05 12:25:44 -07:00
Ian Philips
b26648c1ce
Daily trading bonuses (#618)
* first commit, WIP

* Give trading bonuses & paginate notifications

* Move read & update into transaction

* Move request bonus logic to notifs icon
2022-07-05 11:29:26 -06:00
Austin Chen
53b4a28944 Check in .env to git 2022-07-04 16:21:59 -07:00
Austin Chen
c39e3aedfa Also send .env file when deploy functions 2022-07-04 16:04:05 -07:00
James Grugett
8fdc44f7f3 Switch to firebase dev before serving firebase emulators 2022-07-03 15:37:24 -04:00
Marshall Polaris
7dea9cbfa8
Use getAll Firestore technology to improve some code (#612) 2022-07-02 16:24:03 -07:00
Marshall Polaris
90d7f55c6d
Fix backup DB job to actually backup most things, refactor (#605)
* Make backup manually invokable and thereby testable

* Add a shitload of missing stuff to our backups

* Also backup follows as per James
2022-07-02 13:27:06 -07:00
Marshall Polaris
18b8758191
Remove code for obsolete feed updater backend jobs (#607)
* Remove code for obsolete feed updater backend jobs

* Kill two more obsolete guys
2022-07-02 13:26:42 -07:00
mantikoros
218b18254c add liquidity: support pseudo numeric markets 2022-07-02 15:46:32 -04:00
mantikoros
1a6afaf44f
Pseudo numeric market (#609)
* create pseudo-numeric contracts

* graph and bet panel for pseudo numeric

* pseudo numeric market layout, quick betting

* Estimated value

* sell panel

* fix graph

* pseudo numeric resolution

* bets tab

* redemption for pseudo numeric markets

* create log scale market, validation

* log scale

* create: initial value can't be min or max

* don't allow log scale for ranges with negative values (b/c of problem with graph library)

* prettier delenda est

* graph: handle min value of zero

* bet labeling

* validation

* prettier

* pseudo numeric embeds

* update disclaimer

* validation

* validation
2022-07-02 14:37:59 -05:00
Sinclair Chen
cc52bff05e
fix functions/README formatting 2022-07-01 16:45:05 -07:00
Ian Philips
5034a43c3c Filter for ian's deleted users 2022-07-01 08:29:12 -06:00
Ian Philips
3165e42119
Referrals (#592)
* add trigger for updated user

* Add referral bonuses and notifications for them

* Cleanup

* Add share group button, cleanup

* Cleanup

* Add referrals list to user profile

* Remove unused

* Referral bonus => constant

* Refactor

* Add referral txn to helper fn

* Move reads into firebase transaction

* Use effects to write referral info

* Flex-wrap profile objects

* Small ui changes

* Restrict referral user to one update

* Remove rogue semicolon

* Note about group referral query details

* Track referrals, add them to settings list
2022-07-01 07:47:19 -06:00
Ben Congdon
c5efd5b7d0
Market Resolution API (#600)
* Add market resolution API

* Add additional free market resolution validation

* Address review comments

* Refactor resolution validation code somewhat

Co-authored-by: Marshall Polaris <marshall@pol.rs>
2022-06-30 15:11:45 -07:00
Marshall Polaris
fc7f19e785
Finalize v2 resolvemarket migration (#598)
* Update resolve-market to be a v2 function

* Cleanup API error responses

* Update frontend to use v2 version of resolvemarket

* Appease ESLint

* Address review comments

* Appease ESLint

* Remove unnecessary auth check

* Fix logic bug in FR market validation

* Make it so you can specify runtime opts for v2 functions

* Cleanup to resolve market API resolutions input, fixes

* Fix up tiny lint

* Last minute cleanup to resolvemarket FR API input validation

Co-authored-by: Benjamin <ben@congdon.dev>
2022-06-29 16:47:06 -07:00
Forrest Wolf
7f9b0557c4
Reorganize verify scripts (#589)
* Update verify to match check for functions

* Give each subdirectory a verify:dir script
2022-06-28 12:46:25 -07:00
Marshall Polaris
0b585d1c98
Typescript project references take 2 (#586)
* More liberal .gitignores on TS output directories

* Use project references for Typescript functions project

* Use /dist dir for Cloud Functions deployment payload

* Fix Github actions functions tsc job
2022-06-27 13:32:24 -07:00
James Grugett
1e904f567a Revert "Use Typescript project references, improve functions build/deploy (#575)"
This reverts commit 4edad9f19b.
2022-06-27 12:30:22 -05:00
Marshall Polaris
0067bee94b
Compute stats in Firebase instead of Vercel (#584)
* Add stats updating cloud function

* Read stats from database on client instead of computing them

* Improve logging for stats updater

* Tidying up
2022-06-26 14:42:42 -07:00
Marshall Polaris
b7cbd2a431 More robust functions deploy script 2022-06-24 22:44:41 -07:00
Marshall Polaris
4edad9f19b
Use Typescript project references, improve functions build/deploy (#575)
* More liberal .gitignores on TS output directories

* Use project references for Typescript projects

* Use /dist dir for Cloud Functions deployment payload

* Disable `next build` typechecking

* Fiddle with GitHub tsc jobs
2022-06-24 22:41:30 -07:00
Marshall Polaris
b4e09e37b1
Bump memory on all v2 functions to 2GB (#577)
* Bump memory on all v2 functions to 2GB

* Also give the v2 functions 1 vCPU

* Also explicitly specify concurrency
2022-06-24 00:18:08 -07:00
Ian Philips
211905c27f Free daily markets on hiatus 2022-06-23 13:00:14 -05:00
Austin Chen
6cc2d8af58
Manalink: Send mana to anyone via link (#114)
* Set up Firestore structure for mana bounty links

* Split up manalinks into successes and failures

* Allow clients to create manalinks

* Track txnId and successful users

* Store custom amounts in the link

* List all manalinks you've created

* Support backend for claiming manalinks

* Add some more error handling

* Tweak readme

* Fix typescript breakage

* Revert "Convert common imports in functions to be absolute"

This reverts commit c03518e906.

* Scaffolding so `claimManalink` works

* Clean up imports

* Barebones endpoint to claim mana

* Fix rules to only allow link creators to query

* Design out claim giftcard

* List all claimed transactions

* Style in a more awesome card

* Fix import

* Padding tweak

* Fix useManalinkTxns hook

* /send -> /link

* Tidy up some details

* Do a bunch of random manalinks work

* Fix up LinksTable to build

* Clean up LinksTable an absurd amount

* Basic details functionality on manalinks table

* Work on manalink claim stuff

* Fix up some merge mess

* Not-signed-in flow implemented

* Better manalinks table

* Only show outstanding links in table

* Use new `ManalinkTxn` type

* /link -> /links

* Change manalinks page UI to use nice looking tabs

* Many fixes to manalinks UI

* Default to 1 use

* Tidying up

* Some copy changes based on feedback

* Add required index

Co-authored-by: Marshall Polaris <marshall@pol.rs>
2022-06-23 01:07:52 -07:00
Ian Philips
6a35d3bf2d Remove group details cache, update group directly 2022-06-22 17:19:17 -05:00
James Grugett
8b1d132e17
Daily/Weekly/Monthly Leaderboards by Fede (#557)
* [Leaderboards] Added period toggle for leaderboards

* [Leaderboards] TopBettors now calculates by period correctly

* [Leaderboard] Use a subcollection for the portfolio caching

* [Leaderboard] Switches to a tab view, temporarily hides the missing topBettors periods

* [Leaderboard] Reverts random yarn.lock changes

* Fix type error from merge

* Increase timeout on update metrics

* Update firebase rules to allow reading user portfolioHistory

Co-authored-by: Pico2x <pico2x@gmail.com>
2022-06-22 15:29:40 -05:00
mantikoros
c58e75f49a comment email: include username in subject; 'on Manifold' in from label 2022-06-22 15:01:03 -05:00
Ian Philips
3b3717d307
Groups (#510)
* Folds=>groups

* Show groups on user profile

* Allow group creation from /create

* Refactoring to groups

* Convert folds to groups

* Add new add to group notification

* Fix user profile tab bug

* Add groups nav and tab for my groups

* Remove bad profile pages

* remove comments

* Add group list dropdown to sidebar

* remove unused

* group cards ui

* Messages=>Comments, v2, groupDetails

* Discussion time

* Cleaning up some code

* Remove follow count

* Fix pool scoring for cpmm

* Fix imports

* Simplify rules, add GroupUser collection

* Fix group cards

* Refactor

* Refactor

* Small fixes

* Remove string

* Add api error detail handling

* Clear name field

* Componentize

* Spacing

* Undo userpage memo

* Member groups are already in my tab

* Remove active contracts reference for now

* Remove unused

* Refactoring

* Allow adding old questions to a group

* Rename

* Wording

* Throw standard v2 APIError

* Hide input for non-members, add about under title

* Multiple names to & # more

* Move comments firestore rules to appropriate subpaths

* Group membership, pool=>volume

* Cleanup, useEvent

* Raise state to parent

* Eliminate unused

* Cleaning up

* Clean code

* Revert tags input deletion

* Cleaning code

* Stylling

* Limit members to display

* Array cleanup

* Add categories back in

* Private=>closed

* Unused vars
2022-06-22 11:35:50 -05:00
Ben Congdon
67d0a6c0c2
Create Top Followed Users leaderboard (#531)
* Create Top Followed Users leaderboard

* Switch to increment/decrement approach for caching user follower counts

* Backfill script for user follow counts

* Appease ESLint

* Address review comment

Co-authored-by: James Grugett <jahooma@gmail.com>
2022-06-22 11:05:54 -05:00
Marshall Polaris
0df4ca8f1e
Make type definitions for Txn more precise (#551)
* Make type definitions for Txn more precise

* Changes in response to feedback
2022-06-22 01:13:25 -07:00
Sinclair Chen
7e999881c5
Check toUser balance sufficient in negative txns (#555) 2022-06-21 11:52:02 -05:00
mantikoros
d4f2a81735 exclude certain categories for new users 2022-06-21 10:01:51 -05:00
Marshall Polaris
1075fec53f
Clean up unclean user names (#543)
* Clean the user's display name on update.

The user's display name should always be clean (see for example
functions/src/create-user.ts). However, change-user-info.ts does not
enforce this, thus potentially allowing a malicious user to change their
name to something that doesn't satisfy the rules for clean display
names.

Note: this cannot happen currently because all callers (in profile.tsx)
clean the name. However, doing it here is good defense in depth
(similar to how the userName is cleaned).

* Update display name max length to 30

* Add a script to hunt down too-long display names

* Make util.isProd a function

* Don't access admin.firestore() on top level of utils.ts

Co-authored-by: Jonas Wagner <ltlygwayh@gmail.com>
2022-06-18 14:31:39 -07:00
Sinclair Chen
833dd37469
Comment tips (attempt 2) (#539)
* Add tip arrows UI (visual)

* move tipper into its own component

* simplify score calculation

* Add tip txns

- more specific txn types
- fix transact cloud function to be able to create tip txns
- insert tips into comments via a context

* Refactor tipper to send tip txns

* Stop tipping yourself. Disable anons.

* Style tipper (smaller)

* remove default exports

* capitalize tooltips

* rename stuff

* add exhausting hook dependencies

* replace context with prop threading

* fix eslint unused vars

* fix: thread tips correctly into fr comments
2022-06-17 22:28:16 -05:00
James Grugett
83ded17625 Revert "Comment tips (#469)"
This reverts commit e567782a7d.
2022-06-17 16:31:21 -05:00
Sinclair Chen
e567782a7d
Comment tips (#469)
* Add tip arrows UI (visual)

* move tipper into its own component

* simplify score calculation

* Add tip txns

- more specific txn types
- fix transact cloud function to be able to create tip txns
- insert tips into comments via a context

* Refactor tipper to send tip txns

* Stop tipping yourself. Disable anons.

* Style tipper (smaller)

* remove default exports

* capitalize tooltips

* rename stuff

* add exhausting hook dependencies

* replace context with prop threading

* fix eslint unused vars
2022-06-17 14:19:42 -07:00
Marshall Polaris
61a2bcb609
Don't unnecessarily query contract in onCreateBet (#528) 2022-06-17 00:15:37 -07:00
Marshall Polaris
0820cc8f4d
Clean some API stuff up and instrument placeBet with a bunch of logging (#521)
* Hoist some variables out of functions

* Use built in CORS processing machinery

* Instrument `placebet` with a bunch of logging
2022-06-16 20:57:03 -07:00
Marshall Polaris
5d6bdff988
Kill updateRecommendations job (#525) 2022-06-16 17:38:32 -05:00
mantikoros
c2945f11b7 track create user 2022-06-16 10:45:44 -05:00
mantikoros
fb10e9cddc server side tracking; track M$ purchases 2022-06-15 21:29:53 -05:00
James Grugett
e4f1d7cae1 Change eslint unused var to 'warn' instead of 'error' 2022-06-15 14:48:12 -05:00
mantikoros
c3b15ac5dc prevent total liquidity stat from going negative 2022-06-15 11:33:58 -05:00
James Grugett
cc4b9abd9f Revert "Automated market resolution (#404)"
This reverts commit a3663d03e8.
2022-06-14 23:31:20 -05:00
James Grugett
26921451a8 Revert "Fix auto resolve markets query"
This reverts commit b405bd453a.
2022-06-14 23:30:58 -05:00
James Grugett
b405bd453a Fix auto resolve markets query 2022-06-14 23:16:02 -05:00
Marshall Polaris
4f96b9ef63
Finish optimizing updateFooMetrics functions (#489)
* Consolidate metrics updates into one batch job

* Try batching updates of metrics

* Don't look up all bets again for all contracts

* Tidying up

* Make computeTotalPool less needlessly inefficient looking
2022-06-14 17:38:38 -07:00
TrueMilli
a3663d03e8
Automated market resolution (#404)
* Added radio buttons to market creation (non functional)

* Ignoring vs code files

Should this be done in the repo or should everyone using VS Code do that himself globally on his machine(s)?

* Removed 'automatic' resolution

* added union type for resolution

* revert: resolution could be anything here (non binary markets)

* Expanded ChoicesToggleGroup for string choices

* Added combined resolution and required buttons to market creation

* restricted automatic resolution to binary markets

* added automatic resolution to contract

* added automatic resolution to contract overview

* string or number array to mixed array

* created const for resolutions

* Added comments for leading semicolons

* configuration of auto resolution on market creation

* v1.22.19

* v1.0.0

* v0.0.0

* v1.0.0

* v1.22.19

* Mock display automatic resolution

* Revert changes to market creation

* Revert "v1.22.19"

This reverts commit 22f59adc9c.

* Removed resolutiontype from contract creation

* Added auto resolution time to contract

* Auto resolution date editable

* refactoring

* Editable interface for auto resolution

* New edit interface for auto resolution

* Setting of auto resolve date when changing close date

* prohibited changing other peoples markets

* removed unnecessary export

* refactoring

(cherry picked from commit 4de86d5b08)

* Added comments for leading semicolons

(cherry picked from commit 60739c7853)

* Ignoring vs code files

Should this be done in the repo or should everyone using VS Code do that himself globally on his machine(s)?

(cherry picked from commit 944de9398a)

* removed unused imports and variables

* added type for binary resolution

* Prettier

* const for binary resolutions

* using the type "resolution"

* Prettier

* Re-added comment

* Update functions/src/create-contract.ts

* Revert "Ignoring vs code files"

This reverts commit 09aea5c207.

* launch config for debugging with vs code WIP

* "Launch Chrome" does not work since login via google is not possible in debugger-chrome
* Breakpoints are unbound when attached to chrome

* Revert "Added comments for leading semicolons"

* prettier

* linebreak crlf

* vscode settings

* correct linebreaks
* search exclusion
* automatic prettifier

* vscode settings

* correct linebreaks
* search exclusion
* automatic prettifier

* Working debugger config

* fix merge

* Removed comments, default resolution MKT

* removed vscode from gitignore

* refactoring description update

* Added auto resolution to LiteMarket

* fix date, setDate mutates object

* fixed firestore.rules

* script to add auto resolution to all markets

* regularely auto resolve markets

* fix description error

* moved calculate ts for access in firebase

* Revert "moved calculate ts for access in firebase"

This reverts commit 8380bf4f72.

* fix reference to calculate for firebase

* fixed references to time

* renamed function

* added description

* added auto resolution to description

* direct bool check instead of != null

* direct bool check instead of != undefined

* remove explicit type

* Fix free response markets

* removed contract from functionname

* interval set to 1h

* query instead of filter

* folds ~> contracts

* query instead of filter

* promise.all instead of foreach

* removed contractDoc from function header

* removed autoResolution from function header

* batchedWaitAll instead of promise.all

* removed unused parameter

* replaced auto resolution with constant

* suggestions from PR

* fix comment

* removed unused imports

* added scripts to add close dates on prod

* optimization

* removed test script

* security: only auto resolve markets which are closed

* consistency checks

* re-added type check for binary markets
* moved check of probability into switch case block

* removed unused import

* auto resolution every minute

* auto resolution time optional

* pr fixes
2022-06-14 15:01:32 -05:00
mantikoros
c4e3376313 check if shares below min pool qty for sales 2022-06-13 21:14:52 -05:00
Marshall Polaris
8fce8d5f23
Improve visibility of updateFooMetrics functions behavior (#485)
* Make updateFooMetrics functions manually testable

* Add logging, test script to metrics update functions

* Improve on `batchedWaitAll` for update functions
2022-06-12 16:22:29 -07:00
Marshall Polaris
6ac129a0b8
Validate that user can pay for market (#487) 2022-06-12 14:23:23 -07:00
Marshall Polaris
1ab17bbbf0 Bump metrics updater functions to 1GB memory 2022-06-10 22:25:54 -07:00
Marshall Polaris
00d7e622df
Query bets all at once in updateUserMetrics (#477) 2022-06-10 21:00:19 -07:00
Marshall Polaris
d8dc91d4b7
Optimize updateContractMetrics (#476)
* Don't query bets repeatedly

* Don't read entire database of contracts for no reason

* Fix lint
2022-06-10 21:00:09 -07:00
Marshall Polaris
3a6960c71b
Simply do not update the feed (#474) 2022-06-10 20:55:51 -07:00
Marshall Polaris
6956f0d730
Implement really obvious optimizations on placebet, sellbet, sellshares (#452)
* Change authed endpoints to not look up users unnecessarily

* Parallelize some extremely parallelizable DB requests

* Clean up overcomplicated sellshares logic
2022-06-10 17:51:55 -07:00
Ian Philips
789bbced5f Ignore manifold as lp for now 2022-06-10 17:23:17 -06:00
Ian Philips
89784bf5eb
Notifications for liquidity proiders/provisions (#478)
* Notifications for liquidity proiders/provisions

* typo

* Rename

* Return default text

* Marke needs resolution notifications

* remove todo
2022-06-10 16:48:28 -06:00
mantikoros
c59d93979c
Fix overflow (#472)
* fix pool overflow bug by enforcing minimum share quantity in pool

* CPMM_MIN_POOL_QTY = 0.01

* use newPool
2022-06-09 20:25:05 -05:00
Marshall Polaris
6fac56d2c9
Make feed updating do much less work (#455) 2022-06-09 15:13:06 -07:00
mantikoros
3858f8fbea withdraw liquidity: redeem surplus shares, adjust total depostits, adjust amount for current prob, set isLiquidityProvision for surplus bets, error handling 2022-06-09 12:47:02 -05:00
Ian Philips
8634af702a
Save resolved values in notifs (#470)
* Save resolved values in notifs

* Clean up
2022-06-09 10:30:26 -06:00
Ian Philips
65a879d5ab Save resolution with notif 2022-06-09 07:31:53 -06:00
SirSaltyy
ad820913f7
Update welcome.html (#465) 2022-06-08 21:28:29 +01:00
mantikoros
902bdc96b2 thank you email template 2022-06-08 14:56:55 -05:00
mantikoros
0cd9943e0d
Liquidity withdrawal (#457)
* withdrawLiquidity cloud function

* update rules

* exclude antes from getCpmmLiquidityPoolWeights

* update correct lp shares

* liquidity panel

* don't create bet if less than 1 surplus share

* withdrawLiquidity return type

* static analysis fix

* hook dependency

* prettier

* renaming

* typo

* getCpmmLiquidityPoolWeights: always exclude antes

* delete unused function

* casting
2022-06-08 13:00:49 -05:00
Ian Philips
936cabe353
Speed up notification loading by prepopulating relevant info (#453)
* Populate notification with relevant info

* eslint

* Remove duplicated code

* Unused ?

* Add new q notification, other small fixes
2022-06-08 08:43:24 -06:00
James Grugett
879ab272e0
Following and follower list (#456)
* Create following button that opens follow list in modal.

* Move react query deps to web package.json

* UseFollowers hook

* Following and followers button, dialog with tabs.

* Fix line endings

* Remove carriage return from default vscode eol

* Add placeholder message if no users followed / no followers

* Tweak spacing
2022-06-07 22:24:18 -05:00
Marshall Polaris
244bbc51b2
Migrate sellBet cloud function to v2 sellbet (#438)
* Migrate sellBet to v2

* Kill sellBet warmup requests

* Point client at new v2 sellbet function

* Clean up `getSellBetInfo`

* Fix up functions index.ts
2022-06-07 14:08:56 -07:00