-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
chore: Adding better errors for coinbase order errors #826
Conversation
return new ExchangeOrderResult(){ | ||
Result = ExchangeAPIOrderResult.Rejected, | ||
IsBuy = payload["side"].ToStringInvariant().Equals(BUY), | ||
MarketSymbol = payload["product_id"].ToStringInvariant(), | ||
ClientOrderId = order.ClientOrderId, | ||
ResultCode = $"{token["error_response"]["error"].ToStringInvariant()} - {token["error_response"]["preview_failure_reason"].ToStringInvariant()}", | ||
AmountFilled = 0, | ||
Amount = order.Amount, | ||
AveragePrice = 0, | ||
Fees = 0, | ||
FeesCurrency = "USDT" | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include order details since the error handler uses .ToString()
on the ExchangeOrderResults and without details it is useless. Also token["error_response"]["error"]
seems insufficient in many cases so including token["error_response"]["preview_failure_reason"]
as well
@@ -396,24 +396,25 @@ protected override async Task<ExchangeOrderResult> OnPlaceOrderAsync(ExchangeOrd | |||
payload["side"] = order.IsBuy ? BUY : "SELL"; | |||
|
|||
Dictionary<string, object> orderConfig = new Dictionary<string, object>(); | |||
var amount = order.ShouldRoundAmount ? order.RoundAmount().ToStringInvariant() : order.Amount.ToStringInvariant(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We check the ShouldRound and then RoundAmount
if needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check happens already in order.RoundAmount
so i moved back to using the method instead of this variable check
No description provided.