fix: initialize active order timestamps in api trading flows#143
Open
marcuspocus wants to merge 591 commits into
Open
fix: initialize active order timestamps in api trading flows#143marcuspocus wants to merge 591 commits into
marcuspocus wants to merge 591 commits into
Conversation
update environment to fix pandas issue
update environment.yml
…t_api_to_library (feat) adapt connector initialization
Feat/certs path
Adding multi_grid_strike.py so I can use it with hummingbot-mcp
feat / add multi_grid_strike controller
- matching PR for #7796
Resolved conflict in services/executor_service.py by keeping ExecutorLogCapture import
- Handle LP executor's market structure in executor_service (extracts connector_name/trading_pair from market object instead of direct fields) - Add LP executor example to CreateExecutorRequest schema - Add LP-specific types: LP_EXECUTOR_STATES, LP_EXECUTOR_SIDES, ConnectorPairConfig, LPExecutorConfigSchema, LPExecutorCustomInfo - Update router docstrings with LP executor configuration details - Update /types/available endpoint with better LP executor description Co-Authored-By: Claude Opus 4.5 <[email protected]>
Adds the LP Rebalancer controller for automated LP position management: - Uses total_amount_quote and side for position sizing - Implements KEEP vs REBALANCE logic based on price limits - Supports directional grids with sell/buy price ranges - Auto-rebalances when price moves out of range beyond threshold Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Update list_controllers to detect both single-file and package-style controllers - Update get_controller to read from both locations - Update create/update controller to write to existing package or create single file - Update delete controller to handle both file and folder deletion - Update load_controller_config_class to try both import paths - Fix lp_rebalancer __init__.py to use relative import - Remove stale lp_manager.py (replaced by lp_rebalancer) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Feat/update hummingbot
- Remove LP-specific types from models/executors.py (duplicates of hummingbot types) - Update LPExecutorConfig to use direct connector_name/trading_pair fields - Simplify executor_service.py by removing LP-specific handling - Sync lp_rebalancer controller with hummingbot version This aligns LP executor with the pattern used by position, grid, and DCA executors, making the API consistent across all executor types. Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add DEVELOPERS.md with detailed instructions for: - Building hummingbot wheel from custom branches - Building Linux wheels for Docker using containerized builds - Setting up development environment with custom wheels - Troubleshooting common issues (platform mismatch, Python version) - Add environment.docker.yml for Docker builds with local wheel - Add environment.yml.example as template for developers - Update Dockerfile to support custom wheel builds - Add *.whl to .gitignore for local development Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Revert Dockerfile to original (uses PyPI hummingbot) - Add Dockerfile.dev for development builds with custom wheel - Update DEVELOPERS.md to use Dockerfile.dev for custom builds This keeps the main CI/CD pipeline unchanged while enabling developers to test with custom hummingbot branches. Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add docker-compose.dev.yml that uses hummingbot-api:dev image - Update DEVELOPERS.md with simplified deployment instructions - Enables testing with custom hummingbot branches Tested: lp_executor now shows in available executor types when using development hummingbot wheel. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Document how to deploy bots using development hummingbot images instead of the default :latest tag. Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add gateway_proxy router (prefix: /gateway-proxy) that forwards requests to Gateway - Fix DELETE requests not forwarding body to Gateway - Keep executors router and lp_executor services from feat/lp-executor - Resolve all merge conflicts in main.py imports and router registration - Fix flake8: blank lines, unused imports, long lines
- Add GatewayLp support in unified_connector_service for gateway connectors (meteora/clmm, raydium/clmm, etc.) that aren't in AllConnectorSettings - Remove candles_config and markets from v2_with_controllers script config to fix compatibility with hummingbot:staging branch - Remove development Docker files (moved to separate workflow) - Fix f-strings without placeholders Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Test GatewayLp import, instantiation, and required methods - Test gateway detection logic in _create_trading_connector - Test script config fix (candles_config/markets removed) - Test LP executor type registration - Integration tests for API endpoints Verifies fixes for: - KeyError: 'meteora/clmm' issue - Staging deployment compatibility Co-Authored-By: Claude Opus 4.5 <[email protected]>
feat: add LP executor support
Closes hummingbot#133 - Prevents recurring "Invalid Ethereum address format" errors by skipping wallets with placeholder values like "ethereum-default-wallet" or "solana-default-wallet" during balance polling. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Added a function to pull the latest Hummingbot Docker image during setup.
Add function to pull Hummingbot Docker image
Co-Authored-By: Claude Opus 4.6 <[email protected]>
(feat) add controller id to executors
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.
Summary
Fix active order timestamp handling for API-managed connectors that are not running under a Hummingbot
Clock.This change does two things:
buy/sellcalls in the API trading flows/trading/orders/activetolerate non-finite timestamps if they still appear on an in-flight orderContext
While validating Hyperliquid perpetual testnet order placement through
hummingbot-api, the exchange-side order flow was working, but/trading/orders/activecould fail when it tried to serialize a freshly created in-flight order.The root cause is that API-managed connectors in this stack are not driven by a persistent Hummingbot
Clock. In that setup,connector.current_timestampcan still beNaNat order creation time. SinceExchangePyBase.start_tracking_order()copiesself.current_timestampinto the newInFlightOrder, the order may be tracked withcreation_timestamp = NaNandlast_update_timestamp = NaNuntil the first update arrives.That makes the active-orders serializer fragile because it attempts to convert those values to datetimes.
Changes
connector._set_current_timestamp(time.time())before delegating toconnector.buy()/connector.sell()in:services/accounts_service.pyservices/trading_service.pyAccountsService.place_trade(...)_standardize_in_flight_order_response()so non-finite timestamps are returned asNoneinstead of raising during serializationNaNValidation
Targeted tests:
/root/hummingbot-stack/.venv-pr/bin/python -m pytest -q test/test_order_timestamp_tracking.py test/test_trading_router.py6 passedManual validation against a local
hummingbot-apideployment:BUY LIMIT BTC-USDorder onhyperliquid_perpetual_testnet/trading/orders/activereturned200with the live order presentNotes
This PR stays narrow: