QuantConnect / QuantConnect/Lean.Brokerages.Coinbase
Improve Error Handling for Account Permission
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5
- Forks
- 14
- Avg merge
- 9h 29m
- Merged PRs (30d)
- 2
Description
Expected Behavior
The user received a brokerage message informing that an order cannot be placed because of API permission.
Actual Behavior
The orders are market as invalid and there are no details.
Potential Solution
Send brokerage message on exception:
2024-01-24T23:57:00.6147462Z ERROR:: BrokerageTransactionHandler.HandleSubmitOrderRequest(): System.Exception: CoinbaseApiClient.ExecuteRequest failed: [403] Forbidden, Content: {"error":"PERMISSION_DENIED","error_details":"Target Account Not Tradable","message":"Target Account Not Tradable"}, ErrorMessage:
at QuantConnect.CoinbaseBrokerage.Api.CoinbaseApi.CreateOrder(Order leanOrder)
at QuantConnect.CoinbaseBrokerage.CoinbaseBrokerage.PlaceOrder(Order order)
Reproducing the Problem
Place order using an account with the trade permission.
Checklist
- I have completely filled out this template
- I have confirmed that this issue exists on the current
masterbranch - I have confirmed that this is not a duplicate issue by searching issues
- I have provided detailed steps to reproduce the issue
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at CoinbaseApi.CreateOrder and CoinbaseBrokerage.PlaceOrder, then trace how BrokerageTransactionHandler.HandleSubmitOrderRequest handles the shown 403 PERMISSION_DENIED response. Reproduce with an account lacking trade permission and verify that the brokerage message includes the permission error details instead of only marking the order invalid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100