diff --git a/src/cc/prices.cpp b/src/cc/prices.cpp index 6e785b6fc..5d608beb2 100644 --- a/src/cc/prices.cpp +++ b/src/cc/prices.cpp @@ -1337,12 +1337,12 @@ UniValue PricesInfo(uint256 bettxid, int32_t refheight) for (auto b : bets) { totalbets += b.amount; totalprofits += b.profits; - costbasis += b.amount * b.costbasis / PRICES_NORMFACTOR; // prevent overflow + costbasis += b.amount * (b.costbasis / PRICES_NORMFACTOR); // prevent overflow std::cerr << "PricesInfo() acc costbasis=" << costbasis << " b.amount=" << b.amount << " b.costbasis=" << b.costbasis << std::endl; } int64_t equity = totalbets + totalprofits; - costbasis /= totalbets / PRICES_NORMFACTOR; + costbasis /= (totalbets / PRICES_NORMFACTOR); int64_t liqprice = costbasis - costbasis / leverage;