fix arbitrage by filtering out sequence where the start/finish swap contract is the same (#325)

Co-authored-by: pintail <you@example.com>
This commit is contained in:
pintail-xyz 2023-01-17 23:34:33 +07:00 committed by GitHub
parent 0e42ab6ba4
commit 297afec364
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,6 +163,8 @@ def _get_all_start_end_swaps(swaps: List[Swap]) -> List[Tuple[Swap, List[Swap]]]
if ( if (
potential_start_swap.token_in_address potential_start_swap.token_in_address
== potential_end_swap.token_out_address == potential_end_swap.token_out_address
and potential_start_swap.contract_address
!= potential_end_swap.contract_address
and potential_start_swap.from_address == potential_end_swap.to_address and potential_start_swap.from_address == potential_end_swap.to_address
and not potential_start_swap.from_address in pool_addrs and not potential_start_swap.from_address in pool_addrs
): ):