Skip to content

Commit

Permalink
remove handle_target_token_addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
NIXBNT committed May 7, 2024
1 parent 4fd4d65 commit 2d44843
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 43 deletions.
38 changes: 0 additions & 38 deletions fastlane_bot/events/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1753,44 +1753,6 @@ def verify_min_bnt_is_respected(bot: CarbonBot, mgr: Any):
"[events.utils.verify_min_bnt_is_respected] Bot successfully updated min profit"
)


def handle_target_token_addresses(static_pool_data: pd.DataFrame, target_tokens: List):
"""
Get the addresses of the target tokens.
Parameters
----------
static_pool_data : pd.DataFrame
The static pool data.
target_tokens : List
The target tokens.
Returns
-------
List
The addresses of the target tokens.
"""
# Get the addresses of the target tokens
target_token_addresses = []
if target_tokens:
for token in target_tokens:
target_token_addresses = (
target_token_addresses
+ static_pool_data[static_pool_data["tkn0_address"] == token][
"tkn0_address"
].tolist()
)
target_token_addresses = (
target_token_addresses
+ static_pool_data[static_pool_data["tkn1_address"] == token][
"tkn1_address"
].tolist()
)
target_token_addresses = list(set(target_token_addresses))
return target_token_addresses


def get_current_block(
last_block: int,
mgr: Any,
Expand Down
6 changes: 1 addition & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,6 @@ def main(args: argparse.Namespace) -> None:
cfg, exchanges, args.blockchain, args.static_pool_data_filename, args.read_only
)

target_token_addresses = handle_target_token_addresses(
static_pool_data, args.target_tokens
)

# Break if timeout is hit to test the bot flags
if args.timeout == 1:
cfg.logger.info("Timeout to test the bot flags")
Expand All @@ -286,7 +282,7 @@ def main(args: argparse.Namespace) -> None:
solidly_v2_event_mappings=solidly_v2_event_mappings,
tokens=tokens.to_dict(orient="records"),
replay_from_block=args.replay_from_block,
target_tokens=target_token_addresses,
target_tokens=args.target_tokens,
tenderly_fork_id=args.tenderly_fork_id,
tenderly_event_exchanges=tenderly_event_exchanges,
w3_tenderly=w3_tenderly,
Expand Down

0 comments on commit 2d44843

Please sign in to comment.