diff --git a/common/envs/constants.ts b/common/envs/constants.ts index 3fac56df..7092d711 100644 --- a/common/envs/constants.ts +++ b/common/envs/constants.ts @@ -36,7 +36,7 @@ export const CORS_ORIGIN_MANIFOLD = new RegExp( ) // Vercel deployments, used for testing. export const CORS_ORIGIN_VERCEL = new RegExp( - '^https?://(?:[a-zA-Z0-9\\-]+\\.)*' + escapeRegExp('vercel.app') + '$' + '^https?://[a-zA-Z0-9\\-]+' + escapeRegExp('mantic.vercel.app') + '$' ) // Any localhost server on any port export const CORS_ORIGIN_LOCALHOST = /^http:\/\/localhost:\d+$/ diff --git a/common/new-bet.ts b/common/new-bet.ts index 541b8afe..719a6533 100644 --- a/common/new-bet.ts +++ b/common/new-bet.ts @@ -168,8 +168,6 @@ export const getBinaryCpmmBetInfo = ( const { taker, maker } = fill - amount -= taker.amount - if (maker.matchedBetId === null) { // Matched against pool. cpmmState = maker.state @@ -182,6 +180,8 @@ export const getBinaryCpmmBetInfo = ( i++ } + amount -= taker.amount + if (floatingEqual(amount, 0)) break }