-
Notifications
You must be signed in to change notification settings - Fork 136
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
Attempt to subtract with overflow #98
Comments
Hey, I am not able to recreate this. I ran this example on Optimism & was able to sync all amms from the v3 factory without any issues with a basic alchemy node. #[tokio::main]
async fn main() -> eyre::Result<()> {
//Add rpc endpoint here:
let rpc_endpoint = std::env::var("OPTIMISM_RPC_ENDPOINT")?;
let provider = Arc::new(Provider::<Http>::try_from(rpc_endpoint)?);
let factories = vec![
//Add UniswapV3
Factory::UniswapV3Factory(UniswapV3Factory::new(
H160::from_str("0x1F98431c8aD98523631AE4a59f267346ea31F984")?,
0,
)),
];
//Sync pairs
sync::sync_amms(factories, provider, None, 1000).await?;
Ok(())
} |
I will try that. Maybe the difference we are having here is that I am attempting to sync via specific pool addresses |
This is panicking use std::sync::Arc;
use amms::amm::uniswap_v3::UniswapV3Pool;
use common::utils::{crypto::Chain, wallet::get_provider};
use ethers::types::Address;
#[tokio::main]
async fn main() {
let provider = Arc::new(get_provider(&Chain::Optimism)); // this returns an alchemy optimism provider
let pool = UniswapV3Pool::new_from_address(
"0x03af20bdaaffb4cc0a521796a223f7d85e2aac31"
.parse::<Address>()
.unwrap(),
0,
provider.clone(),
)
.await
.unwrap();
} |
@0xOsiris Just did a sync from block 0 of the Uniswap V3 factory and I don't see that pool in the list. Is it skipping certain pools? |
Any updates on this? |
Hey apologies for the late response on this. I should have some time to investigate early this week |
Let me know if I can help. I am trying to get around it by syncing the pool state from subgraph. |
Cleaning up old issues and closing for now, we are introducing significant upgrades in the #235 for reference |
This issue is still apparent. Syncing from block 0 doesn't fix it :)
Context:
Chain: Optimism
TokenA: 0x4200000000000000000000000000000000000006
TokenB: 0xda10009cbd5d07dd0cecc66161fc93d7c9000da1
Attempting to sync all fee types (100/500/3000/10000).
thread 'tokio-runtime-worker' panicked at 'attempt to subtract with overflow', /Users/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/amms-0.6.1/src/amm/uniswap_v3/mod.rs:850:13
Originally posted by @1saf in #84 (comment)
The text was updated successfully, but these errors were encountered: