-
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
feat: SQS pricing from on-chain source #85
Conversation
// TODO: move to config | ||
defaultQuoteHumanDenom = "usdc" | ||
defaultPricingSource = domain.ChainPricingSource |
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.
Move defaultQuoteHumanDenom and defaultPricingSource to config
} | ||
|
||
// GetPrice implements pricing.PricingStrategy. | ||
func (c *chainPricing) GetPrice(ctx context.Context, baseDenom string, quoteDenom string) (osmomath.BigDec, error) { |
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.
Unit test GetPrice
method of chainPricing
Maximize test coverage
// @Param humanDenoms query bool false "Specify true if input denominations are in human-readable format; defaults to false" | ||
// @Success 200 {object} map[string]map[string]string "A map where each key is a base denomination (on-chain format), containing another map with a key as the quote denomination (on-chain format) and the value as the spot price." | ||
// @Router /tokens/prices [get] | ||
func (a *TokensHandler) GetPrices(c echo.Context) (err error) { |
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.
Operationalize /tokens/prices endpoint
- Load test
- Fuzz unit test with various combinations of mainnet denoms from mainnet state
- Add instrumentation
- Build dashboards
}, nil | ||
} | ||
|
||
// GetDenomPrecisions implements domain.TokensUsecase. | ||
func (t *tokensUseCase) GetDenomPrecisions(ctx context.Context) (map[string]int, error) { | ||
// GetChainDenom implements mvc.TokensUsecase. |
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.
Unit test all methods in tokensUsecase
No description provided.