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

Condition type unspecified for stop limit orders in Python v2 client #311

Open
taijane opened this issue Jan 8, 2025 · 1 comment
Open

Comments

@taijane
Copy link

taijane commented Jan 8, 2025

Hello,
after an update of the v4-dydx-py-v2 client I got an error creating stop limit orders because the condition type was no longer set correctly. This is the exact error messages returned after placing the order: "condition type cannot be unspecified: Conditional type is invalid".

After a bit of debugging I found out, that the error is due to the function calculate_condition_type(order_type: OrderType) in the chain_helpers.py file. The newest version returns an unspecified condition type for stop limit orders. I suggest to change the function back to the old version to return the condition type for stop losses like shown below.

elif order_type in [OrderType.STOP_LIMIT]: return Order.ConditionType.CONDITION_TYPE_STOP_LOSS

Copy link

linear bot commented Jan 8, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant