Skip to content

Commit

Permalink
Merge branch 'main' into omnipool-cex-arbitrage
Browse files Browse the repository at this point in the history
  • Loading branch information
jepidoptera authored Oct 26, 2023
2 parents c8ec884 + 0033bfd commit 05d07cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions hydradx/model/amm/centralized_market.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ def pop(self, index=-1):

@property
def reversed(self):
# Return a new sorted list with the opposite order
return SortedList(self, not self.reverse)

def __getitem__(self, key):
if isinstance(key, slice):
# Return a new SortedList with the sliced items and the same reverse flag
return SortedList(super().__getitem__(key), self.reverse)
return super().__getitem__(key)

Expand Down
2 changes: 1 addition & 1 deletion hydradx/tests/test_centralized_market.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def test_buy_base(quantity: float, order_book: OrderBook):
if value_bought * (1 + initial_state.pools['Kraken'].trade_fee) != pytest.approx(quantity_sold):
raise AssertionError('Fee was not applied correctly.')


@given(
orderbook=order_book_strategy()
)
Expand Down

0 comments on commit 05d07cb

Please sign in to comment.