Open gabrielfior opened 2 years ago
I have the same issue. Any thoughts on how to fix it?
I have the same problem but not always. I'm not sure what is causing it. Here's my error's traceback:
562, in submit_order
res = self.client.private.create_order(
File "/opt/homebrew/lib/python3.9/site-packages/dydx3/modules/private.py", line 571, in create_order
order_signature = order_to_sign.sign(self.stark_private_key)
File "/opt/homebrew/lib/python3.9/site-packages/dydx3/starkex/signable.py", line 32, in sign
r, s = sign(self.hash, int(private_key_hex, 16))
File "/opt/homebrew/lib/python3.9/site-packages/dydx3/starkex/signable.py", line 27, in hash
self._hash = self._calculate_hash()
File "/opt/homebrew/lib/python3.9/site-packages/dydx3/starkex/order.py", line 168, in _calculate_hash
get_hash(
File "/opt/homebrew/lib/python3.9/site-packages/dydx3/starkex/starkex_resources/proxy.py", line 39, in get_hash
return py_pedersen_hash(*elements)
File "/opt/homebrew/lib/python3.9/site-packages/dydx3/starkex/starkex_resources/python_signature.py", line 251, in py_pedersen_hash
return pedersen_hash_as_point(*elements)[0]
File "/opt/homebrew/lib/python3.9/site-packages/dydx3/starkex/starkex_resources/python_signature.py", line 261, in pedersen_hash_as_point
assert 0 <= x < FIELD_PRIME
AssertionError
[UPDATE]: It works fine with buy/entry orders, but I get the error with sell/closing orders.
hi there. i had it and solved it. the problem is that when you sell, size should be positive, not negative, the ORDER_BUY_SIDE, ORDER_SELL_SIDE makes up for the signal in size. that is confusing at first, because when you get the account/openpositions/market data, selling side come as negative. so, don rely on negative sizes for expressing selling, only for interpreting them. best regards to all the community.
@greenfield-br god bless you! That was it
I tried to create an order using the dydx3 python package, but I receive an error with my signature. Using the UI the order creation process works fine.