Skip to content
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

[PY] [CLOB-895] Python short term order explicit TIF enum + examples #40

Merged
merged 3 commits into from
Sep 21, 2023

Conversation

jonfung-dydx
Copy link
Contributor

No description provided.

@@ -29,25 +29,26 @@ async def main() -> None:
subaccount = Subaccount(wallet, 0)
ordersParams = loadJson('human_readable_orders.json')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Basically reverted this file (composite_example_.py) to what it was before @lucas-dydx modified it with the short term example. There are two place_order calls though, let me know if one should be deleted.

Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC you can keep them both since it was originally like that

@jonfung-dydx jonfung-dydx requested a review from johnqh September 21, 2023 02:14
v4-client-py/examples/short_term_composite_example.py Outdated Show resolved Hide resolved

await asyncio.sleep(5) # wait for placeOrder to complete

def orderExecutionToTimeInForce(orderExecution: str) -> Order_TimeInForce:
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we define this in the client itself, rather than in the example? Maybe in v4-client-py/v4_client_py/clients/helpers/chain_helpers.py?

Also agree with @johnqh that these should probably just be enums, I don't think they should be strings since that makes things like refactors more difficult.

We can punt on this and create a ticket if it takes too much time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is just for parsing json in this example. should not be used anywhere else.

v4-client-py/v4_client_py/clients/helpers/chain_helpers.py Outdated Show resolved Hide resolved
v4-client-py/v4_client_py/clients/helpers/chain_helpers.py Outdated Show resolved Hide resolved
@@ -29,25 +29,26 @@ async def main() -> None:
subaccount = Subaccount(wallet, 0)
ordersParams = loadJson('human_readable_orders.json')
Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC you can keep them both since it was originally like that

@jonfung-dydx jonfung-dydx changed the title [CLOB-895] Python short term order explicit TIF enum + examples [PY] [CLOB-895] Python short term order explicit TIF enum + examples Sep 21, 2023
@jonfung-dydx jonfung-dydx merged commit fea7694 into main Sep 21, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants