Skip to content

Commit

Permalink
Merge pull request #130 from propeller-heads/tl/enable-uniswap-v4-on-…
Browse files Browse the repository at this point in the history
…examples

feat: add uniswap_v4 to examples
  • Loading branch information
tvinagre authored Jan 30, 2025
2 parents 751d392 + 6f7a1da commit dc4fc07
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
8 changes: 7 additions & 1 deletion examples/price_printer/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ use tycho_simulation::{
evm::{
engine_db::tycho_db::PreCachedDB,
protocol::{
filters::{balancer_pool_filter, curve_pool_filter},
filters::{balancer_pool_filter, curve_pool_filter, uniswap_v4_pool_with_hook_filter},
uniswap_v2::state::UniswapV2State,
uniswap_v3::state::UniswapV3State,
uniswap_v4::state::UniswapV4State,
vm::state::EVMPoolState,
},
stream::ProtocolStreamBuilder,
Expand Down Expand Up @@ -68,6 +69,11 @@ async fn main() {
tvl_filter.clone(),
Some(curve_pool_filter),
)
.exchange::<UniswapV4State>(
"uniswap_v4",
tvl_filter.clone(),
Some(uniswap_v4_pool_with_hook_filter),
)
.auth_key(Some(tycho_api_key.clone()))
.set_tokens(all_tokens)
.await
Expand Down
9 changes: 8 additions & 1 deletion examples/quickstart/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use tycho_simulation::{
evm::{
engine_db::tycho_db::PreCachedDB,
protocol::{
filters::balancer_pool_filter, uniswap_v2::state::UniswapV2State,
filters::{balancer_pool_filter, uniswap_v4_pool_with_hook_filter},
uniswap_v2::state::UniswapV2State,
uniswap_v4::state::UniswapV4State,
vm::state::EVMPoolState,
},
stream::ProtocolStreamBuilder,
Expand Down Expand Up @@ -44,6 +46,11 @@ async fn main() {
tvl_filter.clone(),
Some(balancer_pool_filter),
)
.exchange::<UniswapV4State>(
"uniswap_v4",
tvl_filter.clone(),
Some(uniswap_v4_pool_with_hook_filter),
)
.auth_key(Some(tycho_api_key.clone()))
.set_tokens(all_tokens.clone())
.await
Expand Down

0 comments on commit dc4fc07

Please sign in to comment.