Commit Graph

306 Commits

Author SHA1 Message Date
Austin Chen
3fc159f10b Revert "Convert common imports in functions to be absolute"
This reverts commit c03518e906.
2022-05-09 12:06:16 -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
Marshall Polaris
899c6ab0e0
Add script to denormalize avatars into other docs (#127)
* Add script to denormalize avatars into contracts/comments

* Also handle denormalizing answer avatar URLs

* Small fixups
2022-05-04 11:07:00 -07:00
mantikoros
5c18820d96 go back to $100 fixed ante 2022-05-04 11:11:06 -04:00
mantikoros
a982b86cfe $300 ante for free daily markets 2022-05-03 12:18:37 -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
cc300c84e1 Adjust totalDeposits on charity donation 2022-04-30 08:52:24 -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
mantikoros
5cb6ee3bca daily free markets' liquidity provided by @ManifoldMarkets 2022-04-29 15:58:01 -04:00
mantikoros
be7e4a5c03 Manifold CLA: readme message, move to top level 2022-04-29 13:39:52 -04:00
mantikoros
c59e444d0a Manifold CLA 2022-04-29 13:30:27 -04:00
Ian Philips
ca8420d61b Allow free daily market with M-zsh 2022-04-29 07:38:46 -06: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
Ian Philips
625308c19d Readme: must be in dev for emulators to work 2022-04-28 12:29:02 -06:00
mantikoros
45aa6646fa sendNewCommentEmail: forgot abs value 2022-04-27 23:34:50 -04:00
mantikoros
d9ee03a96f sendNewCommentEmail: handle sold shares for cfmm 2022-04-27 22:24:32 -04: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
Boa
1e2f9fc099
Support local firestore emulation (#91)
* Support local firestore emulation

* Update readme

* Update readme
2022-04-25 09:46:35 -06:00
Marshall Polaris
8ac95b363d
Remove workspace-specific lockfiles (#95) 2022-04-24 16:36:42 -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
James Grugett
d8a24e1abd Rename script environment variable to GOOGLE_APPLICATION_CREDENTIALS_DEV (and _PROD) 2022-04-20 00:47:13 -05:00
Marshall Polaris
5dbe16ec8d
Change how Firebase scripts auth (#87)
Now the admin key path is loaded from enviroment variables instead
of being hardcoded in script-init.ts.
2022-04-19 23:31:46 -05:00
Marshall Polaris
0f3b0f242d
Fix bugs in Firebase README (#83) 2022-04-19 21:41:43 -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
75b39cbf6f Remove loans: no new loans 2022-04-13 12:52:12 -05:00
mantikoros
2fe71731e4 create: fixed ante of $100 2022-04-09 13:51:22 -05:00
James Grugett
b965926fc8 Script to download database json data 2022-03-31 23:04:58 -05:00
James Grugett
ce76a9754b Fix sell to pay back loans 2022-03-31 00:54:42 -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
James Grugett
69e142e279 Make volume a non-optional field of contract 2022-03-23 00:09:47 -05:00
James Grugett
6b61d7209d Compute volume for contracts. Show volume instead of liquidity for cpmm. 2022-03-22 23:49:15 -05:00
mantikoros
224a8214b4 resolve market email: display "N/A" instead of "#CANCEL" for FR markets 2022-03-18 21:12:00 -05:00
James Grugett
50c4866958 Probable fix to NaN invested in email 2022-03-16 23:56:59 -05:00
mantikoros
3f0002f9e8 check if NaN when updating user balances 2022-03-15 22:05:08 -05:00
James Grugett
77b2c9893d Use generic payout function for leaderboard profit calculation. Exclude redemptions in volume calculation 2022-03-15 17:47:05 -05: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
7aa074a31a Script for paying out contract again 2022-03-09 17:02:57 -06:00
James Grugett
f9b881a017 Send better error responses for unsubscribe. 2022-03-09 12:39:21 -06:00
James Grugett
d12189ae08 Fix unsubscribe from market resolution emails 2022-03-09 12:27:12 -06:00
James Grugett
79bd299b68 Enforce max question length, description length, and tag length. 2022-03-09 11:08:57 -06:00
Austin Chen
4b2fd0bdc7 Back up Fold followers & FR answers 2022-03-08 20:45:28 -08: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
James Grugett
fe98a61e43 Fix leaderboard out of memory error with batchedWaitAll instead of Promise.all 2022-03-07 13:45:56 -08:00
James Grugett
abd9be921f Allow paying users negative amounts on market resolve. 2022-03-06 01:03:06 -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
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
James Grugett
473534bc35 Catch user update 2022-02-01 21:35:41 -06:00
James Grugett
ca29a43da9 Calculate global leaderboard from contract bets 2022-02-01 21:30:43 -06:00
James Grugett
0eac8d9c5c
Yarn workspaces (#42)
* Try yarn workspaces

* Add versions to sub package.json files
2022-02-01 15:25:51 -06:00
James Grugett
7c50b55331 Match lowercase tags for folds 2022-02-01 12:29:14 -06:00
mantikoros
f06ca8305c
Resolve prob (#41)
* rename MKT to PROB; show resolved probability; move format utilities to common

* ProbabilitySelector

* resolve to PROB

* prob and mkt labels
2022-01-30 15:51:30 -06:00
James Grugett
83f4fd3555 Scripts: Init admin 2022-01-30 15:11:01 -06:00
jahooma
6696ac2a15 Make about optional for folds 2022-01-27 12:57:36 -06:00
jahooma
9764a03189 Add create market to top of fold activity. Auto-adds the primary tag of the fold. 2022-01-27 12:45:35 -06:00
jahooma
2e7a8210bb No symbols in fold primary tag. Limit Name to 140 chars 2022-01-26 17:45:07 -06:00
jahooma
348c8d565a Fold delete 2022-01-26 14:56:15 -06:00
jahooma
ef8157025f Compute fold follower count from cloud function. 2022-01-26 14:27:16 -06:00
jahooma
c3f49c44a0 Cardify folds in fold list 2022-01-26 12:44:16 -06:00
Austin Chen
29b946671b Expand backup documentation 2022-01-25 15:27:44 -06:00
Austin Chen
a52b2992af Back up comments and bets subcollections too 2022-01-25 15:13:11 -06:00
James Grugett
8b9d0e5dba
New fold page UI with tabs (#37)
* Tabbed fold page

* Implement market, leaderboard tab views for fold. And edit dialog

* Add about field to Fold
2022-01-25 14:47:25 -06:00
jahooma
705d5cada7 Add lowercaseTags field to contracts. ante / closeTime non-optional in new contract code 2022-01-24 16:33:10 -06:00
Austin Chen
7534847e8d Back up Firestore tables to cloud bucket 2022-01-24 13:26:19 -06:00
jahooma
aa1022546d Implement leaderboards for folds! 2022-01-22 17:59:50 -06:00
James Grugett
60f68b178d
Folds (#34)
* Fold type, fold page, query for fold contracts

* Tsconfig: target esnext, nounused locals: false

* Store tags in field on contract. Script to update contract tags

* Show tags on fold page

* Load all fold comments server-side to serve better feed

* Fix the annoying firebase already initialized error!

* Add links to /edit and /leaderboards for fold

* Page with list of folds

* UI for creating a fold

* Create a fold

* Edit fold page
2022-01-21 17:21:46 -06:00
jahooma
5ce23c0bdb Add userId to email template so users can unsubscribe 2022-01-19 12:43:12 -06:00
mantikoros
4528615863
Private user (#32)
* PrivateUser

* createUser: create private user; detect multiple signups

* include user properties in private user

* script: create private users

* unsubscribing from market resolution emails

* track total deposits
2022-01-18 21:36:46 -06:00
mantikoros
908c8c03e6
Create user cloud function (#31)
* createUser cloud function; change User object

* initial commit

* listenForLogin: avoid race condition

* createUser: allow capital letters in username

* remove debugging

* leaderboard: empty url for undefined avatar image
2022-01-18 01:18:38 -06:00
jahooma
56c7e2597d Schedule cloud function to update user metrics: totalPnL, creatorVolume 2022-01-17 15:39:34 -06:00
mantikoros
8331e7afc5 migration script now re-simulates individual markets specified in command line 2022-01-16 15:53:40 -06:00
Austin Chen
6e92e3fba1 DX: Cloud Functions tooling 2022-01-16 01:59:05 -05:00
jahooma
f6079e68d0 Choose random hot contracts from top 16 every 5 minutes. 2022-01-15 00:44:33 -06:00
mantikoros
3fa2926559 create page design; require minimum ante; lower phantom ante amount; createContract checks 2022-01-14 17:39:17 -06:00
mantikoros
58fbc40276 migration script 2022-01-13 12:49:47 -06:00
mantikoros
a8896375c7 migration script 2022-01-12 23:43:41 -06:00
jahooma
de043de589 Add visibility field to contracts. Hot contracts & activity feed show only visibility 'public'. 2022-01-12 19:53:50 -06:00
mantikoros
23e7c8aaf3
script to port to new dpm (#27)
* initial commit

* antes

* rename path, compute to contractPath, contractMetrics

* merge

* Include antes as bets; more calculations

* fees on estimated winnings

* mkt payout calculation

* contract: remove startPool, add phantomShares

* Merge branch 'main' into new-dpm

* dpm migration script

* my service account

* script to correct afterProb of last bet
2022-01-12 15:21:03 -06:00
mantikoros
9d5490cf9a
Switch to new dpm mechanism (#26)
* initial commit

* antes

* rename path, compute to contractPath, contractMetrics

* merge

* Include antes as bets; more calculations

* fees on estimated winnings

* mkt payout calculation

* contract: remove startPool, add phantomShares

* Merge branch 'main' into new-dpm

* dpm migration script

* my service account
2022-01-12 13:01:04 -06:00
mantikoros
f10f7bbaea market data cloud function 2022-01-11 13:30:18 -06:00
mantikoros
0fef0eeccb functions: change entry point after adding common directory 2022-01-11 13:30:00 -06:00
mantikoros
df4ecb3fe2 move prettier config to top level 2022-01-10 17:44:42 -06:00
mantikoros
a1aeabeab4 move market logic to common 2022-01-10 16:49:13 -06:00
mantikoros
8266fb995c safer payUser 2022-01-10 16:49:13 -06:00
jahooma
c5ab1ba2e0 HTML resolved market email 2022-01-10 16:08:38 -06:00
mantikoros
b97a65cf2c refactor data structures, calculations to common directory 2022-01-10 15:07:57 -06:00
jahooma
829c8a4b75 Disallow selling after close time! Enforce no trading after close on server. 2022-01-10 10:33:02 -06:00
jahooma
6b4417d8b8 Every 15 minutes, compute contract volume in last 24 hours and 7 days 2022-01-09 13:34:42 -06:00
jahooma
1013192281 Show the floor of your balance 2022-01-08 12:14:20 -06:00
mantikoros
abb5d53431 ensure bet amounts are positive 2022-01-08 11:51:42 -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
jahooma
6d86a5eb49 Merge branch 'manifold' 2022-01-06 18:44:49 -06:00
jahooma
4390ee4314 Send transactional email from manifold.markets 2022-01-06 18:33:19 -06:00
jahooma
bcd86ddce9 Rename user contracts 2022-01-06 18:05:48 -06:00
Austin Chen
928b34784c Merge branch 'main' of https://github.com/manticmarkets/mantic 2022-01-06 10:55:51 -08:00
Austin Chen
a333d8334e Return the new bet ID 2022-01-06 10:55:31 -08:00
James Grugett
85b5ee5cbc
Rename to Manifold Markets! (#19)
* Update logo and about page to manifold

* Change urls, titles / metatags, landing page
2022-01-06 12:48:30 -06:00
jahooma
b928d0e70c Change urls, titles / metatags, landing page 2022-01-06 12:40:27 -06:00
mantikoros
8594700fb4 turn off keepAwake 2022-01-05 12:30:19 -06:00
mantikoros
0b8ad76b0f global warming: warm up all cloud functions on client 2022-01-05 12:30:16 -06:00
mantikoros
7c875f80da subsidized markets; create contract cloud function 2022-01-04 23:51:34 -06:00
mantikoros
907acec601
Mkt resolution 2: Enable MKT resolution (#16)
* new standard resolution; contract.totalBets; MKT resolution

* recalculate script

* enable resolve MKT

* different approach to resolve MKT

* comment out init

* Count payouts for bets with exluded sales

Co-authored-by: jahooma <jahooma@gmail.com>
2022-01-02 00:27:58 -06:00
jahooma
b74a0c02c5 Remove a new line in email 2022-01-01 19:20:25 -06:00
jahooma
0950a281f2 Fix build error from merge. Extract resolution emails to function 2022-01-01 19:13:30 -06: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
jahooma
afc6f28a49 Send email on market resolution with your payout 2022-01-01 18:08:52 -06:00
mantikoros
b06d41e31a resolve market cancel uses only pool to pay out 2021-12-29 00:49:10 -05:00
mantikoros
b2945c24b1 turn keep awake on 2021-12-24 16:14:02 -05: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
jahooma
58521b6503 Switch to yarn 2021-12-19 16:08:25 -06:00
mantikoros
f93d10f850 run keep awake every 30 seconds 2021-12-18 14:29:27 -06:00
mantikoros
86c2ff4605 keep awake cloud functions 2021-12-17 20:13:20 -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
mantikoros
15b11d30a3 placeBets: handle old contracts 2021-12-15 17:29:16 -06:00
mantikoros
e281233924 contract now has dpmWeights 2021-12-15 16:44:22 -06:00
mantikoros
e662d10cfb resolve markets: remove seed bets from pot 2021-12-14 12:54:26 -06:00
mantikoros
f2748db21d resolve markets 2021-12-14 01:02:54 -06:00
jahooma
43941cd212 Simple market resolved panel 2021-12-14 00:12:25 -06:00
mantikoros
53907d2d52 user.balanceUsd => user.balance 2021-12-13 11:58:47 -06:00
jahooma
e34f1dbcc9 Calculate probBefore, probAfter, and probAverage on placeBet cloud function 2021-12-12 15:32:06 -06:00
mantikoros
62ea1bab15 placeBet: always run 1 instance 2021-12-10 21:45:05 -06:00
mantikoros
d95bef8ab3 placeBet 2021-12-10 18:06:17 -06:00
mantikoros
083e5c506b initial commit 2021-12-10 12:10:30 -06:00