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

move the oracle into a hook, remove time based stuff from pool manager #54

Merged
merged 20 commits into from
Apr 27, 2022

Conversation

moodysalem
Copy link
Contributor

@moodysalem moodysalem commented Apr 19, 2022

fixes #53
fixes #64

Copy link
Contributor

@willpote willpote left a comment

Choose a reason for hiding this comment

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

Cool

Comment on lines +35 to +36
/// @notice Get the current value in slot0 of the given pool
function getSlot0(PoolKey memory key) external view returns (uint160 sqrtPriceX96, int24 tick);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we unpack this? Why not return the Slot0 struct?

Copy link
Contributor Author

@moodysalem moodysalem Apr 19, 2022

Choose a reason for hiding this comment

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

the slot0 struct feels like an internal thing, consumers shouldn't need to know about it, although it was exposed in the previous versions and also named that...

Copy link
Contributor

Choose a reason for hiding this comment

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

In that case should we rename this to something like getPrice so the term slot0 remains internal?

Copy link
Contributor Author

@moodysalem moodysalem Apr 26, 2022

Choose a reason for hiding this comment

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

i'd rather defer the issue, it was named slot0 because in the past it contained other stuff that wasn't just the price or easily categorized except that they all were packed in slot 0. we don't know what else will go in the slot later

@moodysalem moodysalem marked this pull request as ready for review April 26, 2022 15:36
@moodysalem moodysalem requested a review from willpote April 26, 2022 15:36
@moodysalem moodysalem merged commit b6dc896 into main Apr 27, 2022
@moodysalem moodysalem deleted the oracle-hook branch April 27, 2022 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants