Skip to content

Commit

Permalink
Merge pull request #878 from comdex-official/match_fix
Browse files Browse the repository at this point in the history
Integer typecasting update in order matching core for liquidity module
  • Loading branch information
dheerajkd30 authored Dec 22, 2023
2 parents 0131230 + ced9898 commit 60c76ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion x/liquidity/amm/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func MatchableAmount(order Order, price sdkmath.LegacyDec) (matchableAmt sdkmath
remainingOfferCoinAmt := order.GetOfferCoinAmount().Sub(order.GetPaidOfferCoinAmount())
matchableAmt = sdkmath.MinInt(
order.GetOpenAmount(),
sdkmath.LegacyNewDec(remainingOfferCoinAmt.Int64()).QuoTruncate(price).TruncateInt(),
remainingOfferCoinAmt.ToLegacyDec().QuoTruncate(price).TruncateInt(),
)
case Sell:
matchableAmt = order.GetOpenAmount()
Expand Down

0 comments on commit 60c76ee

Please sign in to comment.