Skip to content

Commit

Permalink
Merge pull request #182 from bancorprotocol/181-bug-in-close-pool-script
Browse files Browse the repository at this point in the history
adds base_path to the get_static_data fn
  • Loading branch information
mikewcasale authored Oct 30, 2023
2 parents 2fcf2f2 + 88a005b commit ab4ae99
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions run_pool_shutdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,22 @@
help="The logging level.",
)
def main(
logging_path: str,
loglevel: str,
polling_interval: int,
config: str,
n_jobs: int,
flashloan_tokens: str = "ETH",
exchanges: str = "bancor_v3",
alchemy_max_block_fetch: int = 20,
static_pool_data_filename: str = "static_pool_data",
static_pool_data_sample_sz: str = "max",
limit_bancor3_flashloan_tokens: bool = False,
default_min_profit_bnt: int = 0,
timeout: int = 0,
target_tokens: str = None,
replay_from_block: int = None,
logging_path: str,
loglevel: str,
polling_interval: int,
config: str,
n_jobs: int,
flashloan_tokens: str = "ETH",
exchanges: str = "bancor_v3",
alchemy_max_block_fetch: int = 20,
static_pool_data_filename: str = "static_pool_data",
static_pool_data_sample_sz: str = "max",
limit_bancor3_flashloan_tokens: bool = False,
default_min_profit_bnt: int = 0,
timeout: int = 0,
target_tokens: str = None,
replay_from_block: int = None,
blockchain: str = "ethereum",
):
"""
The main entry point of the program. It sets up the configuration, initializes the web3 and Base objects,
Expand All @@ -96,6 +97,7 @@ def main(
replay_from_block (int): The block number to replay from. (For debugging / testing)
"""
base_path = f"fastlane_bot/data/blockchain_data/{blockchain}"

# Set config
loglevel = get_loglevel(loglevel)
Expand Down Expand Up @@ -154,8 +156,13 @@ def main(
)

# Get the static pool data, tokens and uniswap v2 event mappings
static_pool_data, tokens, uniswap_v2_event_mappings = get_static_data(
cfg, exchanges, static_pool_data_filename, static_pool_data_sample_sz
(
static_pool_data,
tokens,
uniswap_v2_event_mappings,
uniswap_v3_event_mappings,
) = get_static_data(
cfg, exchanges, static_pool_data_filename, static_pool_data_sample_sz, base_path
)

target_token_addresses = handle_target_token_addresses(
Expand All @@ -175,6 +182,7 @@ def main(
SUPPORTED_EXCHANGES=exchanges,
alchemy_max_block_fetch=alchemy_max_block_fetch,
uniswap_v2_event_mappings=uniswap_v2_event_mappings,
uniswap_v3_event_mappings=uniswap_v3_event_mappings,
tokens=tokens.to_dict(orient="records"),
replay_from_block=replay_from_block,
target_tokens=target_token_addresses,
Expand Down

0 comments on commit ab4ae99

Please sign in to comment.