Commit Graph

70 Commits

Author SHA1 Message Date
Austin Chen
d6a751d9a2 Show decimals on 98%+ 2022-03-18 20:02:04 -07:00
Austin Chen
e4c9508340 Show "Buy" and % directly in FR feed 2022-03-16 21:42:24 -07:00
James Grugett
727911816c Fix graph bug for sold bets. 6 lines. Clean up. 2022-03-16 18:47:12 -05:00
Austin Chen
958dc2b431 Use a stacked line graph for FR answers 2022-03-15 17:26:59 -07: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
bd62d8fbcd FR graph: Truncate answer labels further 2022-03-15 15:32:39 -05:00
James Grugett
1bb5d3b8cd
Answers graph (#65)
* In progress

* Calculate correct graph probabilites
2022-03-15 14:42:04 -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
Austin Chen
ef77779cec Format Tailwind classes with Prettier
Not sure why Husky hooks aren't enforcing this 🤷
2022-03-03 01:09:32 -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
6abf235505 Show correct remaning balance for ante input when creating market 2022-03-02 13:50:19 -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
77b4ca4f22 FR: Don't show bet panel if resolving, or past close date. 2022-02-26 10:56:49 -06:00
James Grugett
2775bf44a2 Put back answer number on answer item 2022-02-26 10:51:36 -06:00
James Grugett
b1e0f3ee80 Linkify answer text 2022-02-25 22:00:23 -06:00
Austin Chen
952b7be94a
Show a mini-feed of comments & bets below each FR answer (#52)
* Take out <ul> from Feed

* Show a mini-feed under each FR answer

* Expand row on click

* Show feed item for FR answer submission

* Fix build
2022-02-24 11:26:01 -08:00
James Grugett
8fe9f23d91 Fix hiding answers where all bets sold 2022-02-22 14:12:49 -06:00
James Grugett
20a3966820 Filter out answers with 0 dollars 2022-02-20 17:19:45 -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
8580698c15 Split answers panel into 5 files 2022-02-20 16:25:58 -06:00