Implement crypto.get_open_crypto_positions method#333
Open
mm0 wants to merge 1 commit into
Open
Conversation
There is currently no way to get only open crypto positions. Stocks have `robinhood.account.get_open_stock_positions()`, options have `robinhod.options.get_open_option_positions()`, however, `robinhood.crypto` only has method `get_crypto_positions()` which returns results without any quantity held.
DhruvaBansal00
added a commit
to DhruvaBansal00/robin_stocks
that referenced
this pull request
May 23, 2026
Upstream PR jmfernandes#333 (jmfernandes/robin_stocks). New SDK function that mirrors get_open_stock_positions / get_open_option_positions for crypto by filtering crypto_holdings with nonzero=true. Also exposes the function as an MCP tool (rh_get_open_crypto_positions) and adds a dispatch test. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
DhruvaBansal00
added a commit
to DhruvaBansal00/robin_stocks
that referenced
this pull request
May 23, 2026
DhruvaBansal00
added a commit
to DhruvaBansal00/robin_stocks
that referenced
this pull request
May 23, 2026
Adds a credential-free, fully-mocked test suite covering the changes landed across the 12 upstream-PR merges plus the surrounding SDK. New tests/sdk/ tree (mock-based, no network/credentials): - test_urls: every URL builder we touched (options, futures, recurring, tax-lots, marketdata-index) - test_helper / test_helper_requests: index routing, rate limiter + thread safety, request_get/post/delete/document branches, filter_data - test_authentication_robinhood / test_auth_verification: login JSON persistence (jmfernandes#1646), store_session=False fix (jmfernandes#1643), the device verification polling flow - test_authentication_tda: JSON + base64 + Fernet roundtrip, refresh branches - test_orders / test_order_wrappers / test_option_crypto_orders: market_hours coupling (jmfernandes#454), tax-lot payloads, every order wrapper - test_options_index_routing / test_options_remaining: index chain symbols (jmfernandes#541), find_options_by_* variants, historicals validation - test_stocks / test_stocks_index_routing: quote routing, historicals - test_crypto: open-positions nonzero filter (jmfernandes#333) - test_futures: full module coverage incl. pagination + P&L helpers - test_recurring_investments: create/update/cancel payloads + branches - test_account / test_markets / test_misc_modules: legacy sweeps New tests/mcp tests: - test_all_tools_dispatch: introspection-based generic dispatch test that verifies all 206 registered MCP tools forward to their SDK function (synthesizes args from each tool's signature) - test_remaining_tools: download + TDA-auth tools with bespoke returns Results: 801 passing, 1 skipped. Coverage: 100% on every MCP tool module and on the modules we authored (futures, recurring_investments, markets, tda/authentication); 92% overall across robinhood + MCP. Remaining gaps are legacy SDK paths untouched by these PRs. Also adds pytest-cov to the dev extra and ignores coverage artifacts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Thanks for this contribution! It's included with test coverage in the new repo, alongside 11 other open PRs from here. If you'd like a maintained build with this change, that's where to find it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is currently no way to get only open crypto positions.
Stocks have
robinhood.account.get_open_stock_positions()Options have
robinhod.options.get_open_option_positions(),However,
robinhood.cryptoonly has methodget_crypto_positions()which returns results without any quantity held.