corr totalbets normalization
This commit is contained in:
@@ -1343,12 +1343,14 @@ UniValue PricesInfo(uint256 bettxid, int32_t refheight)
|
||||
|
||||
int64_t equity = totalbets + totalprofits;
|
||||
std::cerr << "PricesInfo() " << " totalbets=" << (totalbets / PRICES_NORMFACTOR) << std::endl;
|
||||
if (totalbets / PRICES_NORMFACTOR != 0) //prevent zero div
|
||||
costbasis /= (totalbets / PRICES_NORMFACTOR);
|
||||
if (totalbets != 0) { //prevent zero div
|
||||
costbasis /= totalbets;
|
||||
costbasis /= PRICES_NORMFACTOR; //denormalization
|
||||
}
|
||||
else
|
||||
costbasis = 0;
|
||||
int64_t liqprice;
|
||||
if (leverage != 0)
|
||||
if (leverage != 0) // prevent zero div
|
||||
liqprice = costbasis - costbasis / leverage;
|
||||
else
|
||||
liqprice = 0;
|
||||
|
||||
Reference in New Issue
Block a user