-
-
Notifications
You must be signed in to change notification settings - Fork 1k
[Tests] Add polymarket authenticated tests #3173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
db11964 to
f174701
Compare
b8a32a2 to
ce09cab
Compare
|
It's up |
GuillaumeDSM
left a comment
There was a problem hiding this 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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
ce09cab to
9328a26
Compare
9328a26 to
4c1fc5c
Compare
|
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] == \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| # pass if not implemented | ||
| pass |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok 👍
No description provided.