I am in the process of developing a java client for the dydx protocol, and I bumped in a few things when creating orders. FYI, the crypto side of life is working well, onboarding is not an issue, nor signature of messages in general
First, the official documentation needs a little clarification on the limitFee field in the requests. When the value in the request is not set to a scale of 6, then this yields to a signature error:
{"market":"ETH-USD","side":"BUY","type":"LIMIT","postOnly":false,"size":"1","price":"1500","limitFee":0.0015,"expiration":"2023-08-28T19:54:12.656Z","timeInForce":"GTT","reduceOnly":false,"clientId":"09201745303854937266","signature":"07739f9c45d725ad5d646d91fc9d3c32897ab93546cded42673eb5cbe0459e3704f2f86935ce9587425239809a9e981ba5db305b579976120c77ed482dc3d36b"} -> {"errors":[{"msg":"Invalid signature for order"}]}
When I properly send it as "0.001500" it works ok
Secondly, I get a lot of "Unauthorized" responses, and I don't know why. What is wrong will the following requests/response pairs?
I presume that Unauthorized is a catch-all for anything which is ok in terms of signature, but that seems to fail other checks. I have put in strange prices/sizes because I saw a bunch of those on the testnet order book, so somehow it must be possible to send these, right?
I am in the process of developing a java client for the dydx protocol, and I bumped in a few things when creating orders. FYI, the crypto side of life is working well, onboarding is not an issue, nor signature of messages in general
First, the official documentation needs a little clarification on the limitFee field in the requests. When the value in the request is not set to a scale of 6, then this yields to a signature error:
{"market":"ETH-USD","side":"BUY","type":"LIMIT","postOnly":false,"size":"1","price":"1500","limitFee":0.0015,"expiration":"2023-08-28T19:54:12.656Z","timeInForce":"GTT","reduceOnly":false,"clientId":"09201745303854937266","signature":"07739f9c45d725ad5d646d91fc9d3c32897ab93546cded42673eb5cbe0459e3704f2f86935ce9587425239809a9e981ba5db305b579976120c77ed482dc3d36b"} -> {"errors":[{"msg":"Invalid signature for order"}]}
When I properly send it as "0.001500" it works ok
Secondly, I get a lot of "Unauthorized" responses, and I don't know why. What is wrong will the following requests/response pairs?
I presume that Unauthorized is a catch-all for anything which is ok in terms of signature, but that seems to fail other checks. I have put in strange prices/sizes because I saw a bunch of those on the testnet order book, so somehow it must be possible to send these, right?