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

handle_target_token_addresses removes target tokens #626

Open
NIXBNT opened this issue May 7, 2024 · 0 comments
Open

handle_target_token_addresses removes target tokens #626

NIXBNT opened this issue May 7, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@NIXBNT
Copy link
Collaborator

NIXBNT commented May 7, 2024

Bug Description

handle_target_token_addresses unnecessarily iterates over static pool data and in the process creates a new target token list that no longer contains the native token address.
handle_target_token_addresses is a legacy method that was used to translate token-keys into token addresses. Since target_tokens are now specified as token addresses this process is both obsolete and incorrect since it can remove the native token address REQUIRED for example to fetch ETH containing strategies from Carbon (not just WETH).

Severity (High/Medium/Low)

  • Moderate. The user request is not adhered to resulting in data not collected for Carbon strats

Steps to Reproduce

python main.py --blockchain=ethereum --backdate_pools=False --arb_mode=multi_pairwise_all --loglevel=DEBUG --alchemy_max_block_fetch=100 --rpc_url=https://virtual.mainnet.rpc.tenderly.co/d4021c6b-d972-4ef7-8680-a055dfd935b9 --exchanges=carbon_v1,uniswap_v3 --flashloan_tokens=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 --target_tokens=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48,0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE,0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2

Actual Behavior

Zero strategies fetched

  • What currently happens
    2024-05-07 11:16:57,633 [fastlane:INFO] - Retrieved 313 carbon_v1 pairs from contract
    2024-05-07 11:16:57,634 [fastlane:DEBUG] - Retrieving carbon_v1 strategies from contract
    2024-05-07 11:16:58,303 [fastlane:DEBUG] - [events.managers.base] carbon_v1 is initialized True
    2024-05-07 11:16:58,303 [fastlane:DEBUG] - [events.managers.base] Retrieved 0 carbon_v1 strategies
    2024-05-07 11:16:58,303 [fastlane:DEBUG] - Fetched 0 carbon_v1 strategies in 6.899940252304077 seconds # ZERO STRATEGIES!

Expected Behavior

A subset of strategies fetched in the last step consistent with the target tokens

  • What should happen
    2024-05-07 11:39:12,884 [fastlane:INFO] - Retrieved 313 carbon_v1 pairs from contract
    2024-05-07 11:39:12,884 [fastlane:DEBUG] - Retrieving carbon_v1 strategies from contract
    2024-05-07 11:39:17,696 [fastlane:DEBUG] - [events.managers.base] carbon_v1 is initialized True
    2024-05-07 11:39:17,696 [fastlane:DEBUG] - [events.managers.base] Retrieved 1 carbon_v1 strategies
    2024-05-07 11:39:17,696 [fastlane:DEBUG] - Fetched 90 carbon_v1 strategies in 9.834237337112427 seconds

Impact Analysis (to be filled by contributors)

  • Automated Tests: Are there existing tests covering this? Do we need new tests?
  • Risks: Potential areas affected by this bug and its probable fix
  • Performance: Is this bug affecting performance?
  • Monitoring: Does this affect any current monitoring? Any new alerts needed?
  • Logging: Any changes required in logging?
  • Documentation: Updates needed in documentation?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants