Skip to content

Problem loading certain uniswap_v4 pools #302

@johnwhitton

Description

@johnwhitton

When using get_amount for certain uniswap_v4 pools it errors

Note: although the example below is from unichain, this also occurs on base and ethereum.

For now I'm just ignoring these pools.

Here is an example using quickstart

lib/tycho-simulation $ cargo run --example quickstart -- --sell-token 0x0000000000000000000000000000000000000000 --buy-token 0x0555e30da8f98308edb960aa94c0db47230d2b9c --chain unichain
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.72s
     Running `target/debug/examples/quickstart --sell-token 0x0000000000000000000000000000000000000000 --buy-token 0x0555e30da8f98308edb960aa94c0db47230d2b9c --chain unichain`
Loading tokens from Tycho... tycho-unichain-beta.propellerheads.xyz
Tokens loaded: 117723

thread 'main' panicked at examples/quickstart/main.rs:152:10:
Buy token not found
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
lib/tycho-simulation $ pwd
/Users/johnwhitton/dev/jincubator/solver/lib/tycho-simulation
lib/tycho-simulation $ cargo run --example quickstart -- --sell-token 0x0000000000000000000000000000000000000000 --buy-token 0x0555e30da8f98308edb960aa94c0db47230d2b9c --chain unichain
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.50s
     Running `target/debug/examples/quickstart --sell-token 0x0000000000000000000000000000000000000000 --buy-token 0x0555e30da8f98308edb960aa94c0db47230d2b9c --chain unichain`
Loading tokens from Tycho... tycho-unichain-beta.propellerheads.xyz
Tokens loaded: 117707

thread 'main' panicked at examples/quickstart/main.rs:152:10:
Buy token not found
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
lib/tycho-simulation $

And here is a log from my implementation

🚨 CRITICAL ERROR: Overflow panic in get_amount_out!
🚨 Problematic Pool ID: 0x410723c1949069324d0f6013dba28829c4a0562f7c81d0f7cb79ded668691e1f
🚨 Pool Protocol: uniswap_v4
🚨 From Token: ETH (0x0000000000000000000000000000000000000000)
🚨 To Token: UNKNOWN (0x0555e30da8f98308edb960aa94c0db47230d2b9c)
🚨 Input Amount: ETH 1 (1000000000000000000 wei)
🚨 Panic Info: Any { .. }
🚨 Exiting due to overflow error in pool 0x410723c1949069324d0f6013dba28829c4a0562f7c81d0f7cb79ded668691e1f

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions