# API Reference Source: https://condor.hummingbot.org/api-reference Complete REST API reference for Hummingbot API ## What is Hummingbot API? **Hummingbot API** is a RESTful API server that provides programmatic access to [Hummingbot](https://hummingbot.org) exchange connectors and trading strategies. It is the execution layer under Condor, and it handles: * **Data collection**: standardized access to order books, candles, balances and positions across many exchanges * **Market access**: connectors to spot and perpetual exchanges, plus DEXs on Solana and EVM networks through [Gateway](/api-reference/gateway) * **Trade execution**: place orders, manage positions and track fills * **Bot management**: deploy and manage containerized bots for long-running strategies ## Base URL ```text theme={null} http://localhost:8000 ``` The API listens on `127.0.0.1` only by default, so it is reachable from the machine it runs on and nowhere else. To reach it from another machine, you have two options: * **Tailscale (recommended):** `make setup` asks whether to use Tailscale. See [Secure Remote Access with Tailscale](/getting-started/installing#secure-remote-access-with-tailscale). * **`API_BIND`:** set `API_BIND` in the API's `.env` to the address to publish port 8000 on, then run `make deploy` again. Prefer a specific interface, such as your Tailscale IP, over `0.0.0.0`. Anyone who reaches this API can move your funds. `API_BIND` applies to the Docker install (`make deploy`). For where every service binds, see [What binds where by default](/getting-started/installing#what-binds-where-by-default). ## Authentication Every REST endpoint except three requires HTTP Basic authentication: ```bash theme={null} curl -u YOUR_USERNAME:YOUR_PASSWORD http://localhost:8000/accounts/ ``` A missing or wrong username or password returns `401` with `{"detail": "Incorrect username or password"}`. These three paths need no credentials: | Path | What it returns | | - | - | | `/` | The API's name, version and status | | `/docs` | The API's own interactive Swagger UI | | `/openapi.json` | The OpenAPI spec this reference is generated from | The username and password are the `USERNAME` and `PASSWORD` that `make setup` asks for and writes to the API's `.env`. Condor keeps a copy for each server in its `config.yml` under `servers:`. > [!WARNING] > > If `USERNAME` and `PASSWORD` are not set, the API does not refuse to start. It falls back to `admin` / `admin` (and `CONFIG_PASSWORD` to `a`) and logs a `SECURITY WARNING`. Anyone who can reach the API can then log in. Always run `make setup`, or set all three values in `.env`, before you start the API. ### WebSocket authentication The API also streams data over two WebSocket endpoints. They are not in the OpenAPI spec, so they don't appear in the sidebar: | Endpoint | Streams | | - | - | | `ws://localhost:8000/ws/market-data` | Candles, order book snapshots and trades | | `ws://localhost:8000/ws/executors` | Executors, executor summary and logs, performance, positions and bot status | A WebSocket handshake authenticates in one of two ways. Without either, the server answers `401` and never opens the socket. * **`Authorization: Basic base64(username:password)`**: the same header the REST endpoints use. Use it from any client that can set headers. * **The `hummingbot-auth` subprotocol**: browsers can't set headers on a WebSocket, so send the credentials as the second subprotocol, encoded as base64url. The server echoes `hummingbot-auth` back. ```javascript theme={null} const token = btoa("YOUR_USERNAME:YOUR_PASSWORD") .replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""); const ws = new WebSocket("ws://localhost:8000/ws/executors", ["hummingbot-auth", token]); ``` The server never reads credentials from the query string. ## API Routers The tables below are a tour of the API's routers, with the endpoints you will reach for first. The sidebar has the complete reference for every endpoint, generated from the API's own OpenAPI spec. ### Accounts Manage trading accounts, exchange credentials and Gateway wallets. For the Workspace and Telegram flows, see [Exchange Credentials](/getting-started/credentials). | Endpoint | Method | Description | | - | - | - | | `/accounts/` | GET | List all account names | | `/accounts/{account_name}/credentials` | GET | List configured connectors for an account | | `/accounts/add-account` | POST | Create a new account | | `/accounts/delete-account` | POST | Delete an account | | `/accounts/add-credential/{account_name}/{connector_name}` | POST | Add exchange credentials | | `/accounts/delete-credential/{account_name}/{connector_name}` | POST | Remove exchange credentials | | `/accounts/gateway/wallets` | GET | List Gateway wallets | | `/accounts/gateway/add-wallet` | POST | Add a Gateway (DEX) wallet | | `/accounts/gateway/wallet/set-default` | POST | Set the default wallet for a chain | | `/accounts/gateway/{chain}/{address}` | DELETE | Remove a Gateway wallet | ### Portfolio Balances and portfolio analytics. | Endpoint | Method | Description | | - | - | - | | `/portfolio/state` | POST | Get balances across all accounts and connectors | | `/portfolio/history` | POST | Get historical portfolio states | | `/portfolio/distribution` | POST | Token distribution across accounts | | `/portfolio/accounts-distribution` | GET | Value distribution by account | ### Trading Place orders and manage positions. | Endpoint | Method | Description | | - | - | - | | `/trading/orders` | POST | Place a new order | | `/trading/orders/active` | POST | Get active orders | | `/trading/orders/search` | POST | Search order history | | `/trading/trades` | POST | Search trade fills | | `/trading/{account_name}/{connector_name}/orders/{client_order_id}/cancel` | POST | Cancel an order | | `/trading/positions` | POST | Get open perpetual positions | | `/trading/{account_name}/{connector_name}/leverage` | POST | Set leverage | | `/trading/{account_name}/{connector_name}/position-mode` | GET, POST | Get or set position mode | | `/trading/funding-payments` | POST | Get funding payment history | ### Connectors Exchange connector information and trading rules. | Endpoint | Method | Description | | - | - | - | | `/connectors/` | GET | List available connectors | | `/connectors/{connector_name}/config-map` | GET | Get required credential fields | | `/connectors/{connector_name}/trading-rules` | GET | Get trading rules for pairs | | `/connectors/{connector_name}/order-types` | GET | Get supported order types | ### Market Data Prices, candles, order books, tickers and conversion rates. | Endpoint | Method | Description | | - | - | - | | `/market-data/candles` | POST | Get real-time candles | | `/market-data/historical-candles` | POST | Get historical candles | | `/market-data/order-book` | POST | Get an order book snapshot | | `/market-data/prices` | POST | Get current prices | | `/market-data/tickers` | GET | Get 24h ticker stats | | `/market-data/funding-info` | POST | Get perpetual funding info | | `/market-data/rate/{trading_pair}` | GET | Get the conversion rate for a pair | | `/market-data/rates` | POST | Get conversion rates in bulk | | `/market-data/pool-prices` | GET | Get DEX pool prices | | `/market-data/settings` | GET | Read the server's market data settings (`MARKET_DATA_*`) | ### Executors Create and manage executors: self-contained trading operations such as an order, a position with stop loss and take profit, a grid or an LP position. See [Executors](/executors/overview). | Endpoint | Method | Description | | - | - | - | | `/executors/` | POST | Create a new executor | | `/executors/search` | POST | List and filter executors | | `/executors/{executor_id}` | GET | Get executor details | | `/executors/{executor_id}/stop` | POST | Stop an executor | | `/executors/{executor_id}/logs` | GET | Get executor logs | | `/executors/summary` | GET | Summary of active executors | | `/executors/performance` | GET | Aggregate executor performance | | `/executors/positions/summary` | GET | Summary of executor-held positions | | `/executors/types/available` | GET | List available executor types | | `/executors/types/{executor_type}/config` | GET | Get an executor type's config schema | ### Performance One interface for the performance of both bot controllers and executors. Pass `subject=controller` or `subject=executor`. | Endpoint | Method | Description | | - | - | - | | `/performance/latest` | GET | The latest performance row for each controller or executor | | `/performance/history` | GET | Performance over time, with optional `start_time` and `end_time` | ```bash theme={null} curl -u YOUR_USERNAME:YOUR_PASSWORD \ "http://localhost:8000/performance/latest?subject=executor&limit=10" ``` Filters belong to one subject. `bot_name` works only with `subject=controller`. `executor_id`, `executor_type`, `account_name`, `connector_name` and `trading_pair` work only with `subject=executor`. `controller_id` works with both. A filter sent with the wrong subject returns `400`. ### Bot Orchestration Deploy and manage containerized Hummingbot bots. | Endpoint | Method | Description | | - | - | - | | `/bot-orchestration/status` | GET | Get status of all bots | | `/bot-orchestration/deploy-v2-controllers` | POST | Deploy a bot running V2 controllers | | `/bot-orchestration/deploy-v2-script` | POST | Deploy a bot running a V2 script | | `/bot-orchestration/start-bot` | POST | Start a bot | | `/bot-orchestration/stop-bot` | POST | Stop a bot | | `/bot-orchestration/stop-and-archive-bot/{bot_name}` | POST | Stop a bot and archive its database | | `/bot-orchestration/{bot_name}/status` | GET | Get one bot's status | | `/bot-orchestration/bot-runs` | GET | List bot runs | | `/bot-orchestration/controller-performance-latest` | GET | Latest per-controller performance | | `/bot-orchestration/rate-oracle/config` | GET, PUT | Read or change the rate oracle, global token and rate-limit share that newly deployed bots use | | `/bot-orchestration/rate-oracle/sources` | GET | List the rate oracle sources a bot can use | ### Controllers V2 strategy controller management. | Endpoint | Method | Description | | - | - | - | | `/controllers/` | GET | List available controllers | | `/controllers/{controller_type}/{controller_name}` | GET, POST, DELETE | Read, save or delete a controller | | `/controllers/configs/` | GET | List controller configs | | `/controllers/configs/{config_name}` | GET, POST, DELETE | Read, save or delete a config | | `/controllers/{controller_type}/{controller_name}/config/template` | GET | Get a controller's config template | | `/controllers/{controller_type}/{controller_name}/config/validate` | POST | Validate a config against its controller | ### Scripts Script management. | Endpoint | Method | Description | | - | - | - | | `/scripts/` | GET | List available scripts | | `/scripts/{script_name}` | GET, POST, DELETE | Read, save or delete a script | | `/scripts/configs/` | GET | List script configs | | `/scripts/{script_name}/config/template` | GET | Get a script's config template | ### Gateway DEX infrastructure through Hummingbot Gateway: the Gateway container, its connectors, and per-network configuration (tokens and pools). See [Gateway](/api-reference/gateway). | Endpoint | Method | Description | | - | - | - | | `/gateway/status` | GET | Get Gateway status | | `/gateway/start` | POST | Start the Gateway container | | `/gateway/stop` | POST | Stop the Gateway container | | `/gateway/restart` | POST | Restart the Gateway container | | `/gateway/connectors` | GET | List Gateway connectors | | `/gateway/chains` | GET | List chains and their networks | | `/gateway/networks` | GET | List supported networks | | `/gateway/networks/{network_id}` | GET, POST | Read or update a network's config | | `/gateway/networks/{network_id}/tokens` | GET, POST | List or add tokens on a network | | `/gateway/networks/{network_id}/pools` | GET, POST | List or add pools on a network | | `/gateway/logs` | GET | Get Gateway logs | ### Gateway Swaps DEX token swaps. | Endpoint | Method | Description | | - | - | - | | `/gateway/swap/quote` | POST | Get a swap quote | | `/gateway/swap/execute` | POST | Execute a swap | | `/gateway/swap/execute-quote` | POST | Execute a previously fetched quote | | `/gateway/swaps/search` | POST | Search past swaps | | `/gateway/swaps/{transaction_hash}/status` | GET | Get a swap's transaction status | ### Gateway CLMM Concentrated-liquidity positions. To run a position with automatic monitoring and closing, use an [LP executor](/executors/lp-executor) instead. | Endpoint | Method | Description | | - | - | - | | `/gateway/clmm/pools` | GET | List pools (Meteora and Orca only) | | `/gateway/clmm/pool-info` | GET | Get one pool's live state | | `/gateway/clmm/quote-position` | POST | Quote a new position | | `/gateway/clmm/open` | POST | Open a new position | | `/gateway/clmm/add` | POST | Add liquidity to a position | | `/gateway/clmm/remove` | POST | Remove liquidity from a position | | `/gateway/clmm/close` | POST | Close a position | | `/gateway/clmm/collect-fees` | POST | Collect accumulated fees | | `/gateway/clmm/positions_owned` | POST | Get the LP positions a wallet owns | ### Gateway AMM Classic (full-range) AMM liquidity. | Endpoint | Method | Description | | - | - | - | | `/gateway/amm/pool-info` | GET | Get one pool's live state | | `/gateway/amm/quote-liquidity` | POST | Quote adding liquidity | | `/gateway/amm/add-liquidity` | POST | Add liquidity | | `/gateway/amm/remove-liquidity` | POST | Remove liquidity | | `/gateway/amm/positions-owned` | POST | Get AMM positions owned | ### Backtesting Strategy backtesting, synchronous or as background tasks. | Endpoint | Method | Description | | - | - | - | | `/backtesting/run` | POST | Run a backtest synchronously | | `/backtesting/tasks` | POST | Start a backtest as a background task | | `/backtesting/tasks` | GET | List backtest tasks | | `/backtesting/tasks/{task_id}` | GET | Get a task's status and results | | `/backtesting/tasks/{task_id}` | DELETE | Cancel or delete a task | ### Archived Bots Historical bot performance data. | Endpoint | Method | Description | | - | - | - | | `/archived-bots/` | GET | List archived bot databases | | `/archived-bots/{db_path}/summary` | GET | Summary of an archived run | | `/archived-bots/{db_path}/performance` | GET | Get historical performance | | `/archived-bots/{db_path}/trades` | GET | Trades from an archived run | | `/archived-bots/{db_path}` | DELETE | Delete an archived database | ### Docker Container lifecycle management. | Endpoint | Method | Description | | - | - | - | | `/docker/running` | GET | Check if Docker is running | | `/docker/active-containers` | GET | List active containers | | `/docker/available-images/` | GET | List available bot images | | `/docker/pull-image/` | POST | Pull an image | | `/docker/clean-exited-containers` | POST | Remove exited containers | ### Storage and System The API's disk usage, the host's resources, and the API's own version and upgrades. | Endpoint | Method | Description | | - | - | - | | `/storage/` | GET | Storage overview: databases, archives, disk usage | | `/system/resources` | GET | CPU, memory and disk for the API host | | `/system/info` | GET | API and Hummingbot versions, and how the API container was deployed | | `/system/upgrade/preflight` | GET | Whether the API can upgrade itself, and which executors and bots are running | | `/system/upgrade` | POST | Upgrade the API container to the published image | | `/system/upgrade/status` | GET | Status of the current or last upgrade | Condor's **Settings β†’ Hummingbot API** panel uses the `/system/*` endpoints for its Version and Upgrade cards. See [Settings](/webui/settings#hummingbot-api). ## Response Format **Success responses** return the requested data: ```json theme={null} ["master_account"] ``` **Error responses** include a `detail` field: ```json theme={null} { "detail": "Incorrect username or password" } ``` ## Trying endpoints The easiest place to try requests is the API's own Swagger UI at `http://localhost:8000/docs`, on the machine that runs the API. Click **Authorize** and enter your username and password. Each endpoint page in this reference also has a playground. It sends requests straight from your browser to the server URL, `http://localhost:8000` by default. The API accepts browser requests only from pages served on `localhost` or `127.0.0.1`, so it rejects the playground on this site (a CORS error). A local preview of these docs (`npx mint@latest dev`, on `localhost:3000`) is allowed. To let this site's playground through, add its origin to the API's `.env` as a JSON list, then run `make deploy` again: ```bash theme={null} CORS_ALLOW_ORIGINS='["https://condor.hummingbot.org"]' ``` Only add origins you trust. Any page on an allowed origin can call your API from your browser. `CORS_ALLOW_ORIGIN_REGEX` holds the default `localhost` rule; set it to an empty string to turn that rule off. ## Resources > [card] [Condor GitHub](https://github.com/hummingbot/condor) > > Condor source code > [card] [API GitHub](https://github.com/hummingbot/hummingbot-api) > > Hummingbot API source code > [card] [Discord](https://discord.gg/hummingbot) > > Community support > [card] [Give Feedback](https://forms.gle/7NpG3RtgfLrmpUNY8) > > 2-minute survey that shapes the roadmap # Add Account Source: https://condor.hummingbot.org/api-reference/accounts/add-account /api-reference/openapi.json post /accounts/add-account Create a new account with default configuration files. Args: account_name: Name of the new account to create Returns: Success message when account is created Raises: HTTPException: 400 if account already exists or the account name is invalid # Add Credential Source: https://condor.hummingbot.org/api-reference/accounts/add-credential /api-reference/openapi.json post /accounts/add-credential/{account_name}/{connector_name} Add or update connector credentials (API keys) for a specific account and connector. Args: account_name: Name of the account connector_name: Name of the connector credentials: Dictionary containing the connector credentials Returns: Success message when credentials are added Raises: HTTPException: 400 if there's an error adding the credentials # Add Gateway Wallet Source: https://condor.hummingbot.org/api-reference/accounts/add-gateway-wallet /api-reference/openapi.json post /accounts/gateway/add-wallet Add an existing wallet to Gateway using its private key. Gateway handles encryption and storage internally. Args: wallet_credential: Wallet credentials (chain, private_key, and optional set_default) Returns: Wallet information from Gateway including address Raises: HTTPException: 503 if Gateway unavailable, 400 on validation error # Delete Account Source: https://condor.hummingbot.org/api-reference/accounts/delete-account /api-reference/openapi.json post /accounts/delete-account Delete an account and all its associated credentials. Args: account_name: Name of the account to delete Returns: Success message when account is deleted Raises: HTTPException: 400 if trying to delete master account or the account name is invalid, 404 if account not found # Delete Credential Source: https://condor.hummingbot.org/api-reference/accounts/delete-credential /api-reference/openapi.json post /accounts/delete-credential/{account_name}/{connector_name} Delete a specific connector credential for an account. Args: account_name: Name of the account connector_name: Name of the connector to delete credentials for Returns: Success message when credential is deleted Raises: HTTPException: 404 if credential not found # List Account Credentials Source: https://condor.hummingbot.org/api-reference/accounts/list-account-credentials /api-reference/openapi.json get /accounts/{account_name}/credentials Get a list of all connectors that have credentials configured for a specific account. Args: account_name: Name of the account to list credentials for Returns: List of connector names that have credentials configured Raises: HTTPException: 404 if account not found # List Accounts Source: https://condor.hummingbot.org/api-reference/accounts/list-accounts /api-reference/openapi.json get /accounts/ Get a list of all account names in the system. Returns: List of account names # List Gateway Wallets Source: https://condor.hummingbot.org/api-reference/accounts/list-gateway-wallets /api-reference/openapi.json get /accounts/gateway/wallets List all wallets managed by Gateway. Gateway manages its own encrypted wallet storage. Returns: List of wallet information from Gateway Raises: HTTPException: 503 if Gateway unavailable # Remove Gateway Wallet Source: https://condor.hummingbot.org/api-reference/accounts/remove-gateway-wallet /api-reference/openapi.json delete /accounts/gateway/{chain}/{address} Remove a wallet from Gateway. Args: chain: Blockchain chain (e.g., 'solana', 'ethereum') address: Wallet address to remove Returns: Success message Raises: HTTPException: 503 if Gateway unavailable # Set Default Gateway Wallet Source: https://condor.hummingbot.org/api-reference/accounts/set-default-gateway-wallet /api-reference/openapi.json post /accounts/gateway/wallet/set-default Set the default wallet for a chain in Gateway. When multiple wallets are configured for a chain, this endpoint allows switching which wallet is used as the default for operations. Args: request: Contains chain and wallet address to set as default Returns: Dict with success status and updated wallet info. Example: POST /accounts/gateway/wallet/set-default { "chain": "solana", "address": "82SggYRE2Vo4jN4a2pk3aQ4SET4ctafZJGbowmCqyHx5" } # Architecture Source: https://condor.hummingbot.org/api-reference/architecture How Hummingbot API connects Condor to exchanges, DEXs and bots Hummingbot API is a FastAPI server that gives programmatic access to the Hummingbot trading framework. It is the execution layer under Condor: Condor's Workspace, Telegram bot and trading agents all act through it. ## System Architecture ```mermaid theme={null} flowchart TB subgraph Clients["Clients"] C[Condor] MCP[Hummingbot MCP server] end subgraph Server["Hummingbot API host"] API[Hummingbot API] PG[(PostgreSQL)] MQ[EMQX broker] GW[Gateway container] BOTS[Bot containers] end Clients -->|REST + WebSocket| API API --> PG API <--> MQ MQ <--> BOTS API -->|starts, mTLS| GW BOTS -->|mTLS| GW API --> CEX[Exchange APIs] GW --> RPC[Blockchain RPCs] ``` Condor never talks to Gateway directly. Every DEX action goes through the Hummingbot API. ## Components ### Clients | Component | Description | | - | - | | **Condor** | Workspace, Telegram bot and LLM trading agents. Agents call the API through Condor's own MCP tools. | | **Hummingbot MCP server** | A separate [MCP server](https://hummingbot.org/mcp/) that lets AI assistants such as Claude, Gemini and ChatGPT call the API. | ### Server | Component | Description | | - | - | | **Hummingbot API** | The REST and WebSocket server. It loads the Hummingbot library in-process for exchange connectors, market data and [executors](/executors/overview). | | **PostgreSQL** | Stores account and token balances, orders, trades, positions, funding payments, bot runs, executors, performance snapshots and Gateway swap and LP history. | | **EMQX** | MQTT broker. Bot containers report status and performance to the API through it. | | **Bot containers** | One Docker container per deployed bot, running the `hummingbot/hummingbot` image. The API creates and starts them. | | **Gateway** | DEX middleware, run as a Docker container that the API starts and manages. See [Gateway](#gateway) below. | ## How It Works 1. **Clients** (Condor, the MCP server, your own scripts) send requests to the Hummingbot API. 2. **CEX trading and market data** run inside the API, through the Hummingbot library's exchange connectors. 3. **Executors** also run inside the API, with no bot container needed. 4. **Bots** run in their own containers and report back over EMQX. 5. **DEX trading** goes from the API to Gateway, which signs transactions and sends them to blockchain RPCs. ## Gateway Gateway is not part of the API's Docker Compose stack. The API starts it on request: * **Workspace:** **Settings β†’ Gateway β†’ Deploy Gateway**. See [Settings](/webui/settings#gateway). * **Telegram:** `/gateway` β†’ **πŸš€ Deploy Gateway**. * **API:** `POST /gateway/start`. The default image is `hummingbot/gateway:development` on port `15888`. Gateway always runs with TLS and mutual TLS (mTLS): the API, and every bot it deploys, presents a client certificate. The API generates the certificates and uses your `CONFIG_PASSWORD` as Gateway's passphrase, so there is nothing extra to enter. When the API runs in Docker (`make deploy`), Gateway's port is published on `127.0.0.1` only, and the API reaches it by container name at `https://gateway:15888`. When the API runs from source on Linux, Gateway uses host networking. ## Deployment ### Docker (recommended) ```bash theme={null} git clone https://github.com/hummingbot/hummingbot-api cd hummingbot-api make setup # asks for your API username, password and config password; writes .env make deploy # starts the API, PostgreSQL and EMQX in Docker ``` `make setup` also asks whether to use Tailscale for remote access. The API listens on `127.0.0.1:8000`. To change that, see [Base URL](/api-reference#base-url). ### From source Running from source needs Conda. ```bash theme={null} make install # creates the hummingbot-api Conda environment, then runs make setup make run # starts PostgreSQL and EMQX in Docker, then the API with auto-reload ``` Run `make doctor` to check dependencies, `.env`, containers, port exposure and API access. Run `make stop` to stop the Docker services. For installing Condor and the API together, see [Install Condor](/getting-started/installing). ## Data Flow ```mermaid theme={null} sequenceDiagram participant User as Condor / AI agent participant API as Hummingbot API participant CEX as Exchange User->>API: POST /trading/orders API->>CEX: Place order (Hummingbot connector, in-process) CEX-->>API: Order confirmation API-->>User: Response ``` ## Learn More > [card] [Hummingbot](/api-reference/hummingbot) > > The core trading framework > [card] [Gateway](/api-reference/gateway) > > DEX middleware for decentralized trading # Delete Archived Bot Source: https://condor.hummingbot.org/api-reference/archived-bots/delete-archived-bot /api-reference/openapi.json delete /archived-bots/{db_path} Delete an archived bot and its entire directory. Also attempts to delete matching BotRun records from PostgreSQL (best-effort). Args: db_path: Path to the database file (as returned by list_databases) Returns: Confirmation message with the deleted bot name and count of cleaned PG records # Get Database Controllers Source: https://condor.hummingbot.org/api-reference/archived-bots/get-database-controllers /api-reference/openapi.json get /archived-bots/{db_path}/controllers Get controller data from a database. Args: db_path: Full path to the database file Returns: List of controllers that were running with their configurations # Get Database Executors Source: https://condor.hummingbot.org/api-reference/archived-bots/get-database-executors /api-reference/openapi.json get /archived-bots/{db_path}/executors Get executor data from a database. Args: db_path: Full path to the database file Returns: List of executors with their configurations and results # Get Database Orders Source: https://condor.hummingbot.org/api-reference/archived-bots/get-database-orders /api-reference/openapi.json get /archived-bots/{db_path}/orders Get order history from a database. Args: db_path: Full path to the database file limit: Maximum number of orders to return offset: Offset for pagination status: Optional status filter Returns: List of orders with pagination info # Get Database Performance Source: https://condor.hummingbot.org/api-reference/archived-bots/get-database-performance /api-reference/openapi.json get /archived-bots/{db_path}/performance Get trade-based performance analysis for a bot database. Args: db_path: Full path to the database file Returns: Trade-based performance metrics with rolling calculations # Get Database Positions Source: https://condor.hummingbot.org/api-reference/archived-bots/get-database-positions /api-reference/openapi.json get /archived-bots/{db_path}/positions Get position data from a database. Args: db_path: Full path to the database file limit: Maximum number of positions to return offset: Offset for pagination Returns: List of positions with pagination info # Get Database Status Source: https://condor.hummingbot.org/api-reference/archived-bots/get-database-status /api-reference/openapi.json get /archived-bots/{db_path}/status Get status information for a specific database. Args: db_path: Path to the database file Returns: Database status including table health # Get Database Summary Source: https://condor.hummingbot.org/api-reference/archived-bots/get-database-summary /api-reference/openapi.json get /archived-bots/{db_path}/summary Get a summary of database contents including basic statistics. Args: db_path: Full path to the database file Returns: Summary statistics of the database contents # Get Database Trades Source: https://condor.hummingbot.org/api-reference/archived-bots/get-database-trades /api-reference/openapi.json get /archived-bots/{db_path}/trades Get trade history from a database. Args: db_path: Full path to the database file limit: Maximum number of trades to return offset: Offset for pagination Returns: List of trades with pagination info # List Databases Source: https://condor.hummingbot.org/api-reference/archived-bots/list-databases /api-reference/openapi.json get /archived-bots/ List all available database files in the system. Returns: List of database file paths # Create Backtest Task Source: https://condor.hummingbot.org/api-reference/backtesting/create-backtest-task /api-reference/openapi.json post /backtesting/tasks Submit a backtest as a background task. Returns task ID for polling. # Delete Backtest Task Source: https://condor.hummingbot.org/api-reference/backtesting/delete-backtest-task /api-reference/openapi.json delete /backtesting/tasks/{task_id} Cancel a running task or remove a completed one. # Get Backtest Task Source: https://condor.hummingbot.org/api-reference/backtesting/get-backtest-task /api-reference/openapi.json get /backtesting/tasks/{task_id} Get a backtest task by ID, including results if completed. # List Backtest Tasks Source: https://condor.hummingbot.org/api-reference/backtesting/list-backtest-tasks /api-reference/openapi.json get /backtesting/tasks List all backtest tasks with their status (results excluded for brevity). # Run Backtesting Source: https://condor.hummingbot.org/api-reference/backtesting/run-backtesting /api-reference/openapi.json post /backtesting/run Run a backtest synchronously. Returns results directly (may timeout for long backtests). # Delete Bot Run Source: https://condor.hummingbot.org/api-reference/bot-orchestration/delete-bot-run /api-reference/openapi.json delete /bot-orchestration/bot-runs/{bot_run_id} Delete a bot run record by ID. Args: bot_run_id: ID of the bot run to delete bots_manager: Bot orchestrator service dependency Returns: Confirmation of deletion Raises: HTTPException: 404 if bot run not found # Deploy V2 Controllers Source: https://condor.hummingbot.org/api-reference/bot-orchestration/deploy-v2-controllers /api-reference/openapi.json post /bot-orchestration/deploy-v2-controllers Deploy a V2 strategy with controllers by generating the script config and creating the instance. This endpoint simplifies the deployment process for V2 controller strategies. Args: deployment: V2ControllerDeployment configuration docker_manager: Docker service dependency Returns: Dictionary with deployment response and generated configuration details Raises: HTTPException: 500 if deployment fails # Deploy V2 Script Source: https://condor.hummingbot.org/api-reference/bot-orchestration/deploy-v2-script /api-reference/openapi.json post /bot-orchestration/deploy-v2-script Deploy a V2 script bot with optional script configuration. This endpoint creates and starts a Hummingbot instance running the specified script. Args: deployment: V2ScriptDeployment configuration containing instance name, credentials, optional script name and configuration docker_manager: Docker service dependency db_manager: Database manager dependency Returns: Dictionary with deployment response including instance details Raises: HTTPException: 500 if deployment fails # Get Active Bots Status Source: https://condor.hummingbot.org/api-reference/bot-orchestration/get-active-bots-status /api-reference/openapi.json get /bot-orchestration/status Get the status of all active bots. Args: bots_manager: Bot orchestrator service dependency Returns: Dictionary with status and data containing all active bot statuses # Get Bot History Source: https://condor.hummingbot.org/api-reference/bot-orchestration/get-bot-history /api-reference/openapi.json get /bot-orchestration/{bot_name}/history Get trading history for a bot with optional parameters. Args: bot_name: Name of the bot to get history for days: Number of days of history to retrieve (0 for all) verbose: Whether to include verbose output precision: Decimal precision for numerical values timeout: Timeout in seconds for the operation bots_manager: Bot orchestrator service dependency Returns: Dictionary with bot trading history # Get Bot Rate Oracle Config Source: https://condor.hummingbot.org/api-reference/bot-orchestration/get-bot-rate-oracle-config /api-reference/openapi.json get /bot-orchestration/rate-oracle/config Get the client defaults that bots deployed with this credentials profile will use. Args: account_name: Credentials profile whose conf_client.yml to read (default master_account) # Get Bot Rate Oracle Sources Source: https://condor.hummingbot.org/api-reference/bot-orchestration/get-bot-rate-oracle-sources /api-reference/openapi.json get /bot-orchestration/rate-oracle/sources List the rate oracle sources a bot can be configured with. Does not affect the API's own pricing. # Get Bot Run By Id Source: https://condor.hummingbot.org/api-reference/bot-orchestration/get-bot-run-by-id /api-reference/openapi.json get /bot-orchestration/bot-runs/{bot_run_id} Get a specific bot run by ID. Args: bot_run_id: ID of the bot run bots_manager: Bot orchestrator service dependency Returns: Bot run details Raises: HTTPException: 404 if bot run not found # Get Bot Run Stats Source: https://condor.hummingbot.org/api-reference/bot-orchestration/get-bot-run-stats /api-reference/openapi.json get /bot-orchestration/bot-runs/stats Get statistics about bot runs. Args: bots_manager: Bot orchestrator service dependency Returns: Bot run statistics # Get Bot Runs Source: https://condor.hummingbot.org/api-reference/bot-orchestration/get-bot-runs /api-reference/openapi.json get /bot-orchestration/bot-runs Get bot runs with optional filtering. Args: bot_name: Filter by bot name account_name: Filter by account name strategy_type: Filter by strategy type (script or controller) strategy_name: Filter by strategy name run_status: Filter by run status (CREATED, RUNNING, STOPPED, ERROR) deployment_status: Filter by deployment status (DEPLOYED, FAILED, ARCHIVED) limit: Maximum number of results to return offset: Number of results to skip include_final_status: Include the final status snapshot for each run. Off by default because the blob can be ~89 KB per record (~99% of the payload); use GET /bot-runs/{bot_run_id} to fetch it for a single run. bots_manager: Bot orchestrator service dependency Returns: List of bot runs with their details # Get Bot Status Source: https://condor.hummingbot.org/api-reference/bot-orchestration/get-bot-status /api-reference/openapi.json get /bot-orchestration/{bot_name}/status Get the status of a specific bot. Args: bot_name: Name of the bot to get status for bots_manager: Bot orchestrator service dependency Returns: Dictionary with bot status information Raises: HTTPException: 404 if bot not found # Get Controller Performance History Source: https://condor.hummingbot.org/api-reference/bot-orchestration/get-controller-performance-history /api-reference/openapi.json get /bot-orchestration/controller-performance-history Get historical controller performance snapshots with pagination and interval sampling. # Get Latest Controller Performance Source: https://condor.hummingbot.org/api-reference/bot-orchestration/get-latest-controller-performance /api-reference/openapi.json get /bot-orchestration/controller-performance-latest Get the most recent performance snapshot for each bot/controller. Optionally filter by bot_name. # Get Mqtt Status Source: https://condor.hummingbot.org/api-reference/bot-orchestration/get-mqtt-status /api-reference/openapi.json get /bot-orchestration/mqtt Get MQTT connection status and discovered bots. Args: bots_manager: Bot orchestrator service dependency Returns: Dictionary with MQTT connection status, discovered bots, and broker information # Start Bot Source: https://condor.hummingbot.org/api-reference/bot-orchestration/start-bot /api-reference/openapi.json post /bot-orchestration/start-bot Start a bot with the specified configuration. Args: action: StartBotAction containing bot configuration parameters bots_manager: Bot orchestrator service dependency Returns: Dictionary with status and response from bot start operation # Stop And Archive Bot Source: https://condor.hummingbot.org/api-reference/bot-orchestration/stop-and-archive-bot /api-reference/openapi.json post /bot-orchestration/stop-and-archive-bot/{bot_name} Gracefully stop a bot and archive its data in the background. This initiates a background task that will: 1. Stop the bot trading process via MQTT 2. Wait 15 seconds for graceful shutdown 3. Monitor and stop the Docker container 4. Archive the bot data (locally or to S3) 5. Remove the container Returns immediately with a success message while the process continues in the background. # Stop Bot Source: https://condor.hummingbot.org/api-reference/bot-orchestration/stop-bot /api-reference/openapi.json post /bot-orchestration/stop-bot Stop a bot with the specified configuration. Args: action: StopBotAction containing bot stop parameters bots_manager: Bot orchestrator service dependency Returns: Dictionary with status and response from bot stop operation # Update Bot Rate Oracle Config Source: https://condor.hummingbot.org/api-reference/bot-orchestration/update-bot-rate-oracle-config /api-reference/openapi.json put /bot-orchestration/rate-oracle/config Update the bot rate oracle source, global token and/or rate-limit share in an account's conf_client.yml. Bots pick the change up on their next deploy (running bots keep their copied config). Changing master_account's global token also switches the API's own valuation quote token. Args: update_request: Configuration updates to apply account_name: Credentials profile whose conf_client.yml to update (default master_account) # Available Connectors Source: https://condor.hummingbot.org/api-reference/connectors/available-connectors /api-reference/openapi.json get /connectors/ Get a list of all available connectors. Returns: List of connector names supported by the system (excludes DEX providers which use Gateway networks) # Get Connector Config Map Source: https://condor.hummingbot.org/api-reference/connectors/get-connector-config-map /api-reference/openapi.json get /connectors/{connector_name}/config-map Get configuration fields required for a specific connector with type information. Args: connector_name: Name of the connector to get config map for Returns: Dictionary mapping field names to their type information. Each field contains: - type: The expected data type (e.g., "str", "SecretStr", "int") - required: Whether the field is required - allowed_values: List of accepted values (only for Literal fields) - prompt: Human readable prompt from the Hummingbot config map (when defined) # Get Supported Order Types Source: https://condor.hummingbot.org/api-reference/connectors/get-supported-order-types /api-reference/openapi.json get /connectors/{connector_name}/order-types Get order types supported by a specific connector. This endpoint uses the MarketDataService to access non-trading connector instances, which means no authentication or account setup is required. Args: request: FastAPI request object connector_name: Name of the connector (e.g., 'binance', 'binance_perpetual') Returns: List of supported order types (LIMIT, MARKET, LIMIT_MAKER) Raises: HTTPException: 404 if connector not found, 500 for other errors # Get Trading Rules Source: https://condor.hummingbot.org/api-reference/connectors/get-trading-rules /api-reference/openapi.json get /connectors/{connector_name}/trading-rules Get trading rules for a connector, optionally filtered by trading pairs. This endpoint uses the MarketDataService to access non-trading connector instances, which means no authentication or account setup is required. Args: request: FastAPI request object connector_name: Name of the connector (e.g., 'binance', 'binance_perpetual') trading_pairs: Optional list of trading pairs to filter by (e.g., ['BTC-USDT', 'ETH-USDT']) Returns: Dictionary mapping trading pairs to their trading rules Raises: HTTPException: 404 if connector not found, 500 for other errors # Create Or Update Controller Source: https://condor.hummingbot.org/api-reference/controllers/create-or-update-controller /api-reference/openapi.json post /controllers/{controller_type}/{controller_name} Create or update a controller. If controller exists as a package (folder), updates the file inside. Otherwise creates/updates as a single file. Args: controller_type: Type of controller to create/update controller_name: Name of the controller (from URL path) controller: Controller object with content (and optional type for validation) Returns: Success message when controller is saved Raises: HTTPException: 400 if controller type mismatch or save error # Create Or Update Controller Config Source: https://condor.hummingbot.org/api-reference/controllers/create-or-update-controller-config /api-reference/openapi.json post /controllers/configs/{config_name} Create or update controller configuration. Args: config_name: Name of the configuration file config: Configuration dictionary to save Returns: Success message when configuration is saved Raises: HTTPException: 400 if save error occurs # Delete Controller Source: https://condor.hummingbot.org/api-reference/controllers/delete-controller /api-reference/openapi.json delete /controllers/{controller_type}/{controller_name} Delete a controller. Handles both single-file and package-style controllers. Args: controller_type: Type of the controller controller_name: Name of the controller to delete Returns: Success message when controller is deleted Raises: HTTPException: 404 if controller not found # Delete Controller Config Source: https://condor.hummingbot.org/api-reference/controllers/delete-controller-config /api-reference/openapi.json delete /controllers/configs/{config_name} Delete controller configuration. Args: config_name: Name of the configuration file to delete Returns: Success message when configuration is deleted Raises: HTTPException: 404 if configuration not found # Get Bot Controller Configs Source: https://condor.hummingbot.org/api-reference/controllers/get-bot-controller-configs /api-reference/openapi.json get /controllers/bots/{bot_name}/configs Get all controller configurations for a specific bot. Args: bot_name: Name of the bot to get configurations for Returns: List of controller configurations for the bot Raises: HTTPException: 404 if bot not found # Get Controller Source: https://condor.hummingbot.org/api-reference/controllers/get-controller /api-reference/openapi.json get /controllers/{controller_type}/{controller_name} Get controller content by type and name. Supports both single-file controllers (controller.py) and package-style controllers (controller/controller.py). Args: controller_type: Type of the controller controller_name: Name of the controller Returns: Dictionary with controller name, type, and content Raises: HTTPException: 404 if controller not found # Get Controller Config Source: https://condor.hummingbot.org/api-reference/controllers/get-controller-config /api-reference/openapi.json get /controllers/configs/{config_name} Get controller configuration by config name. Args: config_name: Name of the configuration file to retrieve Returns: Dictionary with controller configuration Raises: HTTPException: 404 if configuration not found # Get Controller Config Template Source: https://condor.hummingbot.org/api-reference/controllers/get-controller-config-template /api-reference/openapi.json get /controllers/{controller_type}/{controller_name}/config/template Get controller configuration template with default values. Args: controller_type: Type of the controller controller_name: Name of the controller Returns: Dictionary with configuration template and default values Raises: HTTPException: 404 if controller configuration class not found # List Controller Configs Source: https://condor.hummingbot.org/api-reference/controllers/list-controller-configs /api-reference/openapi.json get /controllers/configs/ List all controller configurations with metadata. Returns: List of controller configuration objects with name, controller_name, controller_type, and other metadata # List Controllers Source: https://condor.hummingbot.org/api-reference/controllers/list-controllers /api-reference/openapi.json get /controllers/ List all controllers organized by type. Detects both single-file controllers (controller.py) and package-style controllers (controller/controller.py). Returns: Dictionary mapping controller types to lists of controller names # Update Bot Controller Config Source: https://condor.hummingbot.org/api-reference/controllers/update-bot-controller-config /api-reference/openapi.json post /controllers/bots/{bot_name}/{controller_name}/config Update controller configuration for a specific bot. Args: bot_name: Name of the bot controller_name: Name of the controller to update config: Configuration dictionary to update with Returns: Success message when configuration is updated Raises: HTTPException: 404 if bot or controller not found, 400 if update error # Validate Controller Config Source: https://condor.hummingbot.org/api-reference/controllers/validate-controller-config /api-reference/openapi.json post /controllers/{controller_type}/{controller_name}/config/validate Validate controller configuration against the controller's config class. Args: controller_type: Type of the controller controller_name: Name of the controller config: Configuration dictionary to validate Returns: Success message if configuration is valid Raises: HTTPException: 400 if validation fails # Active Containers Source: https://condor.hummingbot.org/api-reference/docker/active-containers /api-reference/openapi.json get /docker/active-containers Get all currently active (running) Docker containers. Args: name_filter: Optional filter to match container names (case-insensitive) docker_service: Docker service dependency Returns: List of active container information Raises: HTTPException: 502 if the Docker daemon refused or could not be reached # Available Images Source: https://condor.hummingbot.org/api-reference/docker/available-images /api-reference/openapi.json get /docker/available-images/ Get available Docker images matching the specified name. Args: image_name: Name pattern to search for in image tags docker_service: Docker service dependency Returns: Dictionary with list of available image tags Raises: HTTPException: 502 if the Docker daemon refused or could not be reached # Clean Exited Containers Source: https://condor.hummingbot.org/api-reference/docker/clean-exited-containers /api-reference/openapi.json post /docker/clean-exited-containers Remove all exited Docker containers to free up space. Args: docker_service: Docker service dependency Returns: {"success": true, "message": ...} once the exited containers are pruned Raises: HTTPException: 502 if the Docker daemon refused or could not be reached # Exited Containers Source: https://condor.hummingbot.org/api-reference/docker/exited-containers /api-reference/openapi.json get /docker/exited-containers Get all exited (stopped) Docker containers. Args: name_filter: Optional filter to match container names (case-insensitive) docker_service: Docker service dependency Returns: List of exited container information Raises: HTTPException: 502 if the Docker daemon refused or could not be reached # Get Pull Status Source: https://condor.hummingbot.org/api-reference/docker/get-pull-status /api-reference/openapi.json get /docker/pull-status/ Get status of all pull operations. Args: docker_service: Docker service dependency Returns: Dictionary with all pull operations and their statuses # Is Docker Running Source: https://condor.hummingbot.org/api-reference/docker/is-docker-running /api-reference/openapi.json get /docker/running Check if Docker daemon is running. Args: docker_service: Docker service dependency Returns: Dictionary indicating if Docker is running # Pull Image Source: https://condor.hummingbot.org/api-reference/docker/pull-image /api-reference/openapi.json post /docker/pull-image/ Initiate Docker image pull as background task. Returns immediately with task status for monitoring. Args: image: DockerImage object containing the image name to pull docker_service: Docker service dependency Returns: Status of the pull operation initiation # Remove Container Source: https://condor.hummingbot.org/api-reference/docker/remove-container /api-reference/openapi.json post /docker/remove-container/{container_name} Remove a bot container created by this API and archive its bot data. NOTE: This endpoint only works with containers this API manages. A bot container is named after its instance verbatim, and owns the bots/instances/ directory that this endpoint archives; an unrelated container on the host has no such directory and is refused. Args: container_name: Name of the bot container to remove archive_locally: Whether to archive data locally (default: True) s3_bucket: S3 bucket name for cloud archiving (optional) docker_service: Docker service dependency bot_archiver: Bot archiver service dependency Returns: Response from container removal operation Raises: HTTPException: 400 if the container is not a bot managed by this API HTTPException: 500 if archiving fails # Start Container Source: https://condor.hummingbot.org/api-reference/docker/start-container /api-reference/openapi.json post /docker/start-container/{container_name} Start a stopped Docker container. Args: container_name: Name of the container to start docker_service: Docker service dependency Returns: {"success": true, "message": ...} once the container is started Raises: HTTPException: 404 if no container by that name exists HTTPException: 502 if the Docker daemon refused or could not be reached # Stop Container Source: https://condor.hummingbot.org/api-reference/docker/stop-container /api-reference/openapi.json post /docker/stop-container/{container_name} Stop a running Docker container. Args: container_name: Name of the container to stop docker_service: Docker service dependency Returns: {"success": true, "message": ...} once the container is stopped Raises: HTTPException: 404 if no container by that name exists HTTPException: 502 if the Docker daemon refused or could not be reached # Clear Position Held Source: https://condor.hummingbot.org/api-reference/executors/clear-position-held /api-reference/openapi.json delete /executors/positions/{connector_name}/{trading_pair} Clear a held position (after manual close or full exit). This removes the position from tracking but preserves historical data in completed executors. Query parameters: - **controller_id**: Controller ID (default "main") # Create Executor Source: https://condor.hummingbot.org/api-reference/executors/create-executor /api-reference/openapi.json post /executors/ Create and start a new executor. Supported executor types: - **position_executor**: Single position with triple barrier (stop loss, take profit, time limit) - **grid_executor**: Grid trading with multiple levels - **dca_executor**: Dollar-cost averaging with multiple entry points - **twap_executor**: Time-weighted average price execution - **arbitrage_executor**: Cross-exchange arbitrage - **xemm_executor**: Cross-exchange market making - **order_executor**: Simple order execution - **lp_executor**: Liquidity provider position on CLMM DEXs (Meteora, Raydium, etc.) The `executor_config` must include: - `type`: One of the executor types above - `connector_name`: Exchange connector (e.g., "binance", "binance_perpetual") - `trading_pair`: Trading pair (e.g., "BTC-USDT") - Additional type-specific configuration (see /executors/types/{type}/config for details) Returns the created executor ID and initial status. # Get Available Executor Types Source: https://condor.hummingbot.org/api-reference/executors/get-available-executor-types /api-reference/openapi.json get /executors/types/available Get list of available executor types with descriptions. Returns information about each supported executor type. # Get Executor Source: https://condor.hummingbot.org/api-reference/executors/get-executor /api-reference/openapi.json get /executors/{executor_id} Get detailed information about a specific executor. Checks active executors in memory first, then falls back to database for completed executors. Returns full executor information including: - Current status and PnL - Full configuration - Executor-specific custom information # Get Executor Config Schema Source: https://condor.hummingbot.org/api-reference/executors/get-executor-config-schema /api-reference/openapi.json get /executors/types/{executor_type}/config Get configuration schema for a specific executor type. Returns detailed information about each configuration field including: - **name**: Field name - **type**: Data type (str, int, Decimal, enum, etc.) - **description**: Field description - **required**: Whether the field is required - **default**: Default value if any - **constraints**: Validation constraints (min, max, pattern, etc.) - **enum_values**: Possible values for enum types Also returns nested type definitions for complex fields. # Get Executor Logs Source: https://condor.hummingbot.org/api-reference/executors/get-executor-logs /api-reference/openapi.json get /executors/{executor_id}/logs Get captured log entries for a specific executor. Returns log entries from the in-memory ring buffer. Only available for active executors - logs are cleared when the executor completes. Query parameters: - **level**: Filter by log level (ERROR, WARNING, INFO, DEBUG) - **limit**: Maximum entries to return (default 50) # Get Executors Summary Source: https://condor.hummingbot.org/api-reference/executors/get-executors-summary /api-reference/openapi.json get /executors/summary Get summary statistics for all executors. Returns aggregate information including: - Total active/completed executor counts - Total PnL and volume - Breakdown by executor type, connector, and status # Get Orphaned Positions Source: https://condor.hummingbot.org/api-reference/executors/get-orphaned-positions /api-reference/openapi.json get /executors/positions/orphaned List terminated executors that may still own an on-chain position. Covers three orphan classes: - Involuntary holds: close_type POSITION_HOLD with hold_reason set (an LP close that exhausted its retries): the position is live on-chain with no automated owner. - Legacy FAILED records whose final state still reported a position_address (force-stop stragglers, records persisted by older executors). - Executors terminated by SYSTEM_CLEANUP after an API restart: their on-chain state was never persisted, so they need external reconciliation. This is a DB-side listing. Before recovering, cross-check candidates against on-chain reality via the gateway positions-owned endpoints (/trading/clmm/positions-owned, /trading/amm/positions-owned). # Get Performance Report Source: https://condor.hummingbot.org/api-reference/executors/get-performance-report /api-reference/openapi.json get /executors/performance Get a performance report for executors. Aggregates metrics from all completed executors (optionally filtered by controller_id): - Realized PnL (from completed executors, excluding POSITION_HOLD close type) - Unrealized PnL (from active executors + position holds) - Global PnL (realized + unrealized) - Fees and volume totals - Win rate and Sharpe ratio - Breakdown by executor type - Active position count Query parameters: - **controller_id**: Filter by controller ID (omit for all controllers) # Get Position Held Source: https://condor.hummingbot.org/api-reference/executors/get-position-held /api-reference/openapi.json get /executors/positions/{connector_name}/{trading_pair} Get held position for a specific connector/trading pair. Returns the aggregated position from executors stopped with keep_position=True, including breakeven prices, matched/unmatched volume, realized PnL, and unrealized PnL. Query parameters: - **controller_id**: Controller ID (default "main") # Get Positions Summary Source: https://condor.hummingbot.org/api-reference/executors/get-positions-summary /api-reference/openapi.json get /executors/positions/summary Get summary of all held positions from executors stopped with keep_position=True. Returns aggregate information including: - Total number of active position holds - Total realized PnL across all positions - Total unrealized PnL (when market rates are available) - List of all positions with breakeven prices and PnL Query parameters: - **controller_id**: Filter positions by controller ID # List Executors Source: https://condor.hummingbot.org/api-reference/executors/list-executors /api-reference/openapi.json post /executors/search Get list of executors with optional filtering. Returns active executors from memory combined with completed executors from database. Filters: - `account_names`: Filter by specific accounts - `connector_names`: Filter by connectors - `trading_pairs`: Filter by trading pairs - `executor_types`: Filter by executor types - `status`: Filter by status (RUNNING, TERMINATED, etc.) Returns paginated list of executor summaries. # Resolve Orphaned Position Source: https://condor.hummingbot.org/api-reference/executors/resolve-orphaned-position /api-reference/openapi.json post /executors/{executor_id}/resolve-orphan Mark an orphaned position as recovered. Call after the stranded on-chain position has been closed (or adopted) externally. Removes the executor from /executors/positions/orphaned and from agent-facing orphan warnings. Only valid for terminated executors that are orphan candidates: an involuntary hold (POSITION_HOLD with hold_reason or the orphaned_position flag), FAILED, or SYSTEM_CLEANUP. # Stop Executor Source: https://condor.hummingbot.org/api-reference/executors/stop-executor /api-reference/openapi.json post /executors/{executor_id}/stop Stop an active executor. Options: - `keep_position`: If true, keeps any open position (for position executors). If false, the executor will attempt to close all positions before stopping. Returns confirmation of the stop action. # Gateway Source: https://condor.hummingbot.org/api-reference/gateway DEX middleware for decentralized exchange trading **Gateway** is DEX middleware that lets Hummingbot API trade on decentralized exchanges. It gives one interface for swapping tokens and providing liquidity across Solana and EVM chains. ## What is Gateway? Gateway is a separate service that: * Connects to blockchain RPCs * Stores wallet keys and signs transactions * Provides one API across different DEX protocols * Submits transactions and tracks their status The Hummingbot API starts Gateway as a Docker container and talks to it over mutual TLS. Condor never talks to Gateway directly: every DEX action goes through the API. See [Architecture](/api-reference/architecture#gateway). ```mermaid theme={null} flowchart LR API[Hummingbot API] -->|mTLS| GW[Gateway] GW --> SOL[Solana RPC] GW --> EVM[EVM RPCs] SOL --> JUP[Jupiter, Meteora, Raydium, Orca, ...] EVM --> UNI[Uniswap, PancakeSwap, 0x] ``` ## Supported Connectors These are the connectors in the `hummingbot/gateway:development` image. Your server's own list is at `GET /gateway/connectors`. | Connector | Chain | Router (swaps) | AMM | CLMM | Networks | | - | - | :-: | :-: | :-: | - | | `jupiter` | Solana | βœ… | | | mainnet-beta, devnet | | `titan` | Solana | βœ… | | | mainnet-beta | | `dflow` | Solana | βœ… | | | mainnet-beta | | `okx` (OKX DEX) | Solana | βœ… | | | mainnet-beta | | `meteora` | Solana | | βœ… | βœ… | mainnet-beta, devnet | | `raydium` | Solana | | βœ… | βœ… | mainnet-beta, devnet | | `orca` | Solana | | | βœ… | mainnet-beta, devnet | | `pancakeswap-sol` | Solana | | | βœ… | mainnet-beta, devnet | | `uniswap` | EVM | βœ… | βœ… | βœ… | mainnet, arbitrum, avalanche, base, bsc, celo, optimism, polygon, robinhoodchain, unichain | | `pancakeswap` | EVM | βœ… | βœ… | βœ… | mainnet, arbitrum, base, bsc | | `0x` | EVM | βœ… | | | mainnet, arbitrum, avalanche, base, bsc, optimism, polygon | * **Router** connectors find a swap route across many pools. * **AMM** pools spread liquidity over the full price range. * **CLMM** (concentrated liquidity) pools let you choose a price range. ## Supported Chains Gateway groups networks under two chains. A network ID is `chain-network`, for example `solana-mainnet-beta` or `ethereum-bsc`. | Chain | Networks | | - | - | | `ethereum` (EVM) | `mainnet`, `arbitrum`, `avalanche`, `base`, `bsc`, `celo`, `optimism`, `polygon`, `robinhoodchain`, `unichain`, and the testnets `sepolia` and `robinhoodchain-testnet` | | `solana` | `mainnet-beta`, and the testnet `devnet` | `GET /gateway/networks` lists every network ID on your server. ## Setup ### 1. Start Gateway Gateway doesn't start with the API. Start it once from any of these: * **Workspace:** **Settings β†’ Gateway β†’ Deploy Gateway**. See [Settings](/webui/settings#gateway). * **Telegram:** `/gateway` β†’ **πŸš€ Deploy Gateway**. * **API:** `POST /gateway/start`. The body can be empty (`{}`). It defaults to the image `hummingbot/gateway:development` on port `15888`. Gateway always runs with TLS and mutual TLS. The API creates the certificates and uses your API's `CONFIG_PASSWORD` as Gateway's passphrase, so you don't enter one. When the API runs in Docker, Gateway's port is published on `127.0.0.1` only. ### 2. Add a wallet Gateway signs transactions with a wallet stored on your server. Use a wallet that holds only what you're prepared to trade with. * **Workspace:** **Settings β†’ Keys and Wallets β†’ Add Wallet**. See [Add a Gateway wallet](/getting-started/credentials#add-a-gateway-wallet). * **Telegram:** `/gateway` β†’ **πŸ”‘ Wallets** β†’ **βž• Add Wallet**, pick the chain, then send the private key. * **API:** ```bash theme={null} curl -u YOUR_USERNAME:YOUR_PASSWORD -X POST http://localhost:8000/accounts/gateway/add-wallet \ -H "Content-Type: application/json" \ -d '{ "chain": "solana", "private_key": "YOUR_PRIVATE_KEY" }' ``` `set_default` is optional and defaults to `true`: the new wallet becomes the default for its chain. ### 3. Configure networks Each network has its own settings, such as its RPC endpoint (`node_url`) and default swap provider: ```bash theme={null} # List network IDs curl -u YOUR_USERNAME:YOUR_PASSWORD http://localhost:8000/gateway/networks # Read one network's settings curl -u YOUR_USERNAME:YOUR_PASSWORD http://localhost:8000/gateway/networks/solana-mainnet-beta ``` A `POST` to the same path updates them. Tokens and pools have their own subpaths: `/gateway/networks/{network_id}/tokens` and `/gateway/networks/{network_id}/pools`. In the Workspace, the same settings are under **Settings β†’ Gateway β†’ Networks & RPC**. ### 4. Check it's running ```bash theme={null} curl -u YOUR_USERNAME:YOUR_PASSWORD http://localhost:8000/gateway/status ``` ```json theme={null} { "running": true, "container_id": "3ce264fe002e...", "image": "hummingbot/gateway:development", "created_at": "2026-10-14T13:34:37.799199064Z", "port": 15888 } ``` ## Using Gateway through the API ### Swaps Get a quote with `POST /gateway/swap/quote`: ```bash theme={null} curl -u YOUR_USERNAME:YOUR_PASSWORD -X POST http://localhost:8000/gateway/swap/quote \ -H "Content-Type: application/json" \ -d '{ "connector": "jupiter", "network": "solana-mainnet-beta", "trading_pair": "SOL-USDC", "side": "SELL", "amount": 1.0 }' ``` * `amount` is always in the base token. For `SELL` it is the amount to sell; for `BUY` it is the amount to receive. * `connector` is a router name (`jupiter`), or a typed name such as `raydium/amm` or `meteora/clmm` to swap through one pool type. `POST /gateway/swap/execute` takes the same fields and sends the swap. It also takes optional `slippage_pct` and `wallet_address`. Without `wallet_address`, it uses the chain's default wallet. Past swaps are searchable with `POST /gateway/swaps/search`, and a transaction's status is at `GET /gateway/swaps/{transaction_hash}/status`. ### Liquidity positions The `/gateway/clmm` endpoints take the **bare connector name**, such as `raydium`, `meteora` or `orca`. For example, `pool-info` answers `400` to `connector=raydium/clmm`. ```bash theme={null} # List pools. Pool listing supports meteora and orca only. curl -u YOUR_USERNAME:YOUR_PASSWORD \ "http://localhost:8000/gateway/clmm/pools?connector=meteora&search_term=SOL&limit=5" # Get one pool's live state (any CLMM connector) curl -u YOUR_USERNAME:YOUR_PASSWORD \ "http://localhost:8000/gateway/clmm/pool-info?connector=raydium&network=solana-mainnet-beta&pool_address=POOL_ADDRESS" ``` To open a position, use `POST /gateway/clmm/open`. `/gateway/clmm/add`, `/remove`, `/collect-fees` and `/close` act on an existing position by its `position_address`. Full-range AMM liquidity has its own router under `/gateway/amm`. To run a position that is monitored and closed for you, use an [LP executor](/executors/lp-executor). For a complete example, see [Guide: Solana DEX LP Expert Agent](/examples/solana-lp). ## Gateway vs CEX Connectors | Aspect | CEX connectors | Gateway | | - | - | - | | **Custody** | The exchange holds your funds | You hold the keys, on your server | | **Fees** | Trading fees | Network fees plus pool or protocol fees | | **Where it runs** | Inside the Hummingbot API | A separate container the API starts | ## Resources > [card] [Gateway GitHub](https://github.com/hummingbot/gateway) > > Gateway source code > [card] [Gateway Docs](https://hummingbot.org/gateway/) > > Full Gateway documentation # Add Amm Liquidity Source: https://condor.hummingbot.org/api-reference/gateway-amm/add-amm-liquidity /api-reference/openapi.json post /gateway/amm/add-liquidity Add two-sided liquidity to an AMM pool. Meteora DAMM v2: pass position_address to add to that NFT position; omit it to open a new one. Fungible-LP AMMs ignore position_address. # Create Amm Pool Source: https://condor.hummingbot.org/api-reference/gateway-amm/create-amm-pool /api-reference/openapi.json post /gateway/amm/create-pool Create and seed a new AMM pool. Seed price priority: initial_price β†’ quote_token_amount ratio β†’ live market price (anti-snipe). Connector-specific params ride extra_params under Gateway's own names (configAddress for meteora β€” required there, ammConfigIndex for raydium) β€” the same contract as clmm open's extra_params. Seeding slippage for uniswap/pancakeswap is the standard slippage_pct field. # Get Amm Pool Info Source: https://condor.hummingbot.org/api-reference/gateway-amm/get-amm-pool-info /api-reference/openapi.json get /gateway/amm/pool-info Get AMM pool information (reserves, price, base fee) by pool address. # Get Amm Position Info Source: https://condor.hummingbot.org/api-reference/gateway-amm/get-amm-position-info /api-reference/openapi.json get /gateway/amm/position-info Get a wallet's aggregate liquidity in an AMM pool plus a per-position breakdown (DAMM v2). # Get Amm Positions Owned Source: https://condor.hummingbot.org/api-reference/gateway-amm/get-amm-positions-owned /api-reference/openapi.json post /gateway/amm/positions-owned List all of a wallet's AMM positions across pools (Meteora DAMM v2 only). Fungible-LP AMMs (raydium, uniswap, pancakeswap) have no enumerable positions; Gateway rejects them with a 400, surfaced here unchanged. Use position-info with a specific pool address instead. # Quote Amm Liquidity Source: https://condor.hummingbot.org/api-reference/gateway-amm/quote-amm-liquidity /api-reference/openapi.json post /gateway/amm/quote-liquidity Quote a two-sided liquidity deposit. # Remove Amm Liquidity Source: https://condor.hummingbot.org/api-reference/gateway-amm/remove-amm-liquidity /api-reference/openapi.json post /gateway/amm/remove-liquidity Remove liquidity from an AMM pool. Meteora DAMM v2 requires position_address (positions are NFTs); Gateway rejects a missing one with a 400, surfaced here unchanged, so "remove 100%" is a true exit of the named position. # Search Amm Events Source: https://condor.hummingbot.org/api-reference/gateway-amm/search-amm-events /api-reference/openapi.json post /gateway/amm/events/search Search recorded AMM liquidity writes, newest first. This is the AMM history: ADD_LIQUIDITY, REMOVE_LIQUIDITY and CREATE_POOL with their on-chain amounts and gas. Current holdings are not here β€” read those live from /gateway/amm/position-info, which is the only authority on them. # Search Amm Positions Source: https://condor.hummingbot.org/api-reference/gateway-amm/search-amm-positions /api-reference/openapi.json post /gateway/amm/positions/search Search tracked AMM positions (Meteora DAMM v2 NFTs), newest first. Fungible-LP AMMs never appear here β€” they have no position identity. Their holdings come from /gateway/amm/position-info and their history from /gateway/amm/events/search. # Add Liquidity To Clmm Position Source: https://condor.hummingbot.org/api-reference/gateway-clmm/add-liquidity-to-clmm-position /api-reference/openapi.json post /gateway/clmm/add Add MORE liquidity to an EXISTING CLMM position. Example: connector: 'meteora' network: 'solana-mainnet-beta' position_address: '...' base_token_amount: 0.5 quote_token_amount: 50.0 slippage_pct: 1 (optional; omit to use the connector's configured slippagePct) wallet_address: (optional) extra_params: {"strategyType": 0} # Meteora-specific Returns: Transaction hash # Close Clmm Position Source: https://condor.hummingbot.org/api-reference/gateway-clmm/close-clmm-position /api-reference/openapi.json post /gateway/clmm/close CLOSE a CLMM position completely (removes all liquidity and collects pending fees). Example: connector: 'meteora' network: 'solana-mainnet-beta' position_address: '...' wallet_address: (optional) Returns: Transaction hash and collected fee amounts # Collect Fees From Clmm Position Source: https://condor.hummingbot.org/api-reference/gateway-clmm/collect-fees-from-clmm-position /api-reference/openapi.json post /gateway/clmm/collect-fees Collect accumulated fees from a CLMM liquidity position. Example: connector: 'meteora' network: 'solana-mainnet-beta' position_address: '...' wallet_address: (optional) Returns: Transaction hash and collected fee amounts # Create Clmm Pool Source: https://condor.hummingbot.org/api-reference/gateway-clmm/create-clmm-pool /api-reference/openapi.json post /gateway/clmm/create-pool Create a new (empty) CLMM pool β€” liquidity is added afterwards by opening positions. Mirrors Gateway's POST /trading/clmm/create-pool (which shares the AMM create-pool response shape). Connector-specific params ride extra_params under Gateway's own names β€” the same contract as open's extra_params. # Get Clmm Pool Info Source: https://condor.hummingbot.org/api-reference/gateway-clmm/get-clmm-pool-info /api-reference/openapi.json get /gateway/clmm/pool-info Get detailed information about a CLMM pool by pool address. Args: connector: CLMM connector (e.g., 'meteora', 'raydium') network: Network ID in 'chain-network' format (e.g., 'solana-mainnet-beta') pool_address: Pool contract address bin_count: If > 0, include the per-tick liquidity distribution (`bins`) around the active tick. Meteora always returns its bins and ignores this; orca, raydium, uniswap and pancakeswap honour it. Example: GET /gateway/clmm/pool-info?connector=meteora&network=solana-mainnet-beta &pool_address=2sf5NYcY4zUPXUSmG6f66mskb24t5F8S11pC1Nz5nQT3 Returns: Pool information including liquidity, price, bins (for Meteora), etc. All field names are returned in snake_case format. # Get Clmm Pools Source: https://condor.hummingbot.org/api-reference/gateway-clmm/get-clmm-pools /api-reference/openapi.json get /gateway/clmm/pools Get list of available CLMM pools for a connector via Gateway. Supports: meteora, orca Args: connector: CLMM connector (meteora, orca) network: Solana network name (bare, default 'mainnet-beta') page: Page number (default: 0) limit: Results per page (default: 50, max: 100) search_term: Search query to filter pools (optional) sort_key: Sort by field. Defaults to tvl β€” see the parameter description for why, and for the keys each connector accepts. order_by: Sort order (asc, desc) include_unknown: Include pools with unverified tokens Example: GET /gateway/clmm/pools?connector=meteora&search_term=SOL&limit=20 Returns: List of available pools with trading pairs, addresses, liquidity, volume, APR, etc. # Get Clmm Position Events Source: https://condor.hummingbot.org/api-reference/gateway-clmm/get-clmm-position-events /api-reference/openapi.json get /gateway/clmm/positions/{position_address}/events Get event history for a CLMM position. Args: position_address: Position NFT address event_type: Filter by event type (OPEN, ADD_LIQUIDITY, REMOVE_LIQUIDITY, COLLECT_FEES, CLOSE, DISCOVERED β€” written by the poller for positions it found on-chain, with a synthetic discovered_ transaction hash) limit: Max events to return Returns: List of position events # Get Clmm Position Info Source: https://condor.hummingbot.org/api-reference/gateway-clmm/get-clmm-position-info /api-reference/openapi.json get /gateway/clmm/position-info Get a single CLMM position by its address. Mirrors Gateway's GET /trading/clmm/position-info. Gateway reports a missing or closed position as an error (500/404), surfaced here as 404. # Get Clmm Positions Owned Source: https://condor.hummingbot.org/api-reference/gateway-clmm/get-clmm-positions-owned /api-reference/openapi.json post /gateway/clmm/positions_owned Get all CLMM liquidity positions owned by a wallet. Mirrors Gateway's /trading/clmm/positions-owned, which takes no pool filter: every CLMM position the wallet owns on the connector is returned, each row carrying its own pool_address. (The old pool_address request field was a silent no-op β€” Gateway never read it and the response was never filtered.) Example: connector: 'meteora' network: 'solana-mainnet-beta' wallet_address: (optional, uses default if not provided) Returns: List of CLMM position information # Open Clmm Position Source: https://condor.hummingbot.org/api-reference/gateway-clmm/open-clmm-position /api-reference/openapi.json post /gateway/clmm/open Open a NEW CLMM position with initial liquidity. Example: connector: 'meteora' network: 'solana-mainnet-beta' pool_address: '2sf5NYcY4zUPXUSmG6f66mskb24t5F8S11pC1Nz5nQT3' lower_price: 150 upper_price: 250 base_token_amount: 0.01 quote_token_amount: 2 slippage_pct: 1 (optional; omit to use the connector's configured slippagePct) wallet_address: (optional) extra_params: {"strategyType": 0} # Meteora-specific Returns: Transaction hash and position address. position_address is None when the transaction was submitted but not yet confirmed β€” poll the transaction; the poller's discovery sweep records the position once it lands on-chain. # Quote Clmm Position Source: https://condor.hummingbot.org/api-reference/gateway-clmm/quote-clmm-position /api-reference/openapi.json post /gateway/clmm/quote-position Quote a candidate CLMM position before opening or adding liquidity. Mirrors Gateway's GET /trading/clmm/quote-position: returns the base/quote split the pool would actually take for the given range and deposit amounts (and which side limits it), without signing or submitting anything. # Remove Liquidity From Clmm Position Source: https://condor.hummingbot.org/api-reference/gateway-clmm/remove-liquidity-from-clmm-position /api-reference/openapi.json post /gateway/clmm/remove Remove SOME liquidity from a CLMM position (partial removal). Example: connector: 'meteora' network: 'solana-mainnet-beta' position_address: '...' percentage_to_remove: 50 slippage_pct: 1 (optional; Orca only β€” other connectors ignore it) wallet_address: (optional) Returns: Transaction hash # Search Clmm Positions Source: https://condor.hummingbot.org/api-reference/gateway-clmm/search-clmm-positions /api-reference/openapi.json post /gateway/clmm/positions/search Search CLMM positions with filters. Args: network: Filter by network (e.g., 'solana-mainnet-beta') connector: Filter by connector (e.g., 'meteora') wallet_address: Filter by wallet address trading_pair: Filter by trading pair (e.g., 'SOL-USDC'; a token outside Gateway's token list is stored under its full mint address instead of a symbol) status: Filter by status (OPEN, CLOSED) position_addresses: Filter by specific position addresses (list of addresses) limit: Max results (default 50, max 1000) offset: Pagination offset refresh: If True, refresh position data from Gateway before returning (default False) Returns: Paginated list of positions # Execute Swap Source: https://condor.hummingbot.org/api-reference/gateway-swaps/execute-swap /api-reference/openapi.json post /gateway/swap/execute Execute a swap transaction via router (Jupiter, 0x). Example: connector: 'jupiter' network: 'solana-mainnet-beta' trading_pair: 'SOL-USDC' side: 'BUY' amount: 1 slippage_pct: 1 (optional; omit to use the connector's configured slippagePct) wallet_address: (optional, uses default if not provided) extra_params: {"approximateIfNoExactOut": false} # Solana routers Returns: Transaction hash and swap details # Execute Swap Quote Source: https://condor.hummingbot.org/api-reference/gateway-swaps/execute-swap-quote /api-reference/openapi.json post /gateway/swap/execute-quote Execute a quote returned by /swap/quote, by its quote_id. The two-step flow: quote, decide, then commit to THAT quote. /swap/execute prices again at execution, which discards the price the caller saw β€” the whole reason dflow, titan and 0x return a held quote. Router connectors only; a pool-scoped connector has no cached quote to execute and is rejected rather than quietly re-priced. Example: connector: 'jupiter' network: 'solana-mainnet-beta' quote_id: '' trading_pair: 'SOL-USDC' side: 'SELL' amount: 0.01 Returns: Transaction hash and what the swap actually moved # Get Swap Quote Source: https://condor.hummingbot.org/api-reference/gateway-swaps/get-swap-quote /api-reference/openapi.json post /gateway/swap/quote Get a price quote for a swap. Example: connector: 'jupiter' (or typed: 'jupiter/router', 'meteora/clmm', 'raydium/amm') network: 'solana-mainnet-beta' trading_pair: 'SOL-USDC' side: 'BUY' amount: 1 slippage_pct: 1 (optional; omit to use the connector's configured slippagePct) extra_params: {"approximateIfNoExactOut": false} # Solana routers Returns: Quote with price, expected output amount, and execution-safety fields # Get Swap Status Source: https://condor.hummingbot.org/api-reference/gateway-swaps/get-swap-status /api-reference/openapi.json get /gateway/swaps/{transaction_hash}/status Get status of a specific swap by transaction hash. Args: transaction_hash: Transaction hash of the swap Returns: Swap details including current status # Get Swaps Summary Source: https://condor.hummingbot.org/api-reference/gateway-swaps/get-swaps-summary /api-reference/openapi.json get /gateway/swaps/summary Get swap summary statistics. Args: network: Filter by network wallet_address: Filter by wallet address start_time: Start timestamp (unix seconds) end_time: End timestamp (unix seconds) Returns: Summary statistics including volume, fees, success rate # Search Swaps Source: https://condor.hummingbot.org/api-reference/gateway-swaps/search-swaps /api-reference/openapi.json post /gateway/swaps/search Search swap history with filters. Args: network: Filter by network (e.g., 'solana-mainnet-beta') connector: Filter by connector (e.g., 'jupiter') wallet_address: Filter by wallet address trading_pair: Filter by trading pair (e.g., 'SOL-USDC') status: Filter by status (SUBMITTED, CONFIRMED, FAILED) start_time: Start timestamp (unix seconds) end_time: End timestamp (unix seconds) limit: Max results (default 50, max 1000) offset: Pagination offset Returns: Paginated list of swaps # Add Network Pool Source: https://condor.hummingbot.org/api-reference/gateway/add-network-pool /api-reference/openapi.json post /gateway/networks/{network_id}/pools Add a custom pool to Gateway's pool list for a specific network. Args: network_id: Network ID in format 'chain-network' (e.g., 'solana-mainnet-beta', 'ethereum-mainnet') pool_request: Pool details (connector, type, base, quote, address, etc.) Example: POST /gateway/networks/solana-mainnet-beta/pools { "connector_name": "raydium", "type": "clmm", "base": "SOL", "quote": "USDC", "address": "58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2", "base_address": "So11111111111111111111111111111111111111112", "quote_address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "fee_pct": 0.25 } No Gateway restart is needed: the pool list is read off disk per request, so the pool is listed and priced as soon as this returns. # Add Network Token Source: https://condor.hummingbot.org/api-reference/gateway/add-network-token /api-reference/openapi.json post /gateway/networks/{network_id}/tokens Add a custom token to Gateway's token list for a specific network. Args: network_id: Network ID in format 'chain-network' (e.g., 'solana-mainnet-beta', 'ethereum-mainnet') token_request: Token details (address, symbol, name, decimals) Example: POST /gateway/networks/ethereum-mainnet/tokens { "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "symbol": "USDC", "name": "USD Coin", "decimals": 6 } No Gateway restart is needed: the token list is read off disk per request, so the token is live as soon as this returns. # Delete Network Pool Source: https://condor.hummingbot.org/api-reference/gateway/delete-network-pool /api-reference/openapi.json delete /gateway/networks/{network_id}/pools/{pool_address} Delete a pool from Gateway's pool list for a specific network. Args: network_id: Network ID in format 'chain-network' (e.g., 'solana-mainnet-beta', 'ethereum-mainnet') pool_address: Pool contract address to delete Example: DELETE /gateway/networks/solana-mainnet-beta/pools/58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2 No Gateway restart is needed: the pool list is read off disk per request, so the deletion is live as soon as this returns. # Delete Network Token Source: https://condor.hummingbot.org/api-reference/gateway/delete-network-token /api-reference/openapi.json delete /gateway/networks/{network_id}/tokens/{token_address} Delete a custom token from Gateway's token list for a specific network. Args: network_id: Network ID in format 'chain-network' (e.g., 'solana-mainnet-beta', 'ethereum-mainnet') token_address: Token contract address to delete Example: DELETE /gateway/networks/solana-mainnet-beta/tokens/9QFfgxdSqH5zT7j6rZb1y6SZhw2aFtcQu2r6BuYpump No Gateway restart is needed: the token list is read off disk per request, so the deletion is live as soon as this returns. # Get Api Keys Source: https://condor.hummingbot.org/api-reference/gateway/get-api-keys /api-reference/openapi.json get /gateway/apiKeys Get all configured API keys from Gateway. Returns a dict mapping provider name to API key value. Example response: { "helius": "46951ec2-16af-4fc0-a5df-970b0eb925b7", "infura": "920646320ec3463fa1b5235be9fa48d3", "coingecko": "CG-Rw786jTpNmV1MvRrqpDAHR6r", "etherscan": "" } # Get Connector Config Source: https://condor.hummingbot.org/api-reference/gateway/get-connector-config /api-reference/openapi.json get /gateway/connectors/{connector_name} Get configuration for a specific DEX connector. Args: connector_name: Connector name (e.g., 'meteora', 'raydium') # Get Gateway Logs Source: https://condor.hummingbot.org/api-reference/gateway/get-gateway-logs /api-reference/openapi.json get /gateway/logs Get Gateway container logs. # Get Gateway Status Source: https://condor.hummingbot.org/api-reference/gateway/get-gateway-status /api-reference/openapi.json get /gateway/status Get Gateway container status. # Get Network Config Source: https://condor.hummingbot.org/api-reference/gateway/get-network-config /api-reference/openapi.json get /gateway/networks/{network_id} Get configuration for a specific network. Args: network_id: Network ID in format 'chain-network' (e.g., 'solana-mainnet-beta', 'ethereum-mainnet') Example: GET /gateway/networks/solana-mainnet-beta # Get Network Pools Source: https://condor.hummingbot.org/api-reference/gateway/get-network-pools /api-reference/openapi.json get /gateway/networks/{network_id}/pools Get available pools for a network. Args: network_id: Network ID in format 'chain-network' (e.g., 'solana-mainnet-beta') connector: Optional filter by connector (e.g., 'raydium', 'meteora', 'uniswap') pool_type: Optional filter by type ('amm' or 'clmm') search: Optional search by trading pair (e.g., 'SOL-USDC') or pool address Example: GET /gateway/networks/solana-mainnet-beta/pools?connector=raydium&type=clmm # Get Network Tokens Source: https://condor.hummingbot.org/api-reference/gateway/get-network-tokens /api-reference/openapi.json get /gateway/networks/{network_id}/tokens Get available tokens for a network. Args: network_id: Network ID in format 'chain-network' (e.g., 'solana-mainnet-beta') search: Filter tokens by symbol, name, or address (case-insensitive substring) Example: GET /gateway/networks/solana-mainnet-beta/tokens?search=USDC # List Chains Source: https://condor.hummingbot.org/api-reference/gateway/list-chains /api-reference/openapi.json get /gateway/chains List all available blockchain chains and their networks. This also serves as the networks list endpoint. # List Connectors Source: https://condor.hummingbot.org/api-reference/gateway/list-connectors /api-reference/openapi.json get /gateway/connectors List all available DEX connectors with their configurations. Returns connector details including name, trading types, chain, and networks. All fields normalized to snake_case. # List Networks Source: https://condor.hummingbot.org/api-reference/gateway/list-networks /api-reference/openapi.json get /gateway/networks List all available networks across all chains. Returns a flattened list of network IDs in the format 'chain-network'. This is the primary interface for network discovery. # List Pools Legacy Source: https://condor.hummingbot.org/api-reference/gateway/list-pools-legacy /api-reference/openapi.json get /gateway/pools [DEPRECATED] Use GET /gateway/networks/{network_id}/pools instead. List all liquidity pools for a connector and network. # Restart Gateway Source: https://condor.hummingbot.org/api-reference/gateway/restart-gateway /api-reference/openapi.json post /gateway/restart Restart Gateway container. If config is provided, the container will be removed and recreated with new configuration. If no config is provided, the container will be stopped and started with existing configuration. # Save Network Pool Source: https://condor.hummingbot.org/api-reference/gateway/save-network-pool /api-reference/openapi.json post /gateway/networks/{network_id}/pools/save/{pool_address} Save a pool by address, auto-adding any missing tokens. Gateway only needs GeckoTerminal to answer one question: which DEX does this address belong to, and is it amm or clmm. The pool's base, quote and fee always come from the connector. Pass connector and type to answer that directly and skip the lookup β€” which is what a caller holding an LP provider config like 'meteora/clmm' can always do, and what makes this work for a token or pool GeckoTerminal has not indexed. Args: network_id: Network ID in format 'chain-network' (e.g., 'solana-mainnet-beta') pool_address: Pool contract address connector: DEX connector ('meteora', 'raydium', 'orca', 'uniswap'). With type. type: Pool type, 'amm' or 'clmm'. With connector. Example: POST /gateway/networks/solana-mainnet-beta/pools/save/2sf5NYcY...?connector=meteora&type=clmm # Save Network Token Source: https://condor.hummingbot.org/api-reference/gateway/save-network-token /api-reference/openapi.json post /gateway/networks/{network_id}/tokens/save/{token_address} Save a token by address - auto-fetches token info from GeckoTerminal. This is the simplest way to add a token. Just provide the address and the API will fetch symbol, name, and decimals automatically. Args: network_id: Network ID in format 'chain-network' (e.g., 'solana-mainnet-beta', 'ethereum-mainnet') token_address: Token contract address Example: POST /gateway/networks/solana-mainnet-beta/tokens/save/9QFfgxdSqH5zT7j6rZb1y6SZhw2aFtcQu2r6BuYpump # Start Gateway Source: https://condor.hummingbot.org/api-reference/gateway/start-gateway /api-reference/openapi.json post /gateway/start Start Gateway container. # Stop Gateway Source: https://condor.hummingbot.org/api-reference/gateway/stop-gateway /api-reference/openapi.json post /gateway/stop Stop Gateway container. # Update Api Keys Source: https://condor.hummingbot.org/api-reference/gateway/update-api-keys /api-reference/openapi.json post /gateway/apiKeys Update API keys in Gateway configuration. Args: request: Contains api_keys dict mapping provider name to API key value Example request: { "api_keys": { "helius": "new-api-key-value", "infura": "another-api-key" } } Note: After updating API keys, restart Gateway for changes to take effect. # Update Connector Config Source: https://condor.hummingbot.org/api-reference/gateway/update-connector-config /api-reference/openapi.json post /gateway/connectors/{connector_name} Update configuration for a DEX connector. Args: connector_name: Connector name (e.g., 'meteora', 'raydium') config_updates: Dict with path-value pairs to update. Keys can be in snake_case (e.g., {"slippage_pct": 0.5}) or camelCase (e.g., {"slippagePct": 0.5}) # Update Network Config Source: https://condor.hummingbot.org/api-reference/gateway/update-network-config /api-reference/openapi.json post /gateway/networks/{network_id} Update configuration for a specific network. Args: network_id: Network ID in format 'chain-network' (e.g., 'solana-mainnet-beta') config_updates: Dict with path-value pairs to update. Keys can be in snake_case (e.g., {"node_url": "https://..."}) or camelCase (e.g., {"nodeURL": "https://..."}) Example: POST /gateway/networks/solana-mainnet-beta # Hummingbot Source: https://condor.hummingbot.org/api-reference/hummingbot The open source crypto trading framework under Hummingbot API **Hummingbot** is an open source framework for building and running automated trading strategies. Hummingbot API loads the Hummingbot Python library in-process for exchange connectivity, market data and executors. Bots that the API deploys are Docker containers running the Hummingbot client. ## Why Hummingbot? * **Open source:** Apache 2.0 licensed. All code is on [GitHub](https://github.com/hummingbot/hummingbot). * **In production since 2019:** CoinAlpha open-sourced Hummingbot in April 2019. * **Self-hosted:** your API keys and wallet keys stay on your server. The API encrypts exchange credentials with your `CONFIG_PASSWORD`. * **No intermediary:** connectors talk to each exchange's API directly. * **Standardized connectors:** every exchange is reached through the same interface, so the API's trading, market data and executor endpoints work the same across them. * **Isolated bots:** each bot runs in its own container, with its own configuration, data and logs. ## How Hummingbot API Uses It ### Exchange connectors The API builds a Hummingbot connector for each account and exchange you add credentials for, and uses it for trading, balances and market data. These are the same classes the Hummingbot client uses, for example: ```python theme={null} from hummingbot.connector.exchange.binance.binance_exchange import BinanceExchange from hummingbot.connector.exchange.hyperliquid.hyperliquid_exchange import HyperliquidExchange ``` You don't import these yourself. Call the API's endpoints with the connector's name (`binance`, `hyperliquid`, and so on). ### Executors Executors run inside the API, using Hummingbot's executor classes. No bot container is needed. You create one with `POST /executors/` and a config such as a `position_executor` config. See [Executors](/executors/overview), and [Position Executor](/executors/position-executor#via-the-api) for a full API example. ### Bot containers When you deploy a bot (`POST /bot-orchestration/deploy-v2-controllers` or `deploy-v2-script`), the API: * Names the bot `-` and creates its folder under `bots/instances/`, with its own `conf`, `data` and `logs` * Starts a container from the `hummingbot/hummingbot:latest` image by default * Passes it your `CONFIG_PASSWORD` so it can decrypt the exchange credentials * Gives it the broker credentials and the Gateway client certificates Each bot reports its status and performance to the API through the EMQX broker. You can start, stop and archive bots through the API. ## Connector Coverage The API's `GET /connectors/` lists every connector your server supports. On the current image that is more than 40 exchange connectors, not counting testnets, plus one entry per Gateway network. Some of the connector names it returns: | Type | Connector names | | - | - | | **Spot** | `binance`, `bybit`, `coinbase_advanced_trade`, `gate_io`, `hyperliquid`, `kraken`, `kucoin`, `mexc`, `okx` | | **Perpetual** | `binance_perpetual`, `bybit_perpetual`, `dydx_v4_perpetual`, `gate_io_perpetual`, `hyperliquid_perpetual`, `okx_perpetual` | | **DEX (via Gateway)** | Jupiter, Meteora, Raydium, Orca, Uniswap, PancakeSwap and more. See [Gateway](/api-reference/gateway#supported-connectors). | To connect one, see [Exchange Credentials](/getting-started/credentials). ## Resources > [card] [Hummingbot Docs](https://hummingbot.org/docs) > > Full Hummingbot documentation > [card] [GitHub](https://github.com/hummingbot/hummingbot) > > Hummingbot source code # Add Trading Pair Source: https://condor.hummingbot.org/api-reference/market-data/add-trading-pair /api-reference/openapi.json post /market-data/trading-pair/add Initialize order book for a trading pair. This endpoint dynamically adds a trading pair to a connector's order book tracker. It uses the best available connector (trading connectors are preferred over data connectors). Args: request: Request with connector name, trading pair, optional account name, and timeout Returns: TradingPairResponse with success status and message Raises: HTTPException: 500 if initialization fails # Get Active Feeds Source: https://condor.hummingbot.org/api-reference/market-data/get-active-feeds /api-reference/openapi.json get /market-data/active-feeds Get information about currently active market data feeds. Args: request: FastAPI request object to access application state Returns: Dictionary with active feeds information including last access times and expiration # Get Available Candle Connectors Source: https://condor.hummingbot.org/api-reference/market-data/get-available-candle-connectors /api-reference/openapi.json get /market-data/available-candle-connectors Get list of available connectors that support candle data feeds. Returns: List of connector names that can be used for fetching candle data # Get Candles Source: https://condor.hummingbot.org/api-reference/market-data/get-candles /api-reference/openapi.json post /market-data/candles Get real-time candles data for a specific trading pair. This endpoint uses the MarketDataProvider to get or create a candles feed that will automatically start and maintain real-time updates. Subsequent requests with the same configuration will reuse the existing feed for up-to-date data. Args: request: FastAPI request object candles_config: Configuration for the candles including connector, trading_pair, interval, and max_records Returns: Real-time candles data or error message # Get Funding Info Source: https://condor.hummingbot.org/api-reference/market-data/get-funding-info /api-reference/openapi.json post /market-data/funding-info Get funding information for a perpetual trading pair. Args: request: Funding info request with connector name and trading pair market_data_manager: Injected market data feed manager Returns: Funding information including rates, timestamps, and prices Raises: HTTPException: 400 for non-perpetual connectors, 500 for other errors # Get Historical Candles Source: https://condor.hummingbot.org/api-reference/market-data/get-historical-candles /api-reference/openapi.json post /market-data/historical-candles Get historical candles data for a specific trading pair. Args: config: Configuration for historical candles including connector, trading pair, interval, start and end time Returns: Historical candles data or error message # Get Market Data Settings Source: https://condor.hummingbot.org/api-reference/market-data/get-market-data-settings /api-reference/openapi.json get /market-data/settings Get current market data settings for debugging. Returns: Dictionary with current market data configuration including cleanup and timeout settings # Get Order Book Source: https://condor.hummingbot.org/api-reference/market-data/get-order-book /api-reference/openapi.json post /market-data/order-book Get order book snapshot with specified depth. Args: request: Order book request with connector, trading pair, and depth market_data_manager: Injected market data feed manager Returns: Order book snapshot with bids and asks Raises: HTTPException: 500 if there's an error fetching order book # Get Order Book Diagnostics Source: https://condor.hummingbot.org/api-reference/market-data/get-order-book-diagnostics /api-reference/openapi.json get /market-data/order-book/diagnostics/{connector_name} Get diagnostics for a connector's order book tracker. Returns detailed information about the order book tracker status including: - Task status (running/crashed) - WebSocket connection status - Metrics (messages processed, latency, etc.) - Current order book state Args: connector_name: The connector to diagnose (e.g., "binance") account_name: Optional account name for trading connectors Returns: Diagnostic information dictionary # Get Pool Prices Source: https://condor.hummingbot.org/api-reference/market-data/get-pool-prices /api-reference/openapi.json get /market-data/pool-prices Get a snapshot of the merged price pool used for cross-rate resolution. # Get Price For Quote Volume Source: https://condor.hummingbot.org/api-reference/market-data/get-price-for-quote-volume /api-reference/openapi.json post /market-data/order-book/price-for-quote-volume Get the price required to fill a specific quote volume on the order book. Args: request: Request with connector, trading pair, quote volume, and side market_data_manager: Injected market data feed manager Returns: Order book query result with price and volume information # Get Price For Volume Source: https://condor.hummingbot.org/api-reference/market-data/get-price-for-volume /api-reference/openapi.json post /market-data/order-book/price-for-volume Get the price required to fill a specific volume on the order book. Args: request: Request with connector, trading pair, volume, and side market_data_manager: Injected market data feed manager Returns: Order book query result with price and volume information # Get Prices Source: https://condor.hummingbot.org/api-reference/market-data/get-prices /api-reference/openapi.json post /market-data/prices Get current prices for specified trading pairs from a connector. Args: request: Price request with connector name and trading pairs market_data_manager: Injected market data feed manager Returns: Current prices for the specified trading pairs Raises: HTTPException: 500 if there's an error fetching prices # Get Quote Volume For Price Source: https://condor.hummingbot.org/api-reference/market-data/get-quote-volume-for-price /api-reference/openapi.json post /market-data/order-book/quote-volume-for-price Get the quote volume available at a specific price level on the order book. Args: request: Request with connector, trading pair, price, and side market_data_manager: Injected market data feed manager Returns: Order book query result with quote volume information # Get Rates Source: https://condor.hummingbot.org/api-reference/market-data/get-rates /api-reference/openapi.json post /market-data/rates Resolve cross-rates for trading pairs from the collected ticker pool. Rates are resolved via direct, reverse or bridged paths. When ``connector`` is set, only that exchange's tickers are used; otherwise the merged multi-exchange pool is used. # Get Single Rate Source: https://condor.hummingbot.org/api-reference/market-data/get-single-rate /api-reference/openapi.json get /market-data/rate/{trading_pair} Resolve a cross-rate for a single ``BASE-QUOTE`` trading pair from the ticker pool. Pass ``?connector=`` to restrict resolution to a single exchange's tickers. # Get Tickers Source: https://condor.hummingbot.org/api-reference/market-data/get-tickers /api-reference/openapi.json get /market-data/tickers Get tickers grouped by connector, with 24h base and quote volume where available. Without ``connectors`` this returns the collected pool as-is. Naming connectors fetches them on demand (concurrently) through keyless public data connectors when the cache is missing or stale, so it works for exchanges no API keys are configured for; those connectors then join the background refresh cycle. A connector that fails does not remove the others from the response: it is reported under ``errors`` alongside the successful results. An error status is returned only when nothing could be served at all. # Get Volume For Price Source: https://condor.hummingbot.org/api-reference/market-data/get-volume-for-price /api-reference/openapi.json post /market-data/order-book/volume-for-price Get the volume available at a specific price level on the order book. Args: request: Request with connector, trading pair, price, and side market_data_manager: Injected market data feed manager Returns: Order book query result with volume information # Get Vwap For Volume Source: https://condor.hummingbot.org/api-reference/market-data/get-vwap-for-volume /api-reference/openapi.json post /market-data/order-book/vwap-for-volume Get the VWAP (Volume Weighted Average Price) for a specific volume on the order book. Args: request: Request with connector, trading pair, volume, and side market_data_manager: Injected market data feed manager Returns: Order book query result with VWAP information # Remove Trading Pair Source: https://condor.hummingbot.org/api-reference/market-data/remove-trading-pair /api-reference/openapi.json post /market-data/trading-pair/remove Remove a trading pair from order book tracking. This endpoint removes a trading pair from a connector's order book tracker, cleaning up resources for pairs that are no longer needed. Args: request: Request with connector name, trading pair, and optional account name Returns: TradingPairResponse with success status and message Raises: HTTPException: 500 if removal fails # Restart Order Book Tracker Source: https://condor.hummingbot.org/api-reference/market-data/restart-order-book-tracker /api-reference/openapi.json post /market-data/order-book/restart/{connector_name} Restart the order book tracker for a connector. Use this endpoint when the order book is stale (WebSocket disconnected). This will: 1. Stop the existing order book tracker 2. Restart it with the same trading pairs 3. Wait for the WebSocket to reconnect Args: connector_name: The connector to restart (e.g., "binance") account_name: Optional account name for trading connectors Returns: Restart status with success/failure and trading pairs # Get Latest Performance Source: https://condor.hummingbot.org/api-reference/performance/get-latest-performance /api-reference/openapi.json get /performance/latest The most recent snapshot of every scope in one subject, newest first. One row per scope -- per (bot, controller), or per executor -- in the same normalized shape `/history` returns, so a dashboard's live tiles and its charts read the same fields off the same client. `limit` caps how many scopes come back, it is not a page boundary: there is no cursor here because this is not a series. Newest-first ordering means the scopes that are still reporting come first, which matters far more for executors than for controllers -- every executor that ever ran leaves a terminal row behind, so the executor population grows without bound while the controller one does not. This reads the stored series, not live memory. An executor younger than one snapshot interval has no row yet and does not appear, and a live one's figures are up to one interval stale -- by design, so that this row and the last row of `/history` are the same row. Live in-memory figures are what `/executors/` serves. A closed executor's latest row is its terminal row, carrying `is_terminal: true` and its `close_type`, so "the final value" needs no separate call. That holds for every way an executor can close, including the startup reap of one a crash left behind (`close_type: SYSTEM_CLEANUP`): this row and `GET /executors/{executor_id}` are written in the same transaction, so the two surfaces cannot disagree about whether an executor is done. # Get Performance History Source: https://condor.hummingbot.org/api-reference/performance/get-performance-history /api-reference/openapi.json get /performance/history Historical performance for one subject, newest first, in one normalized row shape. Both subjects page identically: descending timestamp, `cursor` is the last row's timestamp, `has_more` says whether another page exists. `interval` is a floor, not a guarantee. The controller series is written on a 5-minute grain, so asking it for `1m` returns that native grain; the executor series is written on PERFORMANCE_EXECUTOR_SNAPSHOT_INTERVAL (60s by default). The echoed `interval` says what was asked for, the timestamps say what was served. It is a claim about resolution only. Sampling is per scope -- per executor, per (bot, controller) -- so a coarser interval thins every scope's own series and never drops a scope from the answer. An unnarrowed query over a fleet returns the whole fleet at every interval, at a lower resolution. Realized vs unrealized, for executors: an executor reports one net PnL, and the split comes from whether its position is really settled. A `POSITION_HOLD` close is NOT settled -- it hands the position on to position_holds, which report it in their own right -- so its PnL stays in `unrealized_pnl_quote` even though `is_terminal` is true and `status` is TERMINATED. Counting it realized here would double-count it, the same exclusion /executors/performance applies. Any other terminal close is realized. An executor's series is answered from executor_performance_snapshots alone, including its final value: completion writes a terminal row, so there is no join to the executors table and no "and then append the last point" rule. An executor that was live when the API crashed gets its terminal row from the startup reap instead, carrying `close_type: SYSTEM_CLEANUP` and the last figures observed before the crash -- an approximated close, marked as one, rather than a series that never ends. # Get Accounts Distribution Source: https://condor.hummingbot.org/api-reference/portfolio/get-accounts-distribution /api-reference/openapi.json get /portfolio/accounts-distribution Get portfolio distribution by accounts with percentages. Returns: Dictionary with account distribution including percentages, values, and breakdown by connectors # Get Portfolio Distribution Source: https://condor.hummingbot.org/api-reference/portfolio/get-portfolio-distribution /api-reference/openapi.json post /portfolio/distribution Get portfolio distribution by tokens with percentages across all or filtered accounts. Args: filter_request: JSON payload with filtering criteria Returns: Dictionary with token distribution including percentages, values, and breakdown by accounts/connectors # Get Portfolio History Source: https://condor.hummingbot.org/api-reference/portfolio/get-portfolio-history /api-reference/openapi.json post /portfolio/history Get the historical state of all or filtered accounts portfolio with pagination and interval sampling. The interval parameter allows you to control data granularity: - 5m: Raw data (default, collected every 5 minutes) - 15m: One data point every 15 minutes - 30m: One data point every 30 minutes - 1h: One data point every hour - 4h: One data point every 4 hours - 12h: One data point every 12 hours - 1d: One data point every day Using larger intervals significantly reduces response size and improves performance. Args: filter_request: JSON payload with filtering criteria (account_names, connector_names, start_time, end_time, limit, cursor, interval) Returns: Paginated response with historical portfolio data sampled at the requested interval # Get Portfolio State Source: https://condor.hummingbot.org/api-reference/portfolio/get-portfolio-state /api-reference/openapi.json post /portfolio/state Get the current state of all or filtered accounts portfolio. Args: filter_request: JSON payload with filtering criteria including: - account_names: Optional list of account names to filter by - connector_names: Optional list of connector names to filter by - skip_gateway: If True, skip Gateway wallet balance updates for faster CEX-only queries - refresh: If True, refresh balances from exchanges. If False, return cached state. Returns: Dict containing account states with connector balances and token information # Root Source: https://condor.hummingbot.org/api-reference/root /api-reference/openapi.json get / API root endpoint returning basic information. # Create Or Update Script Source: https://condor.hummingbot.org/api-reference/scripts/create-or-update-script /api-reference/openapi.json post /scripts/{script_name} Create or update a script. Args: script_name: Name of the script (from URL path) script: Script object with content Returns: Success message when script is saved Raises: HTTPException: 400 if save error occurs # Create Or Update Script Config Source: https://condor.hummingbot.org/api-reference/scripts/create-or-update-script-config /api-reference/openapi.json post /scripts/configs/{config_name} Create or update script configuration. Args: config_name: Name of the configuration file config: Configuration dictionary to save Returns: Success message when configuration is saved Raises: HTTPException: 400 if save error occurs # Delete Script Source: https://condor.hummingbot.org/api-reference/scripts/delete-script /api-reference/openapi.json delete /scripts/{script_name} Delete a script. Args: script_name: Name of the script to delete Returns: Success message when script is deleted Raises: HTTPException: 404 if script not found # Delete Script Config Source: https://condor.hummingbot.org/api-reference/scripts/delete-script-config /api-reference/openapi.json delete /scripts/configs/{config_name} Delete script configuration. Args: config_name: Name of the configuration file to delete Returns: Success message when configuration is deleted Raises: HTTPException: 404 if configuration not found # Get Script Source: https://condor.hummingbot.org/api-reference/scripts/get-script /api-reference/openapi.json get /scripts/{script_name} Get script content by name. Args: script_name: Name of the script to retrieve Returns: Dictionary with script name and content Raises: HTTPException: 404 if script not found # Get Script Config Source: https://condor.hummingbot.org/api-reference/scripts/get-script-config /api-reference/openapi.json get /scripts/configs/{config_name} Get script configuration by config name. Args: config_name: Name of the configuration file to retrieve Returns: Dictionary with script configuration Raises: HTTPException: 404 if configuration not found # Get Script Config Template Source: https://condor.hummingbot.org/api-reference/scripts/get-script-config-template /api-reference/openapi.json get /scripts/{script_name}/config/template Get script configuration template with default values. Args: script_name: Name of the script to get template for Returns: Dictionary with configuration template and default values Raises: HTTPException: 404 if script configuration class not found # List Script Configs Source: https://condor.hummingbot.org/api-reference/scripts/list-script-configs /api-reference/openapi.json get /scripts/configs/ List all script configurations with metadata. Returns: List of script configuration objects with name, script_file_name, and other metadata # List Scripts Source: https://condor.hummingbot.org/api-reference/scripts/list-scripts /api-reference/openapi.json get /scripts/ List all available scripts. Returns: List of script names (without .py extension) # Get Storage Overview Source: https://condor.hummingbot.org/api-reference/storage/get-storage-overview /api-reference/openapi.json get /storage/ Get disk usage overview for bots directories (archived, instances, conf). # Get System Info Source: https://condor.hummingbot.org/api-reference/system/get-system-info /api-reference/openapi.json get /system/info Get the versions this API server runs and how its own container was deployed. Read-only, and never raises: when docker.sock is not mounted, the daemon is unreachable or this process cannot find its own container, the version fields are still reported and the container block is None. Returns: Dictionary with the API version, the hummingbot library version, the market-data tunables this process is running with, whether the Docker daemon could be reached, the API's own container (id, name, image, digest and compose labels), and whether that image is pinned, with a short reason and the override file name when it is. # Get System Resources Source: https://condor.hummingbot.org/api-reference/system/get-system-resources /api-reference/openapi.json get /system/resources Get host machine CPU, RAM, and disk usage. Returns: Dictionary with current CPU, memory, and disk utilization for the host. # Get Upgrade Preflight Source: https://condor.hummingbot.org/api-reference/system/get-upgrade-preflight /api-reference/openapi.json get /system/upgrade/preflight Report whether this API can replace its own container, and what it would cost. Read-only and never raises: a daemon that cannot be reached, a container that cannot be placed and a registry that cannot be read are all reported as can_upgrade false with a blocked_reason, because the caller of a destructive action needs a reason far more than it needs a 500. Returns: Dictionary with image_ref, current_digest, available_digest, up_to_date, the pinning verdict (pinned / pinned_reason / override_file), the compose project, working dir and config files, running_executors and running_bots, and can_upgrade with its blocked_reason (None only when the upgrade may be started). # Get Upgrade Status Source: https://condor.hummingbot.org/api-reference/system/get-upgrade-status /api-reference/openapi.json get /system/upgrade/status Report the current or last self-upgrade. Phases: idle (there has been none), pulling, recreating (this API is about to be replaced, so the next answer comes from the new one), done, failed. After a successful recreate the record is the one this API collected from the helper container on boot, including its exit code and the tail of its output. Returns: Dictionary with run_id, phase, detail, previous_digest, new_digest, exit_code and log_tail. # Start Upgrade Source: https://condor.hummingbot.org/api-reference/system/start-upgrade /api-reference/openapi.json post /system/upgrade Pull the published image and hand the container recreate to a helper container. The preflight is re-run here, so a server that became unupgradable since the caller last looked -- an executor started, another upgrade began, the daemon went away -- is refused rather than upgraded on a stale reading. Args: request: acknowledge_executor_loss, the caller's consent to every running executor being closed as SYSTEM_CLEANUP. Required when any is running. Returns: 202 with the run id and the initial phase. The API is replaced part-way through, so the result is read back from /system/upgrade/status after it restarts. Raises: HTTPException: 409 when the upgrade is refused. Nothing was pulled, and nothing on the server was changed. # Cancel Order Source: https://condor.hummingbot.org/api-reference/trading/cancel-order /api-reference/openapi.json post /trading/{account_name}/{connector_name}/orders/{client_order_id}/cancel Cancel a specific order by its client order ID. Args: account_name: Name of the account connector_name: Name of the connector client_order_id: Client order ID to cancel trading_pair: Trading pair for the order accounts_service: Injected accounts service Returns: Success message with cancelled order ID Raises: HTTPException: 404 if account/connector not found, 500 for cancellation errors # Get Active Orders Source: https://condor.hummingbot.org/api-reference/trading/get-active-orders /api-reference/openapi.json post /trading/orders/active Get active (in-flight) orders across all or filtered accounts and connectors. This endpoint fetches real-time active orders directly from the connectors' in_flight_orders property, providing current order status, fill amounts, and other live order data. Args: filter_request: JSON payload with filtering criteria Returns: Paginated response with active order data and pagination metadata Raises: HTTPException: 500 if there's an error fetching orders # Get Funding Payments Source: https://condor.hummingbot.org/api-reference/trading/get-funding-payments /api-reference/openapi.json post /trading/funding-payments Get funding payment history across all or filtered perpetual connectors. This endpoint retrieves historical funding payment records including funding rates, payment amounts, and position data at time of payment. Args: filter_request: JSON payload with filtering criteria Returns: Paginated response with funding payment data and pagination metadata Raises: HTTPException: 500 if there's an error fetching funding payments # Get Orders Source: https://condor.hummingbot.org/api-reference/trading/get-orders /api-reference/openapi.json post /trading/orders/search Get historical order data across all or filtered accounts from the database/registry. Orders come newest first. `pagination.next_cursor` is the cursor of the page's last order; pass it back as `cursor` to get the orders older than it. It is `null` on the last page. A cursor is a position, not a token: any `|` pages from that point back, whether or not the order exists. A cursor not in that format is refused with a 400. Args: filter_request: JSON payload with filtering criteria Returns: Paginated response with historical order data and pagination metadata # Get Position Mode Source: https://condor.hummingbot.org/api-reference/trading/get-position-mode /api-reference/openapi.json get /trading/{account_name}/{connector_name}/position-mode Get current position mode for a perpetual connector. Args: account_name: Name of the account connector_name: Name of the perpetual connector Returns: Dictionary with current position mode, connector name, and account name Raises: HTTPException: 400 if not a perpetual connector # Get Positions Source: https://condor.hummingbot.org/api-reference/trading/get-positions /api-reference/openapi.json post /trading/positions Get current positions across all or filtered perpetual connectors. This endpoint fetches real-time position data directly from the connectors, including unrealized PnL, leverage, funding fees, and margin information. Args: filter_request: JSON payload with filtering criteria Returns: Paginated response with position data and pagination metadata Raises: HTTPException: 500 if there's an error fetching positions # Get Trades Source: https://condor.hummingbot.org/api-reference/trading/get-trades /api-reference/openapi.json post /trading/trades Get trade history across all or filtered accounts with complex filtering. Args: filter_request: JSON payload with filtering criteria Returns: Paginated response with trade data and pagination metadata # Place Trade Source: https://condor.hummingbot.org/api-reference/trading/place-trade /api-reference/openapi.json post /trading/orders Place a buy or sell order using a specific account and connector. Args: trade_request: Trading request with account, connector, trading pair, type, amount, etc. accounts_service: Injected accounts service Returns: TradeResponse with order ID and trading details Raises: HTTPException: 400 for invalid parameters, 404 for account/connector not found, 500 for trade execution errors # Set Leverage Source: https://condor.hummingbot.org/api-reference/trading/set-leverage /api-reference/openapi.json post /trading/{account_name}/{connector_name}/leverage Set leverage for a specific trading pair on a perpetual connector. Args: account_name: Name of the account connector_name: Name of the perpetual connector request: Leverage request with trading pair and leverage value accounts_service: Injected accounts service Returns: Dictionary with success status and message Raises: HTTPException: 400 for invalid parameters or non-perpetual connector, 404 for account/connector not found, 500 for execution errors # Set Position Mode Source: https://condor.hummingbot.org/api-reference/trading/set-position-mode /api-reference/openapi.json post /trading/{account_name}/{connector_name}/position-mode Set position mode for a perpetual connector. Args: account_name: Name of the account connector_name: Name of the perpetual connector position_mode: Position mode to set (HEDGE or ONEWAY) Returns: Success message with status Raises: HTTPException: 400 if not a perpetual connector or invalid position mode # Backtesting Source: https://condor.hummingbot.org/bots/backtesting Use historical data to research controller parameters and validate behavior Backtesting simulates a controller config against historical candles. Use it to understand parameter sensitivity and to check that your strategy behaves as expected, not to predict exact live results. ## Philosophy Backtesting market making strategies can't perfectly simulate reality: 1. **Queue position**: order books are first in, first out, and exchanges don't tell you where your order sits in the queue. 2. **Path dependency**: if one fill differs between backtest and live, everything after it diverges. 3. **Order book depth**: on a thick book your order may never fill, even when the price touches your level. > [!WARNING] > > Don't trust absolute PnL numbers from backtests. Use backtesting as a **parameter research tool**, not a prediction engine. ## What backtesting is good for | Use case | Example | | - | - | | Parameter sensitivity | "What happens if I change portfolio allocation from 2% to 10%?" | | Behavior validation | "Does my strategy only sell after inventory reaches 30%?" | | Relative comparison | "Does configuration A generate more volume than B?" | | Strategy debugging | "Why did the bot stop trading in this scenario?" | ## Supported executors The Hummingbot backtesting engine simulates the executors a controller creates. It has simulators for these executor types: | Executor | Supported | | - | - | | Position Executor | Yes, including position hold | | DCA Executor | Yes | | Grid Executor | Yes | | Order Executor | Yes | | Arbitrage, XEMM, TWAP, LP executors | No | A controller that creates unsupported executors produces no trades for them in a backtest. ## Running a backtest in Condor Condor runs backtests with the **`backtest_chart`** routine. It sends a saved controller config to the Hummingbot API's backtesting engine, waits for the result, and draws an interactive chart. The routine is part of Condor's shared routine library, so you can run it from the Workspace, from Telegram, or through an agent. > [tab] Workspace > > 1. Open the [Routines](/webui/routines) page and select **backtest\_chart**. > 2. Pick a config in **config\_name** and fill in the other fields (see the table below). > 3. Run it. The summary and metrics appear in the run's result, and the interactive chart is saved as a report. > [tab] Telegram > > Send `/routines`, choose **backtest\_chart**, set the fields and run it. The chart is sent to the chat as an image. > [tab] Agent > > Ask an agent, for example: "Backtest `pmm_mister__balanced` on 5m candles for the last 30 days." (`pmm_mister__balanced` is the name an agent gives the `balanced` sample config when it uploads it.) Agents call the routine through `manage_routines`: > > ```python theme={null} > # Condor MCP tool call made by the agent > manage_routines( > action="run_async", > name="backtest_chart", > config={ > "config_name": "pmm_mister__balanced", > "start_date": "2026-09-15", > "end_date": "2026-10-15", > "resolution": "5m", > }, > ) > ``` > > `run_async` returns straight away and hands the result back to the agent when the backtest finishes. ### Fields | Field | Default | Meaning | | - | - | - | | `config_name` | (empty) | Saved controller config to backtest. In the Workspace it's a dropdown of the server's configs. | | `start_date` | `2025-04-22` | First day, `YYYY-MM-DD` (UTC). | | `end_date` | `2025-04-23` | Last day, `YYYY-MM-DD` (UTC). | | `resolution` | `1m` | Candle resolution for the simulation: `1m`, `5m`, `15m` or `1h`. | | `trade_cost` | `0.0002` | Fee per trade as a decimal (`0.0002` = 0.02%). | | `chart` | `true` | Send the chart image to the chat. Turn it off for parameter sweeps; the chart is still saved in the web report. | | `task_id` | (empty) | Re-draw a saved backtest by its task ID instead of running a new one. | Each run gets a **Task ID**, shown in the summary. Results are stored in Condor for 30 days by default (`CONDOR_BACKTEST_RETENTION_DAYS`). If a run has fewer than 20 executors, the summary warns that the metrics are noise. Widen the date range or loosen the config and run it again. ### Candle resolution and look-ahead For controllers that trade on indicator signals, use a resolution no finer than the controller's own candle `interval`. > [!WARNING] > > The engine joins each controller's indicator candles to the simulation candles by the candle's **open** time. When the simulation resolution is finer than the controller's interval (for example, a 15m `bollinger_v1` run at `1m`), each 1m row inside a 15m candle already sees that 15m candle's final close and signal. The backtest trades on information it wouldn't have had live, so PnL and Sharpe come out better than they should. Backtest such controllers at their own interval (here, `15m`). > [!NOTE] > > `supertrend_v1` can't be backtested at the moment: the engine drops every row of its indicator data, and the run fails. Hummingbot's standalone script `scripts/backtest_pmm_mister.py` (run from a Hummingbot source checkout) defaults to `--resolution 1s` for market making. Condor's routine lists only `1m`, `5m`, `15m` and `1h`. ### Comparing backtests The **`backtest_compare`** routine overlays the PnL curves of saved backtests and ranks them in a metrics table. | Field | Default | Meaning | | - | - | - | | `task_ids` | (empty) | Comma-separated task IDs. Leave it blank to use the latest runs. | | `latest_n` | `3` | How many recent backtests to compare when `task_ids` is blank (2–6). | | `normalize_time` | `false` | Align every curve at t=0 so runs over different dates overlay. | ## Reading the chart The `backtest_chart` figure stacks up to four panes that share the time axis. Panes only appear when the backtest has data for them. | Pane | Content | | - | - | | **Price** | Price line (white), with the controller's Bollinger Bands when present, green or red background shading where the signal is long or short, and executor entry and exit markers. Grid executors also show their levels and fills. | | **MACD** | MACD histogram and signal line, only when the controller computes MACD. | | **Cumulative PnL** | PnL lines, active executor count and cumulative volume. | | **Position held** | Long and short inventory, net position and its unrealized PnL. Shown for controllers that hold positions. | The chart title shows net PnL, Sharpe ratio, profit factor, executor count and volume. ### PnL lines | Line | Colour | Meaning | | - | - | - | | **Total PnL** | Yellow, solid with a light fill | Everything combined | | **Executor Realized PnL** | Green, dotted | PnL from executors that closed | | **Position Realized PnL** | Blue, dotted | PnL realized from held positions | | **Position Unrealized PnL** | Purple, dotted | Open PnL on held positions | | **Active Executors** | Faint white area | Number of executors running at once (scaled to fit) | | **Cumulative Volume** | Cyan, dash-dot, right axis | Traded volume so far | ### Executor markers Each executor is drawn as an entry marker and an exit marker joined by a line. Markers are grouped by how the executor closed: | Legend entry | Colour and shape | Meaning | | - | - | - | | **TP Buy** / **TP Sell** | Green β–² / red β–Ό | Closed at take profit | | **SL Buy** / **SL Sell** | Orange β–² / β–Ό | Closed at stop loss | | **Hold Buy** / **Hold Sell** | Blue / purple ●, dotted line | Fill kept as inventory (position hold) | | **Early Stop Buy** / **Early Stop Sell** | Grey-white βœ•, dashed line | Stopped early, often an order refreshed before it filled | | **Other Buy** / **Other Sell** | Grey β–² / β–Ό | Any other close type, such as time limit | For TP, SL and Other markers the connecting line is green when the executor made money and red when it lost. ## Example analysis: 2% vs 10% allocation With `pmm_mister`, `portfolio_allocation` sets how much of the capital is quoted around the price. **2% allocation:** * Inventory builds gradually * Trading continues through drawdowns * More consistent activity **10% allocation:** * Inventory builds quickly * May reach `max_base_pct` during a drawdown * With `position_profit_protection` on, the controller won't sell below its break-even price, and above `max_base_pct` it won't buy either, so it stops trading until the position is profitable again ## PMM Mister parameters These `pmm_mister` fields have the most effect on backtest behaviour. Field names come from the controller's config class. | Parameter | Description | Example | | - | - | - | | `portfolio_allocation` | Fraction of capital quoted around the price | `0.02` (2%) | | `min_base_pct` | Below this inventory share, the controller stops placing orders that reduce the position | `0.3` (30%) | | `max_base_pct` | Above this inventory share, the controller stops placing orders that add to the position | `0.7` (70%) | | `max_active_executors_by_level` | Maximum active executors per price level | `20` | | `buy_cooldown_time` / `sell_cooldown_time` | Seconds to wait before replacing a level on that side | `30` | | `price_distance_tolerance` | Minimum distance from existing orders before a new one is placed at a level | `0.0002` | | `buy_position_effectivization_time` / `sell_position_effectivization_time` | Seconds after a fill before it's turned into held inventory | `1660` | | `position_profit_protection` | Block the reducing side while the price is worse than break-even | `true` | ## Trading bots vs Condor agents | Aspect | Trading bots | Condor agents | | - | - | - | | Logic | Deterministic, coded | LLM-driven decisions | | Tick speed | 1 second by default | Minutes (each loop sets its own interval) | | Backtesting | Supported for controllers | Not directly; agents backtest the controllers they deploy | | Use case | Market making, executing a fixed strategy | Oversight, choosing and tuning strategies | > [!TIP] > > Agents can backtest, deploy and retune controllers, but they act every few minutes, not every tick. The bot does the fast work; the agent supervises it. # Controllers Source: https://condor.hummingbot.org/bots/controllers V2 strategy components for algorithmic trading **Controllers** are V2 strategy components that implement algorithmic trading logic. They run inside bot containers and manage complex, multi-step trading strategies by creating and supervising executors. ## What Are Controllers? Controllers are Python classes that: * Define trading strategy logic * Process market data into a signal * Create and manage executors * Expose status and custom metrics ```mermaid theme={null} flowchart TB subgraph Bot["Bot Container"] C[Controller] C --> E1[Executor 1] C --> E2[Executor 2] C --> E3[Executor 3] end M[Market Data] --> C C --> O[Orders] ``` A single bot can run **multiple controllers** at once β€” each targeting a different market β€” within one container. ## Built-in Controllers Controllers ship under three `controller_type` categories. A selection of the built-ins: | `controller_type` | Controller (`controller_name`) | Description | | - | - | - | | `market_making` | `pmm_simple` | Two-sided market making with fixed spreads | | `market_making` | `pmm_dynamic` | Market making with spreads driven by volatility | | `directional_trading` | `bollinger_v1` | Bollinger Bands trend signal | | `directional_trading` | `dman_v3` | Multi-level directional strategy | | `directional_trading` | `macd_bb_v1` | MACD + Bollinger Bands signal | | `generic` | `grid_strike` | Grid of orders across a price range | | `generic` | `arbitrage_controller` | Cross-exchange arbitrage | | `generic` | `xemm_multiple_levels` | Cross-exchange market making | | `generic` | `pmm_mister` | Market making with position hold and profit protection | > [!NOTE] > > `directional_trading`, `market_making`, and `generic` are controller **types**, not controller names. The exact set of built-ins tracks the [Hummingbot repository](https://github.com/hummingbot/hummingbot/tree/development/controllers) β€” browse `controllers/` for the current list. ## Controller Structure A controller overrides two core methods from `ControllerBase`: * **`update_processed_data()`** β€” pull market data and compute a signal into `self.processed_data` * **`determine_executor_actions()`** β€” decide which executors to create or stop The specialized base classes `DirectionalTradingControllerBase` and `MarketMakingControllerBase` already implement `determine_executor_actions()` for you, so trend and market-making controllers typically only implement `update_processed_data()` and `get_candles_config()`. This is the `bollinger_v1` directional controller from the Hummingbot repository, with the CLI prompt metadata removed: ```python theme={null} from typing import List import pandas_ta as ta # noqa: F401 (registers the DataFrame.ta accessor) from pydantic import Field, field_validator from pydantic_core.core_schema import ValidationInfo from hummingbot.data_feed.candles_feed.data_types import CandlesConfig from hummingbot.strategy_v2.controllers.directional_trading_controller_base import ( DirectionalTradingControllerBase, DirectionalTradingControllerConfigBase, ) class BollingerV1ControllerConfig(DirectionalTradingControllerConfigBase): controller_name: str = "bollinger_v1" candles_connector: str = Field(default=None) candles_trading_pair: str = Field(default=None) interval: str = Field(default="3m") bb_length: int = Field(default=100) bb_std: float = Field(default=2.0) bb_long_threshold: float = Field(default=0.0) bb_short_threshold: float = Field(default=1.0) @field_validator("candles_connector", mode="before") @classmethod def set_candles_connector(cls, v, validation_info: ValidationInfo): if v is None or v == "": return validation_info.data.get("connector_name") return v @field_validator("candles_trading_pair", mode="before") @classmethod def set_candles_trading_pair(cls, v, validation_info: ValidationInfo): if v is None or v == "": return validation_info.data.get("trading_pair") return v class BollingerV1Controller(DirectionalTradingControllerBase): def __init__(self, config: BollingerV1ControllerConfig, *args, **kwargs): self.config = config self.max_records = self.config.bb_length super().__init__(config, *args, **kwargs) def get_candles_config(self) -> List[CandlesConfig]: return [CandlesConfig( connector=self.config.candles_connector, trading_pair=self.config.candles_trading_pair, interval=self.config.interval, max_records=self.max_records, )] async def update_processed_data(self): df = self.market_data_provider.get_candles_df( connector_name=self.config.candles_connector, trading_pair=self.config.candles_trading_pair, interval=self.config.interval, max_records=self.max_records, ) df.ta.bbands(length=self.config.bb_length, lower_std=self.config.bb_std, upper_std=self.config.bb_std, append=True) bbp = df[f"BBP_{self.config.bb_length}_{self.config.bb_std}_{self.config.bb_std}"] df["signal"] = 0 df.loc[bbp < self.config.bb_long_threshold, "signal"] = 1 df.loc[bbp > self.config.bb_short_threshold, "signal"] = -1 self.processed_data["signal"] = df["signal"].iloc[-1] self.processed_data["features"] = df ``` Market data comes from `self.market_data_provider` (e.g. `get_candles_df(...)`, `get_price_by_type(...)`), not from ad-hoc fetches. ## Controller Configuration Each controller instance is configured by a YAML file. This is a real `pmm_simple` config: ```yaml theme={null} id: pmm_simple_hype controller_name: pmm_simple controller_type: market_making total_amount_quote: '100' connector_name: hyperliquid trading_pair: HYPE-USDC buy_spreads: - 0.001 sell_spreads: - 0.001 buy_amounts_pct: - '1' sell_amounts_pct: - '1' executor_refresh_time: 60 cooldown_time: 15 leverage: 1 position_mode: HEDGE stop_loss: '0.005' take_profit: '0.002' time_limit: 2700 ``` ## Deploying a Controller The usual flow is: create one or more controller configs, then deploy a bot that runs them. You can create configs in the Workspace [Editor](/webui/bots#editor), in Telegram with `/new_bot` β†’ **βž• New** (for `grid_strike`, `pmm_mister` and `pmm_v1` only), or through the API. ### Via the Workspace On the [Bots](/webui/bots#deploy-bot) page, click **Deploy bot**, select one or more configs, and click **Deploy**. **Advanced Settings** holds the bot name, account, image and the two drawdown limits. ### Via Telegram `/new_bot` lists configs for the controller types Condor has Telegram forms for: `grid_strike`, `pmm_mister` and `pmm_v1`. Deploy other controllers from the Workspace or the API. ```text theme={null} /new_bot β†’ Pick the controller type, then select one or more configs β†’ πŸš€ Deploy β†’ Answer the prompts (instance name, credentials profile, drawdown limits, image) β†’ Deploy Now ``` ### Via API Deploy a bot from existing controller config files (without the `.yml` extension). You can pass several configs to run multiple controllers in one bot: ```bash theme={null} curl -u YOUR_USERNAME:YOUR_PASSWORD -X POST http://localhost:8000/bot-orchestration/deploy-v2-controllers \ -H "Content-Type: application/json" \ -d '{ "instance_name": "hype-mm", "credentials_profile": "master_account", "controllers_config": ["pmm_simple_hype"], "max_global_drawdown_quote": 50, "max_controller_drawdown_quote": 25 }' ``` The API appends a timestamp to the name, so the bot is called something like `hype-mm-20261015-143000`. The response returns it as `unique_instance_name`. ### Agent-owned controllers An agent can ship its own controller code and sample configs inside its folder, and push them to the server when it needs them. See [Agent architecture β†’ Controllers](/trading-agents/architecture#controllers). ## Starting and Stopping a Controller You can stop one controller without stopping its bot. Stopping turns on the controller's `manual_kill_switch`: it cancels its orders and stops opening new executors, but keeps its config. Starting turns the switch off again. * **Workspace**: select the controller on the [Bots](/webui/bots) page and click **Pause** or **Start**. * **Telegram**: `/bots` β†’ select the bot β†’ tap ⏸ or ▢️ next to the controller. * **Agents**: `manage_bots` with `action="stop_controllers"` or `"start_controllers"`, plus `bot_name` and `controller_names`. ## Updating a Running Controller Controllers can be reconfigured while running β€” no restart required. Only fields a controller marks as updatable are applied; everything else (for example, the connector name) is ignored on update. A config field is made updatable with `json_schema_extra`: ```python theme={null} from pydantic import Field total_amount_quote: Decimal = Field( default=Decimal("100"), json_schema_extra={"is_updatable": True}, ) ``` At runtime, `ControllerBase.update_config(new_config)` copies over only the fields flagged `is_updatable`. In Condor, select the running controller on the [Bots](/webui/bots) page, click **Config**, edit the YAML and click **Save**. Agents do the same with `manage_bots(action="update_config")`. ## Custom Controller Metrics Override `get_custom_info()` to publish controller-specific fields alongside the standard performance report. The payload is sent over MQTT to the Hummingbot API, so keep it small (recommended \< 1 KB): ```python theme={null} def get_custom_info(self) -> dict: return {"inventory_pct": float(self.current_inventory_pct)} ``` These fields are stored with each controller snapshot and surfaced per controller in the Workspace. ## Creating Custom Controllers 1. Create a new Python file under `controllers/` (in the matching `controller_type` subfolder) 2. Subclass the appropriate base β€” `ControllerBase`, `DirectionalTradingControllerBase`, or `MarketMakingControllerBase` 3. Implement `update_processed_data()` (and `determine_executor_actions()` if you subclass `ControllerBase` directly) 4. Add a config file and deploy it Custom controllers run in stock Hummingbot too. Upload them from the Workspace **Editor** (**Upload** β†’ **Controller (.py)**). Telegram's `/new_bot` β†’ **πŸ“€ Upload** takes YAML configs only. ## Monitoring Controllers The Hummingbot API records a snapshot of every running controller every 5 minutes, giving you a time series of P\&L and volume rather than a single point in time. ```bash theme={null} # Latest snapshot per controller curl -u YOUR_USERNAME:YOUR_PASSWORD "http://localhost:8000/bot-orchestration/controller-performance-latest?bot_name=hype-mm" # Time-series history (interval one of 5m, 15m, 30m, 1h, 4h, 12h, 1d) curl -u YOUR_USERNAME:YOUR_PASSWORD "http://localhost:8000/bot-orchestration/controller-performance-history?bot_name=hype-mm&controller_id=pmm_simple_hype&interval=5m" ``` In Condor, the [Bots](/webui/bots) page charts this history for a single controller, a bot, or any group of them. # How Bots Work Source: https://condor.hummingbot.org/bots/overview Docker containers for long-running trading automation **Bots** are Docker containers running Hummingbot instances for long-running automation tasks. They execute [Scripts](/bots/scripts) for simpler tasks or [Controllers](/bots/controllers) for algorithmic trading strategies. ## Bots vs Executors | Aspect | Executors | Bots | | - | - | - | | **Lifecycle** | Short-lived (minutes to hours) | Long-running (days to weeks) | | **Scope** | Single operation | Complex strategies | | **Control** | Agent-controlled | Autonomous or supervised | | **Use Case** | Individual trades | Continuous market making | ```mermaid theme={null} flowchart TB subgraph Agent["Condor Agent"] A[Agent Logic] end subgraph Bots["Bot Containers"] B1[Bot: MM Strategy] B2[Bot: Grid Trading] end subgraph Executors["Executors"] E1[Position Executor] E2[Order Executor] end A --> B1 & B2 A --> E1 & E2 B1 & B2 --> E1 & E2 ``` ## When to Use Bots | Scenario | Use | Reason | | - | - | - | | Single directional trade | Executor | Short-lived, defined outcome | | Continuous market making | Bot | Long-running, complex logic | | One-time swap | Executor | Simple, immediate | | Multi-leg arbitrage | Bot | Requires coordination | | LP position with time limit | Executor | Self-contained lifecycle | | 24/7 grid trading | Bot | Persistent, adaptive | ## Bot Lifecycle ### Creation A bot runs one or more saved controller configs. Create the configs first (see [Controllers](/bots/controllers)), then deploy a bot that runs them. **Workspace**: on the [Bots](/webui/bots#deploy-bot) page, click **Deploy bot**, select one or more configs, and click **Deploy**. **Telegram**: send `/new_bot`, select one or more configs, choose **πŸš€ Deploy**, and answer the prompts for instance name, credentials profile, drawdown limits and image. Telegram lists configs for `grid_strike`, `pmm_mister` and `pmm_v1` only. **API**: deploy a bot from existing controller config files (without `.yml`). Pass several configs to run multiple controllers in one bot: ```bash theme={null} curl -u YOUR_USERNAME:YOUR_PASSWORD -X POST http://localhost:8000/bot-orchestration/deploy-v2-controllers \ -H "Content-Type: application/json" \ -d '{ "instance_name": "my-market-maker", "credentials_profile": "master_account", "controllers_config": ["pmm_simple_1"] }' ``` The Hummingbot API appends a timestamp to `instance_name`, so the bot (and its Docker container) is named like `my-market-maker-20261015-143000`. The response returns the full name as `unique_instance_name`. Use that name in every later call. ### Starting and Stopping Start and stop work at two levels. **A single controller** pauses or resumes one strategy while the rest of the bot keeps running. Stopping a controller turns on its kill switch: it cancels its orders and stops opening new executors, but keeps its config. * **Workspace**: select the controller on the Bots page and click **Pause** or **Start**. * **Telegram**: `/bots` β†’ select the bot β†’ tap ⏸ or ▢️ next to the controller, or open the controller and use Stop / Start. **The whole bot**: stopping a bot stops its container and archives its data. It can't be restarted; deploy a new bot instead. * **Workspace**: select the bot and click **Stop bot**, then **Confirm**. * **Telegram**: `/bots` β†’ select the bot β†’ **πŸ›‘ Stop Bot** β†’ **βœ… Yes, Stop**. **API**: ```bash theme={null} # Stop and archive a bot curl -u YOUR_USERNAME:YOUR_PASSWORD -X POST http://localhost:8000/bot-orchestration/stop-and-archive-bot/my-market-maker-20261015-143000 # Stop the strategy inside a bot without removing the container curl -u YOUR_USERNAME:YOUR_PASSWORD -X POST http://localhost:8000/bot-orchestration/stop-bot \ -H "Content-Type: application/json" -d '{"bot_name": "my-market-maker-20261015-143000"}' ``` ### Monitoring **Workspace**: the [Bots](/webui/bots) page shows PnL, volume, win rate, open positions and executors for any bot, controller or group. Finished runs are under **Terminated**. **Telegram**: `/bots` lists running bots. Open one for its controllers and recent errors. **API**: ```bash theme={null} # Status of all bots curl -u YOUR_USERNAME:YOUR_PASSWORD http://localhost:8000/bot-orchestration/status # Status of a single bot curl -u YOUR_USERNAME:YOUR_PASSWORD http://localhost:8000/bot-orchestration/my-market-maker-20261015-143000/status ``` The Hummingbot API also records a snapshot of every running controller every 5 minutes, so you get a time series of PnL and volume rather than a single point. Query it with `/bot-orchestration/controller-performance-history` (see [Monitoring Controllers](/bots/controllers#monitoring-controllers)). The Bots page charts the same history. ### Logs * **Workspace**: select the bot and click **Logs**. * **Telegram**: `/bots` β†’ select the bot β†’ **πŸ“‹ Logs**. Each bot runs in its own Docker container named after the bot, so you can also read logs directly: ```bash theme={null} docker logs my-market-maker-20261015-143000 ``` ## Container Isolation Each bot runs in an isolated Docker container: * Separate filesystem * Own log stream * Can be stopped individually ## Integration with Agents Agents deploy and manage bots with the `manage_bots` tool. It takes an `action`: `deploy`, `status`, `logs`, `stop_bot`, `start_controllers`, `stop_controllers`, `get_config` or `update_config`. * `deploy` needs `bot_name` and `controllers_config`. Optional `max_global_drawdown_quote`, `max_controller_drawdown_quote`, `account_name` and `image` match the Workspace's advanced settings. * `status` takes no other arguments and reports every active bot. * `stop_bot` stops the bot **and archives it**. * `start_controllers` / `stop_controllers` need `bot_name` and `controller_names`. * `update_config` changes a running controller's config (`bot_name`, `config_name`, `config_data`). Saved configs and controller code are managed with `manage_controllers` (`list`, `describe`, `upsert`, `delete`). An agent can also carry its own controllers in its folder and push them to the server when it needs them. See [Agent architecture β†’ Controllers](/trading-agents/architecture#controllers) and, for a worked example, [Guide: Market Making Expert Agent](/examples/market-making-expert). # Scripts Source: https://condor.hummingbot.org/bots/scripts Single-file Hummingbot strategies, and how to deploy them through the Hummingbot API **Scripts** are single-file Hummingbot strategies. A script is a Python file with a config class and a strategy class. It runs inside a bot container, like a controller, but it's one self-contained program rather than a component that the bot hosts. > [!WARNING] > > Condor has no way to deploy a script. Telegram, the Workspace and the agent tools (`manage_bots`) only deploy controller configs. To run a script, call the Hummingbot API directly, as shown in [Deploying a script](#deploying-a-script). ## Scripts vs Controllers | Aspect | Scripts | Controllers | | - | - | - | | **Shape** | One file: config class + strategy class | Config + controller class, hosted by a bot | | **Several per bot** | No, one script per bot | Yes, several controllers per bot | | **Deploy from Condor** | No (Hummingbot API only) | Yes (Workspace, Telegram, agents) | | **Live config updates** | No | Yes, for fields marked updatable | | **Best for** | Quick automation, experiments | Strategies you run and tune over time | A controller bot is itself a script: the Hummingbot API deploys controllers by generating a config for the `v2_with_controllers.py` script. ## Example scripts The [Hummingbot repository](https://github.com/hummingbot/hummingbot/tree/master/scripts) ships example scripts, including: | Script | Description | | - | - | | `simple_pmm` | Places a bid and an ask around the mid or last price and refreshes them on a timer | | `simple_xemm` | Cross-exchange market making | | `simple_vwap` | Buys or sells a target amount in slices, VWAP style | | `v2_funding_rate_arb` | Funding-rate arbitrage across perpetual venues | > [!NOTE] > > The Hummingbot API mounts its own `bots/scripts` folder into each bot container, which replaces the scripts bundled in the image. Out of the box that folder holds only `v2_with_controllers.py`. Upload any other script before you deploy it (step 1 below). ## Script structure A script has a config class that subclasses `StrategyV2ConfigBase` and a strategy class that subclasses `StrategyV2Base`. The config's `script_file_name` ties a config file to its script, and `update_markets()` declares which connectors and pairs the bot needs. ```python theme={null} # scripts/mid_price_logger.py import os from pydantic import Field from hummingbot.core.data_type.common import MarketDict from hummingbot.strategy.strategy_v2_base import StrategyV2Base, StrategyV2ConfigBase class MidPriceLoggerConfig(StrategyV2ConfigBase): script_file_name: str = os.path.basename(__file__) exchange: str = Field(default="binance_paper_trade") trading_pair: str = Field(default="SOL-USDT") def update_markets(self, markets: MarketDict) -> MarketDict: markets[self.exchange] = markets.get(self.exchange, set()) | {self.trading_pair} return markets class MidPriceLogger(StrategyV2Base): def __init__(self, connectors, config: MidPriceLoggerConfig): super().__init__(connectors, config) self.config = config def on_tick(self): connector = self.connectors[self.config.exchange] mid_price = connector.get_mid_price(self.config.trading_pair) self.logger().info(f"{self.config.trading_pair} mid price: {mid_price}") ``` `on_tick()` runs on every clock tick (once per second by default). To place orders, call `self.buy(...)` or `self.sell(...)` with a connector name, trading pair, `Decimal` amount and an `OrderType` (from `hummingbot.core.data_type.common`). See `simple_pmm.py` in the Hummingbot repository for a full order-placing example. If you override `on_stop()`, make it `async` and call `await super().on_stop()`, because the base class uses it to shut down executors and market data. ## Deploying a script You need three things on the Hummingbot API server: the script, a script config, and a deploy call. All three are API calls. **1. Upload the script** `POST /scripts/{script_name}` saves `bots/scripts/{script_name}.py`. The body is JSON with the file's source in `content`: ```bash theme={null} python3 -c 'import json,sys; print(json.dumps({"content": open(sys.argv[1]).read()}))' mid_price_logger.py \ | curl -u YOUR_USERNAME:YOUR_PASSWORD -X POST http://localhost:8000/scripts/mid_price_logger \ -H "Content-Type: application/json" -d @- ``` **2. Save a script config** `POST /scripts/configs/{config_name}` saves `bots/conf/scripts/{config_name}.yml`. The config must include `script_file_name`, because that's how Hummingbot knows which script to run: ```bash theme={null} curl -u YOUR_USERNAME:YOUR_PASSWORD -X POST http://localhost:8000/scripts/configs/mid_price_logger_sol \ -H "Content-Type: application/json" \ -d '{ "script_file_name": "mid_price_logger.py", "exchange": "binance_paper_trade", "trading_pair": "SOL-USDT" }' ``` **3. Deploy the bot** `POST /bot-orchestration/deploy-v2-script` starts a container that runs the config: ```bash theme={null} curl -u YOUR_USERNAME:YOUR_PASSWORD -X POST http://localhost:8000/bot-orchestration/deploy-v2-script \ -H "Content-Type: application/json" \ -d '{ "instance_name": "sol-logger", "credentials_profile": "master_account", "script_config": "mid_price_logger_sol.yml" }' ``` | Field | Required | Meaning | | - | - | - | | `instance_name` | Yes | Bot name. The API appends a timestamp and returns the full name as `unique_instance_name`. | | `credentials_profile` | Yes | Account whose exchange keys the bot uses. | | `script_config` | Yes, in practice | File name of the config in `bots/conf/scripts`. The bot reads the script to run from this file's `script_file_name`. | | `image` | No | Docker image. Defaults to `hummingbot/hummingbot:latest`. | | `headless` | No | Run the bot without its terminal UI. Defaults to `false`. | | `script` | No | Recorded in the bot-run history only. It doesn't choose the script. | > [!NOTE] > > Starting a bot from a script config requires the Hummingbot API's config password (`CONFIG_PASSWORD`) to be set. Without it the deploy fails with "Password not provided". To stop a script bot, call `POST /bot-orchestration/stop-and-archive-bot/{bot_name}` with the full bot name. ## When to use scripts **Use scripts for:** * Quick, self-contained automation * Experiments and learning the Hummingbot framework **Use controllers for:** * Strategies you want to deploy and manage from Condor * Running several strategies in one bot with shared drawdown limits * Changing parameters while the bot runs # Skill: Agent Builder Source: https://condor.hummingbot.org/condor-agent/agent-builder How Condor's agent_builder skill creates trading agents, from a description or from a folder of your own controllers, configs and notes `agent_builder` is a skill that ships with the Condor assistant. When you ask Condor to create, edit, test, launch, monitor or delete a trading agent, it follows this skill. It works the same in the Workspace chat and in Telegram. The skill has two paths, and a few ways to skip both: | You bring | Path | | - | - | | An idea: "I want an agent for X" | **A: Build from a description.** Minimal first, then add pieces. | | A folder of instructions, controllers, configs or scripts | **B: Build from a folder.** Inventory, discuss, plan, then build. | | An exported agent file | Neither. Condor imports it (`manage_agents` `import`) and its routines and skills arrive switched off. | | An agent someone published on Botcamp | Neither. Install it from the [Agent Hub](/condor-agent/cloning-and-publishing-agents). Chat can't install it for you. | | One controller for an agent that already exists | Neither. Condor follows the shared `controller_sources` skill. | Condor labels each message with the step it is on, for example `[B2 β€” Discuss]`, so you can tell where you are. For a short walkthrough, see [Build Your First Agent](/getting-started/first-agent). ## What it builds Every agent the skill creates lives in `.condor/agents//` in your Condor install. The slug comes from the name you give the agent: `My Scalper` becomes `my_scalper`. | Piece | File | Written with | | - | - | - | | Agent | `AGENT.md` | `manage_agents` | | Controllers | `controllers//.py`, `CONTROLLER.md`, `sample_configs/