Commit Graph

21 Commits

Author SHA1 Message Date
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
Sinclair Chen
50eb9bd4bd
Remove resize handles from input fields (#67) 2022-03-25 09:27:28 -07:00
James Grugett
510e4400d3 Rename liquidity label to volume label 2022-03-23 00:02:47 -05:00
James Grugett
1a44124a59 Preserve new lines in answer feed item 2022-03-22 00:20:52 -05:00
Austin Chen
37b8cc9687
Show a top 5 leaderboard on resolved markets (#66)
* Show a top5 leaderboard on resolved markets

* Only show profitable traders

* Include sales in profits

* Copy Leaderboard styling

* Also show the top comment and trade

* Fix padding for solo bets

* Only show both comment & bet if they differ
2022-03-20 18:07:45 -07:00
James Grugett
f00064732d Only answers with less than 0.01% are filtered from feed. 2022-03-19 01:13:40 -05:00
Austin Chen
4c8b7bbc3d Hide buy button when market has closed 2022-03-17 17:15:07 -07:00
James Grugett
addc883440 Track seen contracts in feed. Order feed by seen time priority. 2022-03-17 02:29:19 -05:00
Austin Chen
e4c9508340 Show "Buy" and % directly in FR feed 2022-03-16 21:42:24 -07:00
Austin Chen
94f6f08784 Disable submissions without eating the comment after 1h 2022-03-16 19:55:03 -07:00
Austin Chen
9426cc2b94 Stop showing creator's trades in all cases 2022-03-16 19:37:43 -07:00
James Grugett
4847939e8c Filter out redemption bets from feeds 2022-03-16 17:55:11 -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
Austin Chen
1444d60e11 Visual touchups on FeedAnswerGroups 2022-03-15 13:11:14 -07:00
Austin Chen
f17c4ac40f Fix username link 2022-03-15 12:22:21 -07:00
James Grugett
db7eee495c Answer group feed: Always include answer of last bet. 2022-03-14 19:39:40 -05:00
James Grugett
a82b3577d4 Group older bets by 7-days 2022-03-14 17:11:10 -05:00
James Grugett
7ca0b3662f Small avatars for nested feed items 2022-03-14 16:56:53 -05:00
James Grugett
5524889d48 FR answer group: Choose one outcome for having a comment 2022-03-14 16:39:59 -05:00
James Grugett
f2d26b631d Filter out undefined answer 2022-03-14 16:08:08 -05:00
James Grugett
93287f8dc1
Answers in feed (#63)
* Compute answer group feed items

* Refactor feed code into 5 files under feed directory.

* Convert to typed ActivityItems

* Use feed "mode". Clean up cases.

* Implement feed answer groups!

* FR: Use nested comments/bets under answers for contract page. filter more items out of FR feed.

* Linkify answer text on activity feed

* Default feed excluded tags are case insensitive

* Show followed folds first

* Allow filtering your trades

* Store users's last sort in localstorage

* Use avatar of user that submitted answer and name instead of pencil icon. Spacing. Show up to 3 comments in asnwer group.

* Don't reveal market creator's bets

* Fix communites feed to be abbreviated

* Remove complicated answer group logic

Co-authored-by: Austin Chen <akrolsmir@gmail.com>
2022-03-14 15:29:32 -05:00