Skip to content
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

Merged
merged 4 commits into from
Feb 22, 2024
Merged

feat: SQS pricing from on-chain source #85

merged 4 commits into from
Feb 22, 2024

Conversation

p0mvn
Copy link
Member

@p0mvn p0mvn commented Feb 22, 2024

No description provided.

Comment on lines +33 to +35
// TODO: move to config
defaultQuoteHumanDenom = "usdc"
defaultPricingSource = domain.ChainPricingSource
Copy link
Member Author

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) {
Copy link
Member Author

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) {
Copy link
Member Author

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.
Copy link
Member Author

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

@p0mvn p0mvn merged commit ebdef28 into v23.x Feb 22, 2024
2 of 3 checks passed
@p0mvn p0mvn deleted the roman/pricing-poc branch February 22, 2024 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant