-
Notifications
You must be signed in to change notification settings - Fork 1
Add Robinhood Crypto API integration with API key authentication using existing models #130
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Aymeric <[email protected]>
Co-authored-by: Aymeric <[email protected]>
|
@copilot The implementation should use the endpoint https://trading.robinhood.com as defined in the documentation at https://docs.robinhood.com/crypto/trading/ |
…ndpoint and implement IBrokerageService Co-authored-by: Aymeric <[email protected]>
Updated the implementation to address all three points:
All endpoint references throughout the service now use the correct Commit: 65763e5 |
Aymeric
left a comment
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.
@copilot this is all wrong. Undo everything and start from scratch.
- Implement a new IBrokerageService from https://docs.robinhood.com/crypto/trading/ with existing models.
- Wire up this new service in the login widget.
…using existing models Co-authored-by: Aymeric <[email protected]>
Reverted the previous implementation and started fresh:
The service implements the three crypto-specific methods:
All other methods throw Commit: 0841c54 |
|
@copilot Implement the authentication with a user-provided API key as documented in https://docs.robinhood.com/crypto/trading/#section/Authentication Make sure the API key is persisted with the BrokerageUser. |
Co-authored-by: Aymeric <[email protected]>
Implemented API key-based authentication as documented at https://docs.robinhood.com/crypto/trading/#section/Authentication:
The implementation follows the official Robinhood Crypto API authentication pattern where the API key is passed in request headers rather than using OAuth2. Commit: 7d88da1 |
|
Have concerns about how each user needs to generate key pair, configure the robinhood web site to get an api key and upload both to the app. |
Implements cryptocurrency trading support via Robinhood's official Crypto Trading API as a separate service from the existing stock/options trading infrastructure, reusing existing ForexHolding and ForexQuote models.
Architecture
New Service:
RobinhoodCryptoServicehttps://trading.robinhood.com)IBrokerageServiceinterface for seamless integration with Link Brokerage functionalityRobinhoodServicefor clear domain separationForexHoldingandForexQuotemodels for crypto positions and quotesBrokerage Integration:
BrokerageSource.robinhoodCryptoenum valueBrokerageUsermodel to support crypto service instantiationapiKeyfield toBrokerageUserfor API key persistenceAuthentication
API Key-Based Authentication:
BrokerageUser.apiKeyfield and persisted across sessionsAuthorization: Api-Key YOUR_API_KEYheader as per official documentationData Models
Reused Models:
ForexHolding- Used for crypto positions with cost basis tracking and calculated returnsForexQuote- Used for real-time crypto market data with bid/ask spreads, 24h high/low, volumeForexHistoricals- Used for historical crypto price data with 24/7 bounds supportNo new models or stores were created - the implementation leverages existing forex infrastructure for crypto data.
Implemented Methods
The service implements only crypto-relevant methods from
IBrokerageService:All non-crypto methods (stocks, options, fundamentals, etc.) throw
UnimplementedErrorwith helpful messages directing users to useRobinhoodServicefor those features.Login Widget Integration
Implementation Details
trading.robinhood.comendpoint for holdings, orders, and wallet operationsapi.robinhood.com/marketdataendpoint for quotes and historical dataOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.