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

fix: correct SUI/USD price calculation #2150

Merged
merged 3 commits into from
Jan 11, 2025

Conversation

ChainRex
Copy link
Contributor

Relates to

Risks

Low

Background

What does this PR do?

Fixes SUI/USD price calculation by using the correct price conversion from the Dexscreener API response. The API returns price data for the USDC/SUI trading pair where:

  • priceNative represents how many SUI tokens are needed to buy 1 USDC
  • priceUsd represents the USDC price in USD

To get the correct SUI price in USD, we need to use the inverse of priceNative rather than using priceUsd directly.

What kind of change is this?

Bug fix

Documentation changes needed?

My changes do not require a change to the project documentation.

Testing

Where should a reviewer start?

Detailed testing steps

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ChainRex! Welcome to the ai16z community. Thanks for submitting your first pull request; your efforts are helping us accelerate towards AGI. We'll review it shortly. You are now a ai16z contributor!

Copy link
Collaborator

@monilpat monilpat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@monilpat monilpat merged commit 94daffc into elizaOS:develop Jan 11, 2025
3 checks passed
0xpi-ai pushed a commit to 0xpi-ai/NayariAI that referenced this pull request Jan 15, 2025
fix: correct SUI/USD price calculation
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.

2 participants