Commit Graph

15 Commits

Author SHA1 Message Date
Marshall Polaris
2d8ad40e70
Add outcome type to API market descriptors (#325) 2022-05-24 14:31:49 -07: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
Marshall Polaris
5efcf61289
Configure compiler to allow absolute imports from root (#147) 2022-05-08 13:33:58 -07:00
James Grugett
4de0fcd198 Revert "Represent DB avatar URLs as non-null (#128)"
This reverts commit bf8e09b6c1.
2022-05-06 14:29:15 -04:00
Marshall Polaris
bf8e09b6c1
Represent DB avatar URLs as non-null (#128) 2022-05-04 11:07:22 -07:00
Marshall Polaris
731e5d5b7c
Apply permissive CORS headers to API (#115)
* Take cors package as dependency

* Apply permissive CORS headers to all API routes
2022-04-30 13:30:49 -07:00
mantikoros
927a5137a2 update api to include cfmm props 2022-03-17 11:55:06 -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
8884f1beb9
Expose resolutionTime in API (#56)
* Expose resolutionTime. Compute closeTime to be the min of resolution and close time

* Rename settled to resolved, newest to most recent
2022-02-28 11:40:48 -08:00
mantikoros
42f88766b3 api: remove userId from bets 2022-02-19 22:51:51 -06:00
Austin Chen
8f40350a75 API: Rename to LiteMarket/FullMarket; include creator avatar url 2022-02-17 16:04:05 -08:00
Austin Chen
51aa8df010
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
2022-02-17 12:56:24 -08:00
Austin Chen
20a425df6e Prettier: no semi, spaces 2, single quote, trailing comma 2021-12-02 17:49:46 -06:00
Austin Chen
d6d48bb6b4 Reformat with prettier 2021-12-02 17:39:11 -06:00
jahooma
a1163bfcfb Create Nextjs template app under web directory. 2021-11-30 22:20:13 -06:00