Commit Graph

53 Commits

Author SHA1 Message Date
James Grugett
510e4400d3 Rename liquidity label to volume label 2022-03-23 00:02:47 -05:00
James Grugett
cf2b54ab8d Rearrange contract overview (-10 LOC!) 2022-03-21 16:19:08 -05:00
James Grugett
2eeaeff92d Normal case Embed. Tweak gap so contract details fit in one row on more markets 2022-03-21 15:36:03 -05:00
James Grugett
4a617a4c07 Share embed button 2022-03-21 15:23:21 -05:00
James Grugett
48f5c28d75 Simplified contract embed 2022-03-20 16:05:16 -05:00
Austin Chen
758385f044 Invert Tweet button 2022-03-18 17:05:31 -07:00
James Grugett
ecc87c7989 Correctly render resolve prob % 2022-03-15 21:46:14 -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
b0e4f6d27a Add time param to Twitter share url, so that the image preview is re-fetched 2022-03-08 15:36:15 -06:00
Austin Chen
6243f132aa Add "closed" sort option 2022-03-01 18:02:07 -08:00
James Grugett
7bc43682b8 Move tweet button into contract details 2022-02-22 21:38:53 -06:00
James Grugett
b7af65eec3 Move Twitter button above graph per Stephen's request 2022-02-22 21:22:24 -06:00
James Grugett
561a7e2c75 Allow editing the close time 2022-02-20 22:04:00 -06:00
James Grugett
fd846254a0 Implement resolving to multiple answers, weighted by probability 2022-02-20 01:26:33 -06:00
Austin Chen
3dd7b12e71 Iconify contract details; show relative closing time 2022-02-17 18:24:10 -08:00
James Grugett
b2501d8145
Free response (#47)
* Answer datatype and MULTI outcome type for Contract

* Create free answer contract

* Automatically sort Tailwind classes with Prettier (#45)

* Add Prettier Tailwind plugin

* Autoformat Tailwind classes with Prettier

* Allow for non-binary contracts in contract page and related components

* logo with white inside, transparent bg

* Create answer

* Some UI for showing answers

* Answer bet panel

* Convert rest of calcuate file to generic multi contracts

* Working betting with ante'd NONE answer

* Numbered answers. Layout & calculation tweaks

* Can bet. More layout tweaks!

* Resolve answer UI

* Resolve multi market

* Resolved market UI

* Fix feed and cards for multi contracts

* Sell bets. Various fixes

* Tweaks for trades page

* Always dev mode

* Create answer bet has isAnte: true

* Fix  card showing 0% for multi contracts

* Fix grouped bets feed for multi outcomes

* None option converted to none of the above label at bottom of list. Button to resolve none.

* Tweaks to no answers yet, resolve button layout

* Show ante bets on new answers in the feed

* Update placeholder text for description

* Consolidate firestore rules for subcollections

* Remove Contract and Bet type params. Use string type for outcomes.

* Increase char limit to 10k for answers. Preserve line breaks.

* Don't show resolve options after answer chosen

* Fix type error in script

* Remove NONE resolution option

* Change outcomeType to include 'MULTI' and 'FREE_RESPONSE'

* Show bet probability change and payout when creating answer

* User info change: also change answers

* Append answers to contract field 'answers'

* sort trades by resolved

* Don't include trailing !:,.; in links

* Stop flooring inputs into formatMoney

* Revert "Stop flooring inputs into formatMoney"

This reverts commit 2f7ab18429.

* Consistently floor user.balance

* Expand create panel on focus

From Richard Hanania's feedback

* welcome email: include link to manifold

* Fix home page in dev on branches that are not free-response

* Close emails (#50)

* script init for stephen dev

* market close emails

* order of operations

* template email

* sendMarketCloseEmail: handle unsubscribe

* remove debugging

* marketCloseEmails: every hour

* sendMarketCloseEmails: check undefined

* marketCloseEmails: "every hour" => "every 1 hours"

* Set up a read API using Vercel serverless functions (#49)

* Set up read API using Vercel serverless functions

Featuring:
/api/v0/markets
/api/v0/market/[contractId]
/api/v0/slug/[contractSlug]

* Include tags in API

* Tweaks. Remove filter for only binary contract

* Fix bet probability change for NO bets

* Put back isProd calculation

Co-authored-by: Austin Chen <akrolsmir@gmail.com>
Co-authored-by: mantikoros <sgrugett@gmail.com>
Co-authored-by: mantikoros <95266179+mantikoros@users.noreply.github.com>
2022-02-17 17:00:19 -06:00
James Grugett
4917d4084b Break words in questions 2022-02-14 20:27:43 -06:00
Austin Chen
97bf1049b5 Show gray probabilities for closed markets 2022-02-14 13:34:05 -08:00
Austin Chen
7338bdd47a
Automatically sort Tailwind classes with Prettier (#45)
* Add Prettier Tailwind plugin

* Autoformat Tailwind classes with Prettier
2022-02-11 10:40:22 -08:00
Austin Chen
99a5612c8d Display avatar in contract details 2022-02-05 23:02:52 -08:00
Austin Chen
0959ec7679 Show avatar on contract cards 2022-02-04 10:30:56 -08:00
James Grugett
6427e1bd06 Save tags unique and case-insensitive. Don't clear added tags on updating description. 2022-01-30 21:25:52 -06:00
mantikoros
f06ca8305c
Resolve prob (#41)
* rename MKT to PROB; show resolved probability; move format utilities to common

* ProbabilitySelector

* resolve to PROB

* prob and mkt labels
2022-01-30 15:51:30 -06:00
jahooma
769763d006 Tweaks 2022-01-27 00:38:42 -06:00
jahooma
33c8fe2bc0 Append tags from market page 2022-01-26 17:45:07 -06:00
Austin Chen
793a2c6d6c Closing soon: hide already closed, show close time 2022-01-24 01:38:29 -06:00
jahooma
fe912921eb Use nicer tag component for folds 2022-01-22 14:52:49 -06:00
James Grugett
60f68b178d
Folds (#34)
* Fold type, fold page, query for fold contracts

* Tsconfig: target esnext, nounused locals: false

* Store tags in field on contract. Script to update contract tags

* Show tags on fold page

* Load all fold comments server-side to serve better feed

* Fix the annoying firebase already initialized error!

* Add links to /edit and /leaderboards for fold

* Page with list of folds

* UI for creating a fold

* Create a fold

* Edit fold page
2022-01-21 17:21:46 -06:00
mantikoros
df9b498e18 "Market closes" => "Trading ends" 2022-01-19 16:07:58 -06:00
mantikoros
4cca60b16e contract card: simplify date display 2022-01-19 16:01:54 -06:00
jahooma
ee64c4e923 Bring back cards having different heights in a row 2022-01-18 16:55:39 -06:00
jahooma
4d975ff512 Add closing soon section to home 2022-01-17 16:54:00 -06:00
Austin Chen
d32147b536 Show DateTime tooltips whereever we show dates 2022-01-16 04:16:15 -05:00
jahooma
9209b3cb05 Fix nested <a> tag 2022-01-15 17:28:49 -06:00
Austin Chen
77e6ea5a6b Replace close time with year 2022-01-14 18:34:54 -05:00
jahooma
1af03bc53d Improve card style flashing on load 2022-01-14 16:59:14 -06:00
jahooma
c70ec1dad3 Remove 3 unnecessary DOM elements from card 2022-01-14 12:28:48 -06:00
jahooma
40c853e595 Reimplement hot markets with flex box, since I can't figure out how to make the css grid version not flash bad layout. 2022-01-14 00:55:35 -06:00
jahooma
974d41434e Try to fix flashing css grid #2 2022-01-13 17:08:12 -06:00
jahooma
1683a3842b Link to user from feed mentions. Show name instead of username in card. 2022-01-13 15:16:47 -06:00
mantikoros
9d5490cf9a
Switch to new dpm mechanism (#26)
* initial commit

* antes

* rename path, compute to contractPath, contractMetrics

* merge

* Include antes as bets; more calculations

* fees on estimated winnings

* mkt payout calculation

* contract: remove startPool, add phantomShares

* Merge branch 'main' into new-dpm

* dpm migration script

* my service account
2022-01-12 13:01:04 -06:00
Austin Chen
2df96cc0b5 Replace '24h vol' with trending icon 2022-01-12 12:51:46 -05:00
Austin Chen
a9b4570fff Cut creator name from OG card metadata
(It's already on the top)
2022-01-10 02:09:39 -05:00
Austin Chen
feca042e47
Use the generated OpenGraph card in all markets (#23)
* Run OpenGraph server on dev port 3001

* Cut '%' since frontend already passes it

* Use the generated card in markets

* Rename to ogCardProps

* Don't show creator avatar url, for now

* Remove bad comment
2022-01-10 02:05:24 -05:00
jahooma
179fa8c608 Stephen's feedback: change 🔥 => 24h vol in card 2022-01-09 17:59:37 -06:00
jahooma
cedd8df45c Show hot market 24 hour volume instead of pool 2022-01-09 15:21:30 -06:00
jahooma
3302cbddbd Move contract close time into contract details 2022-01-05 11:49:23 -06:00
jahooma
e20537bf49 Remove tags and date from card. 2022-01-05 01:06:30 -06:00
jahooma
1bc323d575 Hot markets! 🔥 2022-01-05 00:33:01 -06:00
jahooma
67007c5897 Make tweet button smaller 2022-01-04 16:47:56 -06:00