-
Notifications
You must be signed in to change notification settings - Fork 13
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
fix: DYDX spot price bug #212
Changes from all commits
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 |
---|---|---|
|
@@ -33,9 +33,6 @@ type RoutablePool interface { | |
CalculateTokenOutByTokenIn(ctx context.Context, tokenIn sdk.Coin) (sdk.Coin, error) | ||
ChargeTakerFeeExactIn(tokenIn sdk.Coin) (tokenInAfterFee sdk.Coin) | ||
|
||
// SetTokenOutDenom sets the token out denom on the routable pool. | ||
SetTokenOutDenom(tokenOutDenom string) | ||
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. Can we remove this at a later date? Will this break the node, if 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. No, this will not break the node. It would only break if we changed serialization. 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. Great, happy to approve then |
||
|
||
GetTakerFee() osmomath.Dec | ||
|
||
GetSpreadFactor() osmomath.Dec | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -221,8 +221,6 @@ func (c *chainPricing) computePrice(ctx context.Context, baseDenom string, quote | |
if useAlternativeMethod { | ||
// Compute on-chain price for 1 unit of base denom and quote denom. | ||
chainPrice = osmomath.NewBigDecFromBigInt(tenQuoteCoin.Amount.BigIntMut()).QuoMut(osmomath.NewBigDecFromBigInt(quote.GetAmountOut().BigIntMut())) | ||
} else { | ||
chainPrice = osmomath.OneBigDec().QuoMut(chainPrice) | ||
Comment on lines
-224
to
-225
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. Note: This is a drive-by change. This was needed because we were confusing base and quote in |
||
} | ||
|
||
if chainPrice.IsZero() { | ||
|
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 a drive-by change. We were negating this in
pricing_chain.go
so it did not result in any bug