Commit Graph

167 Commits

Author SHA1 Message Date
James Grugett
8b9239c01b Comment out console.log 2022-04-30 12:28:25 -04:00
James Grugett
02724cba50 Update lastCommentTime script 2022-04-30 12:19:02 -04:00
James Grugett
b5db9065d2 Disable lastViewedScore factor 2022-04-30 11:55:09 -04:00
James Grugett
f008971bd1 Compute recommendation scores from updateUserFeed 2022-04-30 11:54:44 -04:00
James Grugett
43a0fc6581 Tweak feed algorithm 2022-04-30 11:34:53 -04:00
James Grugett
54221f623c Merge branch 'main' into server-feed 2022-04-30 10:15:44 -04: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
James Grugett
10e5916dc6 Merge branch 'main' into server-feed 2022-04-29 17:19:51 -04:00
James Grugett
542ec218f9 Update feed script 2022-04-29 16:53:49 -04:00
mantikoros
5cb6ee3bca daily free markets' liquidity provided by @ManifoldMarkets 2022-04-29 15:58:01 -04:00
James Grugett
72768d6d0a Delete view cache script 2022-04-29 15:43:18 -04:00
James Grugett
4b3bc71cbb Update user feed each hour and get feed from cache doc. 2022-04-29 15:25:38 -04:00
James Grugett
cd5689a72f Cache view script runs on all users 2022-04-29 15:17:40 -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
James Grugett
7e8ac0fc8f Batched wait all userRecommendations 2022-04-29 10:32:06 -04:00
James Grugett
16ae447823 Script to cache viewCounts and lastViewTime 2022-04-29 10:31:39 -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
James Grugett
db42761143 Implement getFeed cloud function 2022-04-28 13:27:36 -04:00
James Grugett
f357b6e92e Update contract's lastBetTime and lastCommentTime on new bets and comments. 2022-04-28 00:45:36 -04: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
James Grugett
57fb9baed6 Schedule updating user recommendations. Compute using tf-idf. 2022-04-27 21:27:31 -04:00
James Grugett
d639e73284 Store view counts & last viewed time 2022-04-27 17:26:33 -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