fix error nesting
This commit is contained in:
parent
55e1736a51
commit
2d0c7e2a16
@ -52,14 +52,13 @@ def _get_arbitrages_from_swaps(swaps: List[Swap]) -> List[Arbitrage]:
|
|||||||
]
|
]
|
||||||
routes = _get_all_routes(start, end, potential_intermediate_swaps)
|
routes = _get_all_routes(start, end, potential_intermediate_swaps)
|
||||||
|
|
||||||
error = None
|
|
||||||
|
|
||||||
for route in routes:
|
for route in routes:
|
||||||
start_amount = route[0].token_in_amount
|
start_amount = route[0].token_in_amount
|
||||||
end_amount = route[-1].token_out_amount
|
end_amount = route[-1].token_out_amount
|
||||||
profit_amount = end_amount - start_amount
|
profit_amount = end_amount - start_amount
|
||||||
|
|
||||||
for swap in route:
|
for swap in route:
|
||||||
|
error = None
|
||||||
if swap.error is not None:
|
if swap.error is not None:
|
||||||
error = swap.error
|
error = swap.error
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user