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

(W)Gas token not in flashloan tokens can cause flashloan critical error for other flashloan tokens #592

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

Comments

@NIXBNT
Copy link
Collaborator

NIXBNT commented May 1, 2024

Bug Description

If the wrapped/gas token is not in the flashloan tokens the db Token object in the TradeInstruction object does not populate for it leading to this error:
fastlane-bot\fastlane_bot\helpers\tradeinstruction.py", line 145, in __post_init__ self._tknout_address = TokenOut.address ^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'address'

The reason is because when these Token objects are created in interface.py/populate_tokens() the flashloan token list is the gate-keeper:
image

Severity (High/Medium/Low)

Moderate - Likely to affect FLT/(W)Gas token pairs disproportionately but also critically

Steps to Reproduce

Requires an open arb to trigger the building of TradeInstruction objects
python main.py --blockchain=sei --backdate_pools=False --arb_mode=multi_pairwise_all --exchanges=carbon_v1 --randomizer=3 --flashloan_tokens=0x9e7A8e558Ce582511f4104465a886b7bEfBC146b --target_tokens=0x9e7A8e558Ce582511f4104465a886b7bEfBC146b,0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE,0x57eE725BEeB991c70c53f9642f36755EC6eb2139 --alchemy_max_block_fetch=100 --default_min_profit_gas_token=0.000001 --read_only=False --self_fund=False

Expected Behavior

Arbs using non-gas flts possible

Actual Behavior

Arbs using non-gas flts not possible

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

When branches are created from issues, their pull requests are automatically linked.

1 participant