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

Input list of flashloan tokens is either ignored or used as a filter #680

Open
barakman opened this issue May 27, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@barakman
Copy link
Collaborator

barakman commented May 27, 2024

Bug Description

Suspected bug or improper product definition.

In the B3-Two-Hop arbitrage mode, the user's input list of flashloan tokens is either ignored or used as a filter:

  • When the user specifies --limit_bancor3_flashloan_tokens=true, the input list of flashloan tokens is filtered to include only bancor v3 tradable tokens.
  • When the user specifies --limit_bancor3_flashloan_tokens=false, the input list of flashloan tokens is completely ignored, and the list of all bancor v3 tradable tokens is used instead.

Severity

High

Steps to Reproduce

As you can see in base.py, self.flashloan_tokens is set as a list of some or all of the tokens in fltkns, which is by itself a list of all bancor v3 tradable tokens:

def _check_limit_flashloan_tokens_for_bancor3(self):
    """
    Limit the flashloan tokens for bancor v3.
    """
    fltkns = self.CCm.byparams(exchange="bancor_v3").tknys()
    if self.ConfigObj.LIMIT_BANCOR3_FLASHLOAN_TOKENS:
        # Filter out tokens that are not in the existing flashloan_tokens list
        self.flashloan_tokens = [
            tkn for tkn in fltkns if tkn in self.flashloan_tokens
        ]
        self.ConfigObj.logger.info(
            f"[modes.base._check_limit_flashloan_tokens_for_bancor3] limiting flashloan_tokens to {self.flashloan_tokens}"
        )
    else:
        self.flashloan_tokens = fltkns
@barakman barakman added the bug Something isn't working label May 27, 2024
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

4 participants