Commit Graph

1569 Commits

Author SHA1 Message Date
mantikoros
7b0be014eb show resolved n/a for numeric markets 2022-05-26 09:39:14 -05:00
Ian Philips
6f23c16df7 Show up arrow if shares in numeric markets 2022-05-26 06:23:22 -06:00
Sinclair Chen
38fa58406d Fix embeds on incognito (blocked localStorage) 2022-05-25 22:30:03 -07:00
Austin Chen
eb68d059e2 Extend analytics to 90 days 2022-05-25 19:22:50 -07:00
Marshall Polaris
b8b1c0d056
Add tsconfig, more linting to common package (#324)
* Add tsconfig.json for common

* Prefer `const` over `let` over `var`

* Kill dead code

* Fix some trivial Typescript issues

* Turn on Typescript linting in common except for no-explicit-any

* Correctly specify tsconfig dir name in functions eslintrc
2022-05-25 17:12:36 -07:00
Ian Philips
0c3fa9f065
Handle free response outcomes for yes/no shares (#338) 2022-05-25 16:51:33 -06:00
Ian Philips
1334840ee0
Fix comment links from /activity & add to emails (#320) 2022-05-25 16:47:08 -06:00
Ian Philips
f0d44be2f4 Clean up time diff code 2022-05-25 16:04:14 -06:00
Ian Philips
f3be3b1f3c Maybe free market countdown will work now, beats me 2022-05-25 15:55:50 -06:00
Ian Philips
d117ff600a Adjust spacing on % input 2022-05-25 12:47:44 -06:00
Ian Philips
959ee5f8d1
Improve create market UI (#336)
* Move to tailwindui

* Remove commented code

* Prettier

* Show custom prob toggle, limit to 5-95%

* match left margin

* Show prob, date, time, other ui changes

* fix for firefox
2022-05-25 12:13:51 -06:00
Ian Philips
d69f4f9a0a
Move to tailwindui for create market page (#332)
* Move to tailwindui

* Remove commented code

* Prettier

* Show custom prob toggle, limit to 5-95%

* match left margin

* Show prob, date, time, other ui changes
2022-05-25 11:54:28 -06:00
James Grugett
92df092ad3 Fix DOM error in console 2022-05-25 11:48:37 -05:00
Forrest Wolf
c5763e6ec3
Extract signup prompt (#333)
* Extract SignUpPrompt component

* Return null instead of false when not showing SignUpPrompt

* Add trailing newline

* Lint
2022-05-25 09:25:39 -07:00
Ian Philips
fb237d502d Adjust emulator install instructions 2022-05-25 10:11:45 -06:00
Ian Philips
1942e1c47a
Show just first 3 letters and chosen answer on fr cards (#318)
* Show just first 3 letters and chosen answer

* 3 dots

* Just show resolved and the chosen answer

* Remove unused truncate & hide resolved except on xs
2022-05-25 07:13:33 -06:00
Austin Chen
eef5dda0f3 Shrink card margin between question & % 2022-05-24 17:25:23 -07:00
Austin Chen
d5a362502a Display liquidity "pool" instead of "bet" volume 2022-05-24 16:57:34 -07:00
Austin Chen
8715ff2740 Semibold the question on cards 2022-05-24 16:39:50 -07:00
Austin Chen
f9336c00be
Preview the quick bet result on hover (#319)
* Switch from triangle to a circle arrow

WIP

* Revert "Switch from triangle to a circle arrow"

This reverts commit 370f8eefe4.

* Show amount moved in probability

* Animate the prob bar change too

* Pull out quick bet display component

* Minor cleanups

* Clean up comments

* Close empty divs

* Feedback from Ian

* Pull out constant

* Get rid of quick bet separators

* Fix typescript change

* Invert colors so gray indicates placed bets

* Update comment on useSaveShares re: Ian's comments
2022-05-24 16:38:43 -07:00
Marshall Polaris
2d8ad40e70
Add outcome type to API market descriptors (#325) 2022-05-24 14:31:49 -07:00
mantikoros
5f385c2f9d Revert "use geometric mean probability to calculate fees for cfmm (a lot easier than solving the integral)"
This reverts commit a1c3a5e569.
2022-05-24 15:46:41 -05:00
mantikoros
c3be126337
Revert "Update leaderboards.tsx (#314)" (#317)
This reverts commit d19d60eb6a.
2022-05-24 09:31:42 -05:00
Ian Philips
811a7cece7 Market => question 2022-05-24 08:28:09 -06:00
Ian Philips
49bfb67daa Revert to showing FR answer 2022-05-24 08:24:01 -06:00
Ian Philips
13bf5ac253 Free daily market bugfix 2022-05-24 07:31:44 -06:00
SirSaltyy
d19d60eb6a
Update leaderboards.tsx (#314)
Renamed top creators header from "market volume" to "market liquidity".
2022-05-24 14:05:12 +01:00
Austin Chen
8cedf93901
Implement quick betting: directly from the market card (#291)
* Play with using 3 icons for 1-click usage

* Align bet icons with the percentages

* Hide liquidity injection star, for now

* Fix Free Response card layouts

* Use triangles instead of planes

* Set correct hover states the arrows

* Fix down triangle & padding

* Default large nums to 2 sigfigs

* Clean up hover areas

* Fix bet width, remove "chance/expected"

* Show "M$20" on hover, hide arrows when closed

* Improve click targets

* FR: "MULTI" => "MANY", single => "TOP"

* Install react-hot-toaster

* Implement quick betting on binary questions

* Handle different kinds of markets

* Extract out QuickBet into its own component

* Minor tweaks

* Visually separate out quick bet pane

* Hide quick bet for FR markets with no answers

* Fill in which bets the user has already placed

* Animate movements, fix binary direction

* Hover arrows are now always gray

* Pull out code into quick-bet.tsx

* Minor comments

* Fix import

ts-ignore is scary

* Fixes from James's feedback

* Hide text only on quickbet
2022-05-23 23:44:16 -07:00
Austin Chen
a8e47d4fc7 Update "No markets found" to point to /create
Fixes #308
2022-05-23 17:49:07 -07:00
Ian Philips
fc320ca1e4
Shrink avatar, paddding, gaps for mobile screens (#275)
* Shrink avatar, paddding, gaps for mobile screens

* Adjust padding, add arrow to input area

* Padding and reply ui adjustments
2022-05-23 16:09:40 -06:00
mantikoros
854daaebb7 nav bar: gray background for selected page (indigo color was too prominent) 2022-05-23 16:49:30 -05:00
mantikoros
244fd7c981 changed sidebar button color — violet doesn't match color scheme 2022-05-23 16:38:42 -05:00
Marshall Polaris
3987baa11b
Add Vercel routes for public write API (#280)
* Improve typing of client CORS helper

* Take node-fetch as a dependency

* Add explicit Firebase region into config

* Add new Vercel proxy API routes that talk to backend

* Call Vercel proxy routes from `api-call` module

* Tweak import to try to get Vercel happy

* Tidy up a tiny bit
2022-05-23 14:16:56 -07:00
Ian Philips
fb33f829cc Clean up free market countdown bugfix 2022-05-23 15:14:50 -06:00
James Grugett
2b13b1adb7 Update activity feed every hour to decrease cost 2022-05-23 15:29:18 -05:00
Ian Philips
0f01753795 Daily free market countdown fix 2022-05-23 11:26:17 -06:00
Ian Philips
d0347ff5c2
Add countdown timer for daily free market (#276)
* Add countdown timer for daily free market

* Reset example numbers

* Remove daily

* Free market reset => 4pm UTC
2022-05-23 08:43:11 -06:00
Ian Philips
355b2261a7 Show numeric bet panel between sm-xl 2022-05-23 08:04:55 -06:00
Ian Philips
e94d204a87
Simplify market creation page (#268)
* Simplify market creation page

* Minor improvements

* Prettier
2022-05-23 06:35:50 -06:00
James Grugett
fc6b36b690 Adjust numeric graph axis to use large number formatting 2022-05-22 22:05:52 -05:00
James Grugett
21527275d1 Fix numeric market embeds 2022-05-22 22:03:05 -05:00
James Grugett
1c73bba908 Show x value in numeric graph's tooltip 2022-05-22 17:48:02 -05:00
James Grugett
f85b10e517 Exclude partial day from analytics 2022-05-22 17:35:10 -05:00
Jonas Wagner
2a5b68977b
Require a minimum amount of 1 Mana per bet. (#273)
This is a hacky patch for a problem that runs more deeply: the use of
floating-point for Mana calculations, along with the associated rounding
errors.

Consider the following example:

```typescript
const balance = 1000
const bet = 5.6e-14
const newBalance = balance - bet
if (newBalance == balance) {
  alert(`I placed a bet of ${bet} without changing my balance.`)
}
```

This will actually print a message, because floating-point numbers can
only represent so many digits, and thus we get 1000.0 rather than
999.99999999999994.

This is a purely theoretical attack at this point; nobody could create
enough pico-bets to actually affect their balance using this technique.
However, I believe is worth ensuring a minimum bet amount, and might
prevent other problems such as the UI showing messages like "User Foo
bought M0 of YES", which could confuse users.

For a more definite solution, we would probably need to change some
computation to integers, where addition is always commutative and
value-preserving. This is similar to what most financial software does
(e.g., Bitcoin uses 1 Satoshi = 0.00000001 BTC as their unit).
2022-05-22 16:34:18 -05:00
Marshall Polaris
73d538c7cf
Modularize imports of hero icons in compiler (#292) 2022-05-22 12:40:34 -07:00
Marshall Polaris
d072216d2d
Kill /about page (#293) 2022-05-22 12:40:16 -07:00
Marshall Polaris
47f10301c8
Change lodash stuff so that it can be tree-shaken out of build (#233)
* Set common package.json sideEffects: false

* Configure SWC to modularize lodash imports

* Import specific lodash functions instead of _

* Add an eslint rule to avoid full lodash import
2022-05-22 01:36:05 -07:00
Marshall Polaris
0803a15902
Set up eslint for common, functions packages (#290)
* Move common dev dependencies to workspace top level

* Add .eslintrc.js for functions and common packages

* Add more linting to check workflow
2022-05-22 00:35:43 -07:00
Marshall Polaris
3061af3837
Kill Husky, lint-staged, and pretty-quick (#288) 2022-05-21 14:50:59 -07:00
Marshall Polaris
3db1de6b66
Add some useEffect dependencies (#289) 2022-05-21 14:48:15 -07:00