Documentation Index
Fetch the complete documentation index at: https://mintlify.com/hummingbot/hummingbot/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Hummingbot supports multiple order types for executing trades across different exchange types. The order type determines how your order is placed, matched, and executed.Core Order Types
Order types are defined inhummingbot/core/data_type/common.py:
hummingbot/core/data_type/common.py:8-18.
Market Orders
MARKET
Market orders execute immediately at the best available price.Characteristics:
- Guaranteed execution (if liquidity exists)
- Price is not guaranteed
- Takes liquidity from the order book (you’re a “taker”)
- Pays taker fees
- You need immediate execution
- Price certainty is less important than fill certainty
- You’re closing a position quickly
Limit Orders
LIMIT
Limit orders execute at a specified price or better.Characteristics:
- Price is guaranteed (or better)
- Execution is not guaranteed
- Can be maker or taker depending on whether you cross the spread
- Maker orders earn rebates, taker orders pay fees
- You want price control
- You’re providing liquidity (market making)
- You can wait for execution
Limit Maker Orders
LIMIT_MAKER
Limit maker orders are limit orders that will only execute as maker orders.Characteristics:
- Guaranteed to pay maker fees (or earn rebates)
- Order is rejected if it would immediately match (become a taker)
- Ensures you’re always providing liquidity
- Also called “post-only” orders
- You’re market making and need maker fee rates
- You want to ensure you’re providing liquidity
- Your strategy depends on maker rebates
Not all exchanges support
LIMIT_MAKER. Check TradingRule.supports_limit_orders before using.AMM-Specific Order Types
AMM DEX connectors use specialized order types for liquidity operations:Swap Orders
AMM_SWAP
Swaps execute token exchanges on AMM pools.Characteristics:
- Executes at current pool price (plus slippage)
- Price is determined by pool ratio (x*y=k)
- Requires gas fees
- Subject to slippage and MEV
- Trading on AMM DEXs (Uniswap, PancakeSwap, etc.)
- You need to swap tokens without an order book
Liquidity Management Orders
AMM_ADD
Add liquidity to an AMM or CLMM pool.Use When:
- Providing liquidity to earn trading fees
- Implementing LP strategies
- Adding to Uniswap V3 positions
AMM_REMOVE
Remove liquidity from an AMM or CLMM pool.Use When:
- Withdrawing liquidity from pools
- Rebalancing LP positions
- Closing LP positions
hummingbot/core/data_type/common.py:13-14.
Trading Rule Constraints
Each exchange enforces trading rules that constrain order placement. These are stored in theTradingRule class:
hummingbot/connector/trading_rule.pyx:11-40.
Example: Checking Trading Rules
Order Lifecycle
Orders go through several states during their lifecycle:Order Events
Strategies can listen to order events to react to state changes:Trade Types
Orders are directional (buy or sell):hummingbot/core/data_type/common.py:62-65.
Related Concepts
- Exchange Types - Different exchanges support different order types
- Connectors - How orders are submitted to exchanges
- Market Data - Order book data for price discovery