Skip to content

Conversation

@Herklos
Copy link
Member

@Herklos Herklos commented Dec 19, 2025

No description provided.

@Herklos Herklos self-assigned this Dec 19, 2025
@Herklos Herklos force-pushed the feature/add-polymarket-tests branch 5 times, most recently from db11964 to f174701 Compare December 22, 2025 21:14
@Herklos Herklos marked this pull request as ready for review December 24, 2025 09:40
@Herklos Herklos force-pushed the feature/add-polymarket-tests branch 3 times, most recently from b8a32a2 to ce09cab Compare December 24, 2025 09:42
@Herklos
Copy link
Member Author

Herklos commented Dec 24, 2025

It's up

Copy link
Member

@GuillaumeDSM GuillaumeDSM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great!

OPEN_TIMEOUT = 15
# if >0: retry fetching open/cancelled orders when created/cancelled orders are not synchronised instantly
ORDER_IN_OPEN_AND_CANCELLED_ORDERS_TIMEOUT = 10
ORDER_IMPACTS_PORTFOLIO_FREE_BALANCE = True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

cancelled_orders = await self.get_cancelled_orders(exchange_data)
try:
cancelled_orders = await self.get_cancelled_orders(exchange_data)
except trading_errors.NotSupported as err:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be necessary when setting SUPPORT_FETCHING_CANCELLED_ORDERS=False in exchange test.
It will also enable to run test_get_cancelled_orders for this exchange (instead of passing), the test_get_cancelled_orders will then make sure that get_cancelled_orders is really raising this error

balance[locked_currency][trading_constants.CONFIG_PORTFOLIO_TOTAL], (
f"FALSE: {balance[locked_currency][trading_constants.CONFIG_PORTFOLIO_FREE]} < {balance[locked_currency][trading_constants.CONFIG_PORTFOLIO_TOTAL]}"
)
if self.ORDER_IMPACTS_PORTFOLIO_FREE_BALANCE:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a else to make sure the free balance is == to total balance when this is false ?
In these tests, it's better to always test those behaviors to avoid creating blind spots when conditions are skipped

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point

def check_created_limit_order(self, order, price, size, side):
self._check_order(order, size, side)
assert order.origin_price == price, f"{order.origin_price} != {price}"
if self.CONVERTS_ORDER_PRICE_BEFORE_PUSHING_TO_EXCHANGE:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Herklos Herklos force-pushed the feature/add-polymarket-tests branch from ce09cab to 9328a26 Compare December 25, 2025 22:31
@Herklos Herklos force-pushed the feature/add-polymarket-tests branch from 9328a26 to 4c1fc5c Compare December 25, 2025 22:34
@Herklos
Copy link
Member Author

Herklos commented Dec 25, 2025

It's up

# assert free portfolio amount equals total amount when orders don't impact free balance
balance = await self.get_portfolio()
locked_currency = settlement_currency if side == trading_enums.TradeOrderSide.BUY else self.ORDER_CURRENCY
assert balance[locked_currency][trading_constants.CONFIG_PORTFOLIO_FREE] == \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +109 to +110
# pass if not implemented
pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As fetching cancelled orders is not supported, we can run this test as well, it will make sure fetching cancelled orders raises "unsupported error" and will start failing if fetching cancelled orders becomes available in the ccxt lib

Copy link
Member Author

@Herklos Herklos Dec 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not able to run it as closed orders fetching is not available. It seems that the test requires at least canceled orders fetching or closed orders fetching to be supported.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok 👍

@Herklos Herklos merged commit 974370a into dev Dec 27, 2025
10 checks passed
@Herklos Herklos deleted the feature/add-polymarket-tests branch December 27, 2025 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants