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

Fix state space and add individual pools synchronisation #142

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

cuongquangnam
Copy link

@cuongquangnam cuongquangnam commented Apr 1, 2024

Motivation

  • Fix some issues related to state space syncing
  • Add functions so as to allow state-space to be able to sync individual pools
    The idea is after this pr, we can do this:
       let v2_pool = UniswapV2Pool::new_from_address_and_block_number(
            address_v2.parse::<Address>().unwrap(),
            creation_block,
            Arc::new(evm_http_provider.clone()),
            curr_block_number,
        ).await.unwrap();

       let v3_pool = UniswapV3Pool::new_from_address_and_block_number(
            address_v3.parse::<Address>().unwrap(),
            creation_block,
            Arc::new(evm_http_provider.clone()),
            curr_block_number,
        )
        .await
        .unwrap();

       let state_space_manager: StateSpaceManager<Provider<Http>, Provider<Ws>> =
        StateSpaceManager::new(
           vec![AMM:UniswapV2Pool(v2_pool), AMM::UniswapV3Pool(v3_pool)],
            curr_block_number,
            100,
            100,
            Arc::new(evm_http_provider),
            Arc::new(evm_ws_provider),
        );

This removes the need to synchronise through AMMFactory

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant