Skip to content

Conversation

@O-Mutt
Copy link
Contributor

@O-Mutt O-Mutt commented Jan 23, 2024

No description provided.

Comment on lines 461 to 472
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"
};
Copy link
Contributor Author

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

payload["side"] = order.IsBuy ? BUY : "SELL";

Dictionary<string, object> orderConfig = new Dictionary<string, object>();
var amount = order.ShouldRoundAmount ? order.RoundAmount().ToStringInvariant() : order.Amount.ToStringInvariant();
Copy link
Contributor Author

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

Copy link
Contributor Author

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

@vslee vslee merged commit 6a21325 into DigitalRuby:main Jan 23, 2024
@O-Mutt O-Mutt deleted the CoinbaseError branch January 24, 2024 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants