-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(CL): convert CalculatePriceToTickDec to operate on BigDec conversions in a state-compatible way #6256
Changes from all commits
2008b4f
c050569
81bda15
cb9fb12
20f430c
3f82d1b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"title":"Param Change","description":"Changing the DefaultTakerFee param","is_expedited":false,"changes":[{"subspace":"poolmanager","key":"DefaultTakerFee","value":"0.001500000000000000"}],"deposit":"625000000uosmo"} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,10 +165,10 @@ func (k Keeper) CalculateSpotPrice( | |
} | ||
|
||
if price.IsZero() { | ||
return osmomath.Dec{}, types.PriceBoundError{ProvidedPrice: price, MinSpotPrice: types.MinSpotPrice, MaxSpotPrice: types.MaxSpotPrice} | ||
return osmomath.Dec{}, types.PriceBoundError{ProvidedPrice: osmomath.BigDecFromDec(price), MinSpotPrice: types.MinSpotPriceV2, MaxSpotPrice: types.MaxSpotPrice} | ||
} | ||
if price.GT(types.MaxSpotPrice) || price.LT(types.MinSpotPrice) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is spot price still on 18 precision? How do we expect assets with spot price below the previous There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it is. This query will not work correctly for the pools with spot price below the old I might have erroneously set The new query that will work universally for all pools is TBD: #6064 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. I ask because we do lean on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah - I thought the conclusion was that this is acceptable for the majority of the pools that we care about for volume splitting. Do you still have any concerns? |
||
return osmomath.Dec{}, types.PriceBoundError{ProvidedPrice: price, MinSpotPrice: types.MinSpotPrice, MaxSpotPrice: types.MaxSpotPrice} | ||
return osmomath.Dec{}, types.PriceBoundError{ProvidedPrice: osmomath.BigDecFromDec(price), MinSpotPrice: types.MinSpotPriceBigDec, MaxSpotPrice: types.MaxSpotPrice} | ||
} | ||
|
||
return price, nil | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this is copied from the original function