I was calling post_market_order but got an ErrMarketUnavailable error.
I double checked the pair value, and it was correct, but after some digging it appeared that the Content Type of the request was 0.
I noticed that this code essentially hides any serialization errors with parameters.
I found my error by running
req = {
# with all my parameters
}
print(json.loads(json.dumps(req)))
This highlighted that I was passing in a Decimal (which can't be serialized).
So, two issues:
- ErrMarketUnavailable is sent back if you're not sending any data. Empty request (or something similar) would be a better response
- Parameters are emptied without warning, making it difficult for the coder to understand where the issue comes from.
See case 1775940