From 21f18a56b1e94a23694164d12c37c76e1d085f26 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 14:22:21 -0400 Subject: [PATCH] Round up when calculating impact price subticks (backport #1982) (#1986) Co-authored-by: jayy04 <103467857+jayy04@users.noreply.github.com> --- protocol/x/clob/memclob/memclob.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/protocol/x/clob/memclob/memclob.go b/protocol/x/clob/memclob/memclob.go index 71e0268498..5a4a88ce7d 100644 --- a/protocol/x/clob/memclob/memclob.go +++ b/protocol/x/clob/memclob/memclob.go @@ -2208,10 +2208,7 @@ func (m *MemClobPriceTimePriority) getImpactPriceSubticks( // Impact order was fully matched. Calculate average impact price. return types.GetAveragePriceSubticks( impactNotionalQuoteQuantums, - new(big.Int).Div( - accumulatedBaseQuantums.Num(), - accumulatedBaseQuantums.Denom(), - ), + lib.BigRatRound(accumulatedBaseQuantums, true), clobPair.QuantumConversionExponent, ), true }