Commit Graph

23 Commits

Author SHA1 Message Date
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
581a42f288
Migrate stripeWebhook and createCheckoutSession to v2 (#636) 2022-07-09 13:43:18 -07:00
mantikoros
c45da8c334
Tracking (#511)
* tracking helper functions

* track everything

* remove extraneous code
2022-06-15 16:34:34 -05:00
mantikoros
38c63fb3ee
Amplitude (#505)
* basic amplitude setup

* delete heap

* track referrers

* basic tracking

* delete unused import

* prettier
2022-06-14 22:00:36 -05:00
mantikoros
0ecff1b581
Heap analytics (#500)
* add heap

* remove hotjar

* prettier formatting conflicting with es lint

* stop weird prettier/eslint conflict
2022-06-14 11:54:58 -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
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
jahooma
44fa4f263b Encode referrer url param for stripe checkout 2022-01-07 18:51:16 -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
mantikoros
7c875f80da subsidized markets; create contract cloud function 2022-01-04 23:51:34 -06:00
Austin Chen
fb0e16d619
Add a closing date to Create Market (#10)
* Preview a slimmed-down version of /Create

* Rework dropdown to be on bottom

* Parse the close time as just before midnight

* Prevent invalid contracts from being created

* Prevent trading after contract has closed
2022-01-02 21:21:25 -08:00
mantikoros
5890b74225
Mkt resolution: new standard resolution (pay back bets first) (#15)
* new standard resolution; contract.totalBets; MKT resolution

* recalculate script

* Fix one bug and change script name

Co-authored-by: jahooma <jahooma@gmail.com>
2022-01-01 19:03:18 -06:00
mantikoros
f48ae0170b
Sell bets (#12)
* sell bet

* dev mode

* single-pot no-refund payoff; bet selling

* Increase default fetch size 25 -> 99

* Fix about page numbering

* Don't flash no markets when loading on tag page.

* Change Title to use body font

* Make a bunch of predictions at once (#9)

* Set up a page to make bulk predictions

* Integrate preview into the same card

* List created predictions

* Make changes per James's comments

* Increase the starting balance (#11)

* Remove references to paying for our Mantic Dollars

* Update simulator to use new calculations

* Change simulator random to be evenly random again

* Sell bet UI

* Migrate contracts and bets script

* Add comment to script

* bets => trades; exclude sold bets

* change sale formula

* Change current value to uncapped sell value.

* Disable sell button while selling

* Update some 'bet' to 'trade'

Co-authored-by: Austin Chen <akrolsmir@gmail.com>
Co-authored-by: jahooma <jahooma@gmail.com>
2021-12-24 15:06:01 -06:00
Austin Chen
77e15e3aa8 Denormalize username to each contract 2021-12-17 23:27:29 -08:00
mantikoros
b5761baeaf raise start pool capital to M$200 2021-12-17 17:40:32 -06:00
mantikoros
03a3df261c contract slugs 2021-12-17 17:16:42 -06:00
mantikoros
756f31b1b7 rename contract properties 2021-12-17 16:15:09 -06:00
jahooma
e8f94f48e2 Update bet UI with market summary and computed columns 2021-12-15 16:58:38 -06:00
mantikoros
e281233924 contract now has dpmWeights 2021-12-15 16:44:22 -06:00
mantikoros
4b123d47ee change starting balance to 100 2021-12-15 16:27:57 -06:00
Austin Chen
d4bb419478 Prettier everything
(Hopefully for the last time)
2021-12-13 23:30:09 -08:00
jahooma
5c7a8e52c9 Fix type errors 2021-12-14 01:05:33 -06:00
mantikoros
5ffe266cf7 contract creation: use slug, calculate seed amounts from given probability 2021-12-13 19:07:36 -06:00