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

[ECO-2577] Add calculateCurvePrice function for dexscreener API #454

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

xbtmatt
Copy link
Collaborator

@xbtmatt xbtmatt commented Dec 11, 2024

Description

Dexscreener indicated that we need to calculate price "on top of reserves", not "on top of swap amounts", so we must add a function to calculate the price given the state of reserves after a swap.

  • Add function to calculate the exact, instantaneous price for a market, similar to calculateRealReserves and calculateCirculatingSupply

Testing

  • Add tests to verify intuitively that it makes sense
  • Add various tests with state transitions, buy/sell, etc.

Checklist

  • Did you update relevant documentation?
  • Did you add tests to cover new code or a fixed issue?
  • Did you update the changelog?
  • Did you check all checkboxes from the linked Linear task?

@xbtmatt xbtmatt requested a review from CRBl69 December 11, 2024 04:17
Copy link

vercel bot commented Dec 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
emojicoin-dot-fun ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2024 4:38am
emojicoin-dot-fun-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2024 4:38am

@xbtmatt xbtmatt requested a review from alnoki December 11, 2024 04:23
@xbtmatt xbtmatt merged commit 9e32327 into main Dec 11, 2024
7 checks passed
@xbtmatt xbtmatt deleted the ECO-2577 branch December 11, 2024 18: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.

2 participants