Commit Graph

267 Commits

Author SHA1 Message Date
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
jahooma
3ba96028f4 Parse tags to get unique ignoring case 2022-01-02 16:53:20 -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
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
4db7e03b92 Switch to old current value calculation 2021-12-31 17:22:15 -06:00
jahooma
96d5ea0437 Add sort by tag 2021-12-31 13:41:41 -06:00
jahooma
a5e4411075 Load all contracts, and filter to 99 client-side. 2021-12-30 13:35:29 -05:00
Austin Chen
a9e1cbc0be
Point local server to prod Firebase for now (#13) 2021-12-29 23:31:26 -08: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
James Grugett
ff4550fe51
Increase the starting balance (#11) 2021-12-21 13:52:27 -06:00
Austin Chen
9d438dc356
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
2021-12-20 22:29:32 -08:00
Austin Chen
f79d69cd69 Increase default fetch size 25 -> 99 2021-12-20 09:56:27 -08: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
Austin Chen
022caa4407 Revert to URLs without @ 2021-12-17 10:55:18 -08:00
jahooma
9bf257ef64 Embed markets below landing page. Listen for market changes 2021-12-16 22:44:48 -06:00
jahooma
2c9f8e00bf Fix nextjs console error by not loading from localstorage immedately. Use layout effect instead. 2021-12-16 22:09:38 -06:00
jahooma
96791e11a5 Stop flash of landing page when signed in and loading '/' 2021-12-16 21:37:38 -06:00
mantikoros
99637d913d add meta tags to contract 2021-12-16 12:21:16 -06:00
jahooma
8abbc34652 Improve graph for resolved bets 2021-12-16 00:44:04 -06:00
mantikoros
9bd0ad7211 test 2021-12-15 22:20:39 -06:00
jahooma
83b4cc38b3 Show just payout column for resolved markets, tweak calculation and resolved labels. 2021-12-15 20:28:40 -06:00
Austin Chen
743616449f Prefix username URLs with @ 2021-12-15 18:26:38 -08:00
Austin Chen
9df78a4963 Support user profiles on /[username]
Currently all bets are also shown
2021-12-15 17:34:36 -08:00
Austin Chen
8e119a6338 Replace /contract/[id] with /[username]/[id] 2021-12-15 16:52:19 -08:00
jahooma
f32933f668 Bet calculation / UI updates 2021-12-15 17:27:02 -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
jahooma
fda5013bf8 Simple bets list 2021-12-15 01:41:56 -06:00
jahooma
344b06124f useUser: Listen for changes to logged in user 2021-12-14 18:45:13 -06:00
jahooma
6e61b38a9b Remove resolved panel, move info into contract overview. 2021-12-14 12:51:30 -06:00
mantikoros
b85d9035b0 lower new user starting balance to M$1000 2021-12-14 11:36:23 -06:00
Austin Chen
dc90c4fa74 Extract shared logic into ContractDetails 2021-12-14 02:23:32 -08:00
Austin Chen
d4bb419478 Prettier everything
(Hopefully for the last time)
2021-12-13 23:30:09 -08:00
jahooma
1562565f9a Try to fix build maximum fraction digits out of range error 2021-12-14 01:09:46 -06:00
jahooma
5c7a8e52c9 Fix type errors 2021-12-14 01:05:33 -06:00
jahooma
43941cd212 Simple market resolved panel 2021-12-14 00:12:25 -06:00
jahooma
15691c0a38 Query for user bets. Template page to show them. 2021-12-13 23:40:38 -06:00
Austin Chen
bae969058a Add a page which lists all markets
TODO: Add in functionality
2021-12-13 17:09:58 -08:00
mantikoros
5ffe266cf7 contract creation: use slug, calculate seed amounts from given probability 2021-12-13 19:07:36 -06:00
Austin Chen
e9c183a493 Allow users to sign in from /account
SQ
2021-12-13 10:37:16 -08:00
mantikoros
53907d2d52 user.balanceUsd => user.balance 2021-12-13 11:58:47 -06:00
mantikoros
cfd2f22254 simulator: quadratic price function, random bets, change table cols 2021-12-12 17:06:46 -06:00
jahooma
b216236503 Graph bets by afterProb. 2021-12-12 16:14:52 -06:00
jahooma
29e13497bf Add volume calculation. Remove new bet button that was unnecessary. 2021-12-10 22:09:32 -06:00
jahooma
e253b3beca Make bet panel calculate bet info and display it. 2021-12-10 21:51:35 -06:00
Austin Chen
fb9a690707 Run prettier 2021-12-10 17:20:52 -08:00
mantikoros
d95bef8ab3 placeBet 2021-12-10 18:06:17 -06:00
jahooma
77ce27f45f Submit bets to firestore 2021-12-10 11:14:05 -06:00
Austin Chen
d945dc894b Merge branch 'contract-page' into create-contract 2021-12-10 00:21:55 -08:00
Austin Chen
70e86155be Sort contracts by creation time 2021-12-09 23:08:28 -08:00
jahooma
7309096854 Merge branch 'main' into contract-page 2021-12-10 00:33:11 -06:00
jahooma
443b742c4a Implement skeleton ContractPage 2021-12-10 00:21:12 -06:00
Austin Chen
4f2c8bcdce Add back listenForContract 2021-12-09 21:01:44 -08:00
Austin Chen
09b4639198 Allow users to create new contracts 2021-12-09 20:54:40 -08:00
Austin Chen
89a7bd65d2 Standardize on useUser hook 2021-12-09 16:09:16 -08:00
Austin Chen
7ec3da5504
Allow logging in with Firebase (#2)
* Pin package.json to exact version

* Fix according to reviewer feedback
2021-12-09 15:33:01 -08:00
jahooma
1cd3e2f1be Add contract page 2021-12-09 16:44:04 -06:00
jahooma
c8b86a43b9 Add template contract page 2021-12-09 16:05:55 -06:00
Austin Chen
e41250a89b Upload basic Firebase Auth code 2021-12-09 15:31:20 -06:00
Austin Chen
2a3d9e6272 Add Firestore package and config 2021-12-09 15:31:20 -06:00
Austin Chen
021341331f Upload basic Firebase Auth code 2021-12-08 16:43:42 -08:00
Austin Chen
55ddb2a7d4 Add Firestore package and config 2021-12-08 16:43:42 -08:00
Austin Chen
634c0af85b
Finish porting simulator into React (#1)
* Preview bid results; toggle bid type

* Code cleanup: move hooks to where they're used

* Extract header to separate component

* Fix & reactify according to James's review

* Remove unnecessary useMemo

* Hack Chartjs type

* Add some notes on DX Todos

* Move non-page elements to lib/
2021-12-08 08:30:29 -08:00