Skip to content

Commit

Permalink
use U256 in calculateSqrtPrice
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciech-cichocki committed Apr 9, 2024
1 parent 2016ab5 commit ba40f4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/math/decimal.ral
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ Abstract Contract Decimal(uints: Uints) {
if (tickIndex >= 0i) {
return rescale(sqrtPrice, FixedPointScale, SqrtPriceScale)
} else {
let sqrtPriceInFixedPointScale = uints.bigDiv512(uints.toU512(one(SqrtPriceScale)), sqrtPrice, 1)
return rescale(sqrtPriceInFixedPointScale.lower, FixedPointScale, SqrtPriceScale)
let sqrtPriceInFixedPointScale = FixedPointDenominator * FixedPointDenominator / sqrtPrice
return rescale(sqrtPriceInFixedPointScale, FixedPointScale, SqrtPriceScale)
}
}

Expand Down

0 comments on commit ba40f4c

Please sign in to comment.