-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fetch openlongs from transfer single events #1157
Conversation
Co-authored-by: Danny Delott <DannyDelott@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Ignored Deployments
|
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.
Nice, What do you think about:
getOpenLongs
and getOpenLongDetails
as the two names? I feel like the word "Position" in there isn't clarifying anything
const allLongs = await readHyperdrive.getOpenLongPositions({ | ||
account, | ||
}); | ||
allLongs.forEach(async (long) => { |
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.
minor: We should use Promise.all + Array.map for this, otherwise openLongPositionsReceived
will be returned before the asynchronous operations inside the loop have finished.
Agreed, position doesn't add anything. |
This is the first in a series of PR's that migrates our openlongs table to fetch the data from transfer single events. This will be useful to show positions that have been transferred to a users wallet from another address. A few things to note: