Skip to main content

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.

OrderType

Enum defining the types of orders supported by Hummingbot. Source: hummingbot/core/data_type/common.py:8
MARKET
int
default:"1"
Market order - executed immediately at the current market price
LIMIT
int
default:"2"
Limit order - executed only at the specified price or better
LIMIT_MAKER
int
default:"3"
Limit maker order - ensures the order is posted to the order book and not immediately filled
AMM_SWAP
int
default:"4"
AMM swap order - swap tokens through an automated market maker
AMM_ADD
int
default:"5"
Add liquidity to AMM/CLMM pool
AMM_REMOVE
int
default:"6"
Remove liquidity from AMM/CLMM pool

Methods

is_limit_type()
bool
Returns True if the order type is LIMIT or LIMIT_MAKER

OrderState

Enum representing the lifecycle states of an order. Source: hummingbot/core/data_type/in_flight_order.py:25
PENDING_CREATE
int
default:"0"
Order creation is pending
OPEN
int
default:"1"
Order is open and active on the exchange
PENDING_CANCEL
int
default:"2"
Order cancellation is pending
CANCELED
int
default:"3"
Order has been canceled
PARTIALLY_FILLED
int
default:"4"
Order has been partially filled
FILLED
int
default:"5"
Order has been completely filled
FAILED
int
default:"6"
Order has failed
PENDING_APPROVAL
int
default:"7"
Order is pending approval (e.g., for DEX transactions)
APPROVED
int
default:"8"
Order has been approved
CREATED
int
default:"9"
Order has been created
COMPLETED
int
default:"10"
Order has been completed

OpenOrder

NamedTuple representing an open order on an exchange. Source: hummingbot/core/data_type/common.py:20
client_order_id
str
Client-assigned unique identifier for the order
trading_pair
str
Trading pair for the order (e.g., “BTC-USDT”)
price
Decimal
Order price
amount
Decimal
Order amount
executed_amount
Decimal
Amount already executed
status
str
Order status
order_type
OrderType
Type of the order
is_buy
bool
True if the order is a buy order, False if sell
time
int
Order creation timestamp
exchange_order_id
str
Exchange-assigned order identifier

MarketOrder

NamedTuple representing a market order. Source: hummingbot/core/data_type/market_order.py:8
order_id
str
Unique identifier for the order
trading_pair
str
Trading pair for the order
is_buy
bool
True for buy orders, False for sell orders
base_asset
str
Base asset of the trading pair
quote_asset
str
Quote asset of the trading pair
amount
float
Order amount
timestamp
float
Order creation timestamp
position
PositionAction
default:"PositionAction.NIL"
Position action (for derivatives)

Methods

to_pandas(market_orders)
classmethod
Converts a list of MarketOrder objects to a pandas DataFrame
order_type()
OrderType
Returns OrderType.MARKET
copy_with_id(client_order_id)
MarketOrder
Creates a copy of the order with a new client order ID

OrderCandidate

Dataclass containing a complete picture of the impact of a potential order on the user account. Source: hummingbot/core/data_type/order_candidate.py:17
WARNING: Do not use this class for sizing. Instead, use the BudgetChecker.
trading_pair
str
Trading pair for the order
is_maker
bool
Whether the order is a maker order
order_type
OrderType
Type of the order
order_side
TradeType
Side of the order (BUY or SELL)
amount
Decimal
Order amount
price
Decimal
Order price
order_collateral
Optional[TokenAmount]
Base collateral required for the order
percent_fee_collateral
Optional[TokenAmount]
Percentage-fee collateral
percent_fee_value
Optional[TokenAmount]
Percentage fee value
fixed_fee_collaterals
List[TokenAmount]
Fixed-fee collaterals
potential_returns
Optional[TokenAmount]
Potential return of the order
resized
bool
default:"False"
Whether the order has been resized
from_total_balances
bool
default:"False"
Whether the order is from total balances

Properties

collateral_dict
Dict
Dictionary mapping tokens to their required collateral amounts
is_zero_order
bool
True if the order amount is zero

Methods

get_size_token_and_order_size()
TokenAmount
Returns the size token and order size
set_to_zero()
None
Sets the order amount to zero
populate_collateral_entries(exchange)
None
Populates all collateral entries based on the exchange
adjust_from_balances(available_balances)
None
Adjusts the order based on available balances

PerpetualOrderCandidate

Extends OrderCandidate for perpetual derivative orders. Source: hummingbot/core/data_type/order_candidate.py:271
leverage
Decimal
default:"1"
Leverage for the order
position_close
bool
default:"False"
Whether this order closes a position