skip start swap
This commit is contained in:
parent
be19c42275
commit
d2a1814774
@ -88,14 +88,14 @@ def _get_all_start_end_swaps(swaps: List[Swap]) -> List[Tuple[Swap, Swap]]:
|
||||
"""
|
||||
pool_addrs = [swap.contract_address for swap in swaps]
|
||||
valid_start_ends: List[Tuple[Swap, Swap]] = []
|
||||
for potential_start_swap in swaps:
|
||||
for potential_end_swap in swaps:
|
||||
for index, potential_start_swap in enumerate(swaps):
|
||||
remaining_swaps = swaps[:index] + swaps[index + 1 :]
|
||||
for potential_end_swap in remaining_swaps:
|
||||
if (
|
||||
potential_start_swap.token_in_address
|
||||
== potential_end_swap.token_out_address
|
||||
and potential_start_swap.from_address == potential_end_swap.to_address
|
||||
and not potential_start_swap.from_address in pool_addrs
|
||||
and potential_start_swap != potential_end_swap
|
||||
):
|
||||
valid_start_ends.append((potential_start_swap, potential_end_swap))
|
||||
return valid_start_ends
|
||||
|
Loading…
x
Reference in New Issue
Block a user