Commit Graph

127 Commits

Author SHA1 Message Date
mantikoros
3145966a3c share redemption 2022-03-09 11:35:21 -06:00
mantikoros
d1b510c720 Merge branch 'main' into cpmm 2022-03-08 11:45:30 -06:00
mantikoros
82c5eb85d3 updateUserBalance: allow negative balances 2022-03-08 11:34:08 -06:00
mantikoros
4a0db10b20 use all bets for getFixedCancelPayouts 2022-03-08 11:32:03 -06:00
James Grugett
fe98a61e43 Fix leaderboard out of memory error with batchedWaitAll instead of Promise.all 2022-03-07 13:45:56 -08:00
mantikoros
dd9f4ba81c create liquidity provision even if no ante bet 2022-03-07 12:02:00 -06:00
mantikoros
14ee9735c7 Merge branch 'main' into cpmm 2022-03-07 11:30:26 -06:00
mantikoros
845aefa6a8 liquidity provision tracking 2022-03-07 11:29:58 -06:00
James Grugett
abd9be921f Allow paying users negative amounts on market resolve. 2022-03-06 01:03:06 -08:00
mantikoros
9c5478d3d5 separate logic to payouts-dpm, payouts-fixed 2022-03-04 18:31:04 -05:00
mantikoros
f40a65cc88 new bet: use calculateCpmmPurchase 2022-03-03 11:56:21 -05:00
mantikoros
9b10be065e use correct contract type in scripts / functions 2022-03-03 11:03:20 -05:00
mantikoros
6852314feb delete markets cloud function 2022-03-03 11:02:59 -05:00
mantikoros
42577b20a9 rename dpm calculations 2022-03-02 22:30:07 -05:00
mantikoros
e80926d201 rename 'calculate.ts' => 'calculate-dpm.ts' 2022-03-02 22:20:35 -05:00
James Grugett
fa817c34a9 Fix more places where insufficient balance error was not accounting for loans 2022-03-02 14:28:23 -08:00
mantikoros
a9ccca6458 Merge branch 'main' into cpmm 2022-03-02 16:22:16 -05:00
mantikoros
f830119023 cpmm initial commit: common logic, cloud functions 2022-03-02 16:12:27 -05:00
James Grugett
9e9535ce56 Subtract loans from leaderboard calculations 2022-03-01 21:23:37 -08:00
James Grugett
985cdd2537
🏦 Per-market loans! (#57)
* Loan backend: Add loanAmount field to Bet, manage loans up to max loan amount per market -- buy, sell, and resolve.

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

* Resolve emails include full payout not subtracting loan

* Exclude sold bets from current loan amount

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

* Floor remaining balance

* Fix layout of create answer bet info

* Clean up Sell popup UI

* Fix bug where listen query was not updating data.

* Reword loan copy

* Adjust bet panel width

* Fix loan calc on front end

* Add comment for includeMetadataChanges.

Co-authored-by: Austin Chen <akrolsmir@gmail.com>
2022-03-01 21:31:48 -06:00
James Grugett
41b5dd2e38 Don't send answer emails if the submitter is also the market creator 2022-03-01 17:25:19 -08:00
James Grugett
a9b887a4f4 Update resolve market to set closeTime to the earlier of closeTime and resolutionTime. 2022-02-28 16:19:47 -08:00
Austin Chen
8987a02975
Reapply Manifold for Teams config changes (#54)
* Reapply Manifold for Teams config changes

* Add Firebase config for TheoremOne

* Fix build

* Check in Firebase indexes

* Whitelist admins and new users by email

* Fix typo 🤦‍♂️
2022-02-26 23:29:33 -08:00
Austin Chen
492f777d0b Revert "Manifold for Teams: Support different Firestore dbs (#53)"
This reverts commit ebed7c15c0.
2022-02-26 22:19:16 -08:00
Austin Chen
ebed7c15c0
Manifold for Teams: Support different Firestore dbs (#53)
* Add Firebase config for TheoremOne

* Fix build

* Check in Firebase indexes

* Whitelist admins and new users by email
2022-02-26 22:08:50 -08:00
James Grugett
6f9ee3b79e Script to remove isAnte from first bets answers 2022-02-26 10:48:04 -06:00
James Grugett
db541cb63b Show investment in market resolve email 2022-02-24 01:04:24 -06:00
James Grugett
64223e5ff1 Show answer in email for comment on free response markets 2022-02-24 00:36:27 -06:00
James Grugett
dcd3bc759a Add bet amount and outcome to new comment email 2022-02-23 18:52:22 -06:00
James Grugett
cb7c8ba7c2 Send email to market creator on new answer 2022-02-23 00:05:04 -06:00
James Grugett
cc375256a1 Linkify question in emails for market resolution and market close 2022-02-22 22:07:23 -06:00
James Grugett
d3ffc7d786 Fix non-circular avatar in comment email 2022-02-22 22:05:54 -06:00
James Grugett
571a319c10 Commit html email templates 2022-02-22 20:35:07 -06:00
James Grugett
7522b6af3c Send emails for new comments on markets you commented on or created. 2022-02-22 20:35:07 -06:00
mantikoros
39cc2026f1 welcome email formatting 2022-02-22 16:35:53 -06:00
James Grugett
f5ab60b2df You can sell your ante on a new answer. Minimum is M$ 1 instead of M$ 10 2022-02-20 17:02:00 -06:00
James Grugett
fd846254a0 Implement resolving to multiple answers, weighted by probability 2022-02-20 01:26:33 -06:00
James Grugett
693652935d Switch to pool size instead of volume for creator leaderboard. 2022-02-19 12:14:45 -06:00
James Grugett
26bbb75ccd Change to sequential user metrics update instead of doing them all in parallel 2022-02-18 19:10:02 -06:00
James Grugett
b2501d8145
Free response (#47)
* Answer datatype and MULTI outcome type for Contract

* Create free answer contract

* Automatically sort Tailwind classes with Prettier (#45)

* Add Prettier Tailwind plugin

* Autoformat Tailwind classes with Prettier

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

* logo with white inside, transparent bg

* Create answer

* Some UI for showing answers

* Answer bet panel

* Convert rest of calcuate file to generic multi contracts

* Working betting with ante'd NONE answer

* Numbered answers. Layout & calculation tweaks

* Can bet. More layout tweaks!

* Resolve answer UI

* Resolve multi market

* Resolved market UI

* Fix feed and cards for multi contracts

* Sell bets. Various fixes

* Tweaks for trades page

* Always dev mode

* Create answer bet has isAnte: true

* Fix  card showing 0% for multi contracts

* Fix grouped bets feed for multi outcomes

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

* Tweaks to no answers yet, resolve button layout

* Show ante bets on new answers in the feed

* Update placeholder text for description

* Consolidate firestore rules for subcollections

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

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

* Don't show resolve options after answer chosen

* Fix type error in script

* Remove NONE resolution option

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

* Show bet probability change and payout when creating answer

* User info change: also change answers

* Append answers to contract field 'answers'

* sort trades by resolved

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

* Stop flooring inputs into formatMoney

* Revert "Stop flooring inputs into formatMoney"

This reverts commit 2f7ab18429.

* Consistently floor user.balance

* Expand create panel on focus

From Richard Hanania's feedback

* welcome email: include link to manifold

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

* Close emails (#50)

* script init for stephen dev

* market close emails

* order of operations

* template email

* sendMarketCloseEmail: handle unsubscribe

* remove debugging

* marketCloseEmails: every hour

* sendMarketCloseEmails: check undefined

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

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

* Set up read API using Vercel serverless functions

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

* Include tags in API

* Tweaks. Remove filter for only binary contract

* Fix bet probability change for NO bets

* Put back isProd calculation

Co-authored-by: Austin Chen <akrolsmir@gmail.com>
Co-authored-by: mantikoros <sgrugett@gmail.com>
Co-authored-by: mantikoros <95266179+mantikoros@users.noreply.github.com>
2022-02-17 17:00:19 -06:00
mantikoros
6701bfca0d marketCloseEmails: "every hour" => "every 1 hours" 2022-02-17 12:50:47 -06:00
mantikoros
1036c2df0d sendMarketCloseEmails: check undefined 2022-02-17 12:34:57 -06:00
mantikoros
dcbdc66df5
Close emails (#50)
* script init for stephen dev

* market close emails

* order of operations

* template email

* sendMarketCloseEmail: handle unsubscribe

* remove debugging

* marketCloseEmails: every hour
2022-02-17 12:18:02 -06:00
mantikoros
482a72f4e1 welcome email: include link to manifold 2022-02-16 22:42:52 -06:00
mantikoros
2d66be5208 resolve market: fix probability bounds 2022-02-12 00:19:45 -06:00
James Grugett
d02611a37a Add id field to markets api endpoint 2022-02-10 16:35:20 -06:00
Austin Chen
66624ff92c Send a welcome email to new users 2022-02-08 03:26:33 -08:00
mantikoros
4f0b94150c sellBet: handle case where bettor equals market creator 2022-02-06 17:18:30 -06:00
mantikoros
03f36cf954
User profile (#44)
* add id, userId to comment

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

* change user info script

* fix rules

* add fund button: useLocation hook

* profile page

* merge

* profile stuff

* avatar uploading to storage bucket

* changeUserInfo: use transaction

* Styles for profile page

* Edit mode for profile, and more styles

Co-authored-by: James Grugett <jahooma@gmail.com>
2022-02-03 21:04:56 -06:00
James Grugett
75fd870d69 Put back old leaderboard calculation. Use totalDeposits field 2022-02-02 00:21:39 -06:00