Skip to content

Commit

Permalink
Merge pull request #286 from bancorprotocol/281-add-test-coverage-arb…
Browse files Browse the repository at this point in the history
…-modes

281 add test coverage arb modes
  • Loading branch information
mikewcasale authored Jan 8, 2024
2 parents 2cd306b + 123c7ba commit 875a7b5
Show file tree
Hide file tree
Showing 13 changed files with 761 additions and 538 deletions.
3 changes: 0 additions & 3 deletions fastlane_bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
from .events.interface import QueryInterface
from .modes.pairwise_multi import FindArbitrageMultiPairwise
from .modes.pairwise_multi_all import FindArbitrageMultiPairwiseAll
from .modes.pairwise_multi_bal import FindArbitrageMultiPairwiseBalancer
from .modes.pairwise_multi_pol import FindArbitrageMultiPairwisePol
from .modes.pairwise_single import FindArbitrageSinglePairwise
from .modes.triangle_multi import ArbitrageFinderTriangleMulti
Expand Down Expand Up @@ -427,8 +426,6 @@ def _get_arb_finder(arb_mode: str) -> Callable:
return ArbitrageFinderTriangleBancor3TwoHop
elif arb_mode in {"multi_pairwise_pol"}:
return FindArbitrageMultiPairwisePol
elif arb_mode in {"multi_pairwise_bal"}:
return FindArbitrageMultiPairwiseBalancer
elif arb_mode in {"multi_pairwise_all"}:
return FindArbitrageMultiPairwiseAll

Expand Down
3 changes: 2 additions & 1 deletion fastlane_bot/modes/pairwise_multi_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def find_arbitrage(self, candidates: List[Any] = None, ops: Tuple = None, best_p
candidates = []

all_tokens, combos = self.get_combos(self.CCm, self.flashloan_tokens)

if self.result == self.AO_TOKENS:
return all_tokens, combos
#print(f"combos = {combos}")

candidates = []
Expand Down
211 changes: 0 additions & 211 deletions fastlane_bot/modes/pairwise_multi_bal.py

This file was deleted.

4 changes: 3 additions & 1 deletion fastlane_bot/modes/pairwise_multi_pol.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def find_arbitrage(self, candidates: List[Any] = None, ops: Tuple = None, best_p
"""

all_tokens, combos = self.get_combos_pol(self.CCm, self.flashloan_tokens)
if self.result == self.AO_TOKENS:
return all_tokens, combos

candidates = []
self.ConfigObj.logger.debug(
Expand Down Expand Up @@ -191,7 +193,7 @@ def get_combos_pol(self,
"""

bancor_pol_tkns = CCm.byparams(exchange="bancor_pol").tokens()
bancor_pol_tkns = [tkn for tkn in bancor_pol_tkns if tkn not in [T.ETH, T.WETH]]
bancor_pol_tkns = set([tkn for tkn in bancor_pol_tkns if tkn not in [T.ETH, T.WETH]])

combos = [
(tkn0, tkn1)
Expand Down
1 change: 0 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
"multi_triangle",
"b3_two_hop",
"multi_pairwise_pol",
"multi_pairwise_bal",
"multi_pairwise_all",
]
),
Expand Down
Loading

0 comments on commit 875a7b5

Please sign in to comment.