-
Notifications
You must be signed in to change notification settings - Fork 39
feat: UniswapV4 Hooks support #232
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: UniswapV4 Hooks support #232
Conversation
substreams/ethereum-uniswap-v4/with-hooks/ethereum-uniswap-v4-with-hooks.yaml
Show resolved
Hide resolved
substreams/ethereum-uniswap-v4/no-hooks/src/variant_modules/1_map_pool_created.rs
Show resolved
Hide resolved
substreams/ethereum-uniswap-v4/shared/src/modules/6_map_protocol_changes.rs
Outdated
Show resolved
Hide resolved
a1fa8ce to
e4a1f00
Compare
4668fff to
f3970a4
Compare
This commit reduces the `store_pool_per_euler_hook` store size to the minimum required. We only use it for euler pools and only store one pool per hook.
…h previous slot value
This new version has a bugfix for block storage extraction.
9f4ea02 to
e3f1624
Compare
and skip checking for changes in non-substream submodules
9ad7e0b to
a88bcc2
Compare
| use tycho_substreams::{block_storage::get_block_storage_changes, prelude::*}; | ||
|
|
||
| #[substreams::handlers::map] | ||
| pub fn map_dci_protocol_changes( |
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.
I'm not a big fan of this. I think we should not share the same map_protocol_changes instead. We can have a function that is used by both but the map itself should be adapted directly imo.
The main reason is because this adds an additional sequential map, so it most likely comes with perf overhead.
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.
I'm fine with it - I don't think this adds much performance overhead, do u? It's on a separate module so it will be paralellized
Otherwise I'd prefer to modify map_protocol_changes to take a flag and conditionally add storage_changes instead of having two map_protocol_changes
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.
It's hard to quantify the perf overhead here, for historical state it'll be handled in parallel probably but not for real time data. Not sure how this works on the Substreams side and if it's fine to add maps or not.
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.
I think I'll instead make a helper fn that collects the non-block storage changes to reduce repeated code. Then use it in separate map_protocol_changes.
substreams/ethereum-uniswap-v4/shared/src/modules/6_map_protocol_changes.rs
Outdated
Show resolved
Hide resolved
| use tycho_substreams::{block_storage::get_block_storage_changes, prelude::*}; | ||
|
|
||
| #[substreams::handlers::map] | ||
| pub fn map_dci_protocol_changes( |
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.
I'm fine with it - I don't think this adds much performance overhead, do u? It's on a separate module so it will be paralellized
Otherwise I'd prefer to modify map_protocol_changes to take a flag and conditionally add storage_changes instead of having two map_protocol_changes
This allows us to centralise repeated code between the hooks and no hooks implementations.
a1c5d24 to
bf702b0
Compare
* feat: Adapt UniV4 Substreams to emmit storage changes * feat: Split UniswapV4 into hooks and no-hooks * feat: Add yaml config file for UniV4 with no Hooks * feat: Identify Euler pools on initialization, pause Uninstalled pools * fix: Bump Substreams version * refactor: rust fmt * refactor: optimize store, remove unused params and code * refactor: improve `store_pool_per_euler_hook` This commit reduces the `store_pool_per_euler_hook` store size to the minimum required. We only use it for euler pools and only store one pool per hook. * refactor: cargo fmt * refactor: update `euler_pools_per_hook_store` lookup * fix: Attach pausing attribute to the correct transaction * fix: Attach pausing attribute to the correct transaction * chore: cargo fmt * feat: bump version to 0.5.0 to use new Tycho-substreams interface with previous slot value * chore: use crate.io for `tycho-substreams` dependency * fix: update tycho-substreams version This new version has a bugfix for block storage extraction. * fix: update tycho-substreams version to include native balances * feat: remove full `block_storage_changes` from core usv4 * refactor: apply clippy suggestions * ci: include all workspace packages on workspace change and skip checking for changes in non-substream submodules * feat: create usv4 helper fn to collect block changes This allows us to centralise repeated code between the hooks and no hooks implementations. --------- Co-authored-by: zizou <[email protected]> Co-authored-by: Louise Poole <[email protected]>
No description provided.