Skip to content

Add Mintlify docs compatibility and fix trailing slashes#144

Closed
fengtality wants to merge 30 commits into
mainfrom
feature/docs-compatibility
Closed

Add Mintlify docs compatibility and fix trailing slashes#144
fengtality wants to merge 30 commits into
mainfrom
feature/docs-compatibility

Conversation

@fengtality

Copy link
Copy Markdown
Contributor

Summary

  • Add redirect_slashes=False to FastAPI app for Mintlify docs compatibility
  • Remove trailing slashes from route definitions across routers
  • Fix available_images endpoint returning 500 error

Test plan

  • Verify API routes work without trailing slashes
  • Test Mintlify docs integration
  • Verify available_images endpoint returns proper response

🤖 Generated with Claude Code

fengtality and others added 30 commits March 11, 2026 19:42
- Register SwapExecutor in EXECUTOR_REGISTRY
- Add swap_executor to available executor types

Requires: hummingbot/hummingbot#8117

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tokens are available immediately after adding - no Gateway restart needed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add get_bot_lp_history() method to BotsOrchestrator
- Add GET /{bot_name}/lphistory endpoint to bot_orchestration router
- Add "lphistory" to known MQTT command channels

Returns LP-specific data: position_address, order_action, fees collected,
price ranges, and amounts for AMM/CLMM strategies like Meteora.

Fixes #132

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add swap_executor to EXECUTOR_TYPES for single swaps via Gateway
- Add swap_executor example in CreateExecutorRequest
- Handle swap_executor using network instead of connector_name
- Make trading_pair optional for lp_executor (resolved from pool_address)
- Update lp_executor example with simplified config

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create GatewaySwap connector for router-type connectors (e.g., jupiter/router)
- Update executor_service to ensure swap connector is loaded before execution
- Add database access documentation for debugging executors

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains user-specific config and shouldn't be modified in the PR.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove wallet_address param from poll_transaction (Gateway PR #620)
- Handle new txStatus=-1 for failed transactions
- Use Gateway's parsed error messages (e.g., "SLIPPAGE_EXCEEDED (0x1771): ...")
- Fallback to meta.err if parsed error not available

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The executor_service validates that connector_name is required for swap_executor,
but the example in models/executors.py was missing it.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Consolidate swap_executor and lp_executor validation into single block
- Network is optional - uses connector's defaultNetwork if not provided
- Executor handles connector normalization in on_start

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add autoswap feature for automatic token swapping when balance insufficient
- Fix _initial_position_created flag to only set when position is active
- Add negative offset support for in-range positions
- Add swap_provider and swap_buffer_pct config options

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add INFO level logging to _handle_order_completed to trace:
- When the handler is called
- Whether the order was found in DB
- The status transition (old -> FILLED)

This helps debug why some orders stay in OPEN status after retries.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- connector_name is now network identifier (e.g., "solana-mainnet-beta")
- Added dex_name for DEX protocol (e.g., "meteora", "orca")
- Added trading_type for pool type (default "clmm")
- Updated SwapExecutorConfig creation to use new fields
- Updated LPExecutorConfig creation to include dex_name and trading_type
- Updated unified_connector_service to detect Gateway by checking AllConnectorSettings
- Updated executor examples in models/executors.py

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The GatewayHttpClient.get_price() method signature uses dex and trading_type
parameters, not connector. Parse pricing_connector into separate params.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update lp_rebalancer to use lp_provider field (format: "dex/trading_type")
- Add lp_provider validation in executor_service for lp_executor
- Update API example to use new lp_provider format

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Initialize market data provider rate sources when creating swap/lp executors
to ensure price lookups work correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
AccountTradingInterface doesn't have market_data_provider attribute.
Rate sources are initialized elsewhere when needed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove swap_executor from EXECUTOR_REGISTRY and validation
- Remove swap_executor from EXECUTOR_TYPES literal
- Remove swap_executor examples from API docs
- Update lp_rebalancer to use OrderExecutor for autoswap
- Sync with hummingbot changes that removed SwapExecutor

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
LPExecutorConfig already requires connector_name, pool_address, lp_provider
via Pydantic field definitions. No need to duplicate validation in API layer.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ging

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
API-managed LP executors already track performance in PostgreSQL database
via ExecutorRecord table with net_pnl_quote, net_pnl_pct, etc.
The lphistory endpoint was redundant as this data is stored locally.

- Remove /bot-orchestration/{bot_name}/lphistory endpoint
- Remove get_bot_lp_history method from BotsOrchestrator
- Remove lphistory from MQTT command channel handling
- Fix lint issues (trailing whitespace, unused variables)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Revert orders_recorder.py and mqtt_manager.py (lint-only changes)
- Simplify executor creation: use add_market if trading_pair exists,
  otherwise ensure_connector

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Simplify fee calculation - if primary method fails, just log error
and set fee to 0 instead of complex fallback logic.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Keep orders_recorder.py unchanged from main - no fixes needed for this PR.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Keep bots_orchestrator.py unchanged from main - no fixes needed for this PR.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
DEX providers (jupiter/router, uniswap/amm, etc.) are accessed via
Gateway networks, not as direct connectors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Mintlify docs playground strips trailing slashes from API paths,
causing 307 redirects that the playground doesn't follow.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Mintlify docs playground strips trailing slashes from API paths,
causing 307 redirects that the playground doesn't follow.

Changes:
- Add redirect_slashes=False to FastAPI app
- Remove trailing slashes from root routes in routers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The endpoint was iterating over Docker Image objects directly instead
of extracting their tags, causing JSON serialization to fail.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@fengtality fengtality force-pushed the feature/docs-compatibility branch from 7a144d5 to 7d0b524 Compare April 8, 2026 17:44
@fengtality fengtality closed this Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant