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.
PriceType
Enum defining different types of prices used in the framework. Source:hummingbot/core/data_type/common.py:52
Mid-market price (average of best bid and best ask)
Best (highest) bid price in the order book
Best (lowest) ask price in the order book
Price of the last executed trade
Price of the last trade executed by the bot
Inventory cost price
Custom price type
PositionAction
Enum defining position actions for derivatives trading. Source:hummingbot/core/data_type/common.py:33
Open a new position
Close an existing position
No position action (for spot trading)
PositionSide
Enum defining position sides for derivatives exchanges. Source:hummingbot/core/data_type/common.py:40
Long position (betting on price increase)
Short position (betting on price decrease)
Both long and short positions (for hedge mode)
PositionMode
Enum defining position modes for derivatives exchanges. Source:hummingbot/core/data_type/common.py:47
Hedge mode - allows simultaneous long and short positions
One-way mode - only one position direction at a time
OrderBookMessageType
Enum defining types of order book messages. Source:hummingbot/core/data_type/order_book_message.py:9
Full order book snapshot
Incremental order book update (diff)
Trade message
OrderBookMessage
NamedTuple representing an order book message. Source:hummingbot/core/data_type/order_book_message.py:16
Type of the message (SNAPSHOT, DIFF, or TRADE)
Message content containing order book data
Message timestamp
Properties
Update ID for SNAPSHOT and DIFF messages, -1 for TRADE messages
First update ID for DIFF messages, -1 otherwise
Trade ID for TRADE messages, -1 otherwise
Trading pair for the message
List of ask (sell) orders
List of bid (buy) orders
True if the message has an update ID (SNAPSHOT or DIFF)True if the message has a trade ID (TRADE)OrderBookRow
NamedTuple representing a row in an order book. Source:hummingbot/core/data_type/order_book_row.py:7
Used to apply changes to OrderBook. OrderBook classes use float internally for better performance over Decimal.
Price level
Order amount at this price level
Update ID associated with this row
ClientOrderBookRow
NamedTuple representing an order book row with Decimal precision. Source:hummingbot/core/data_type/order_book_row.py:16
Used in market classes where OrderBook values are converted to Decimal for precision.
Price level (high precision)
Order amount at this price level (high precision)
Update ID associated with this row
OrderUpdate
NamedTuple representing an order status update. Source:hummingbot/core/data_type/in_flight_order.py:39
Trading pair for the order
Timestamp of the update (in seconds)
New state of the order
Client-assigned order identifier
Exchange-assigned order identifier
Additional miscellaneous update information
TokenAmount
Dataclass representing an amount of a specific token. Source:hummingbot/core/data_type/trade_fee.py:19
Token symbol (e.g., “BTC”, “USDT”)
Amount of the token
Methods
Allows unpacking as tuple:
token, amount = token_amountConverts to a JSON-serializable dictionary
Creates a TokenAmount from a JSON dictionary
TradeFeeSchema
Dataclass containing the information needed to build a TradeFee object. Source:hummingbot/core/data_type/trade_fee.py:39
Token in which the percentage fee is charged (if always charged in a specific token, e.g., BNB on Binance)
Maker fee as a decimal (e.g., 0.001 for 0.1%)
Taker fee as a decimal (e.g., 0.001 for 0.1%)
Whether buy fees are deducted from returns instead of added to costs
Fixed fees charged for maker orders
Fixed fees charged for taker orders
TradeFeeBase
Abstract base dataclass representing a trade fee for a particular order. Source:hummingbot/core/data_type/trade_fee.py:75
Percentage fee as a decimal
Token in which the percentage fee is charged (only set for third-token fees like Binance BNB)
List of flat fees (token, amount) tuples
Properties
The asset in which the fee is paid (either percent_token or first flat fee token)
Methods
Creates a new spot trading fee instance
Creates a new perpetual trading fee instance
Creates a TradeFeeBase instance from a JSON dictionary
Converts the fee to a JSON-serializable dictionary
Calculates the fee amount expressed in a specific token
Abstract method - returns the impact of the fee on cost requirements for a candidate order
Abstract method - returns the impact of the fee on expected returns from a candidate order
AddedToCostTradeFee
Trade fee that is added to the order cost. Source:hummingbot/core/data_type/trade_fee.py:251
Inherits from TradeFeeBase. Used when fees are added to the cost of the order (typical for buy orders).
DeductedFromReturnsTradeFee
Trade fee that is deducted from the order returns. Source:hummingbot/core/data_type/trade_fee.py:292
Inherits from TradeFeeBase. Used when fees are deducted from the returns of the order (typical for sell orders).
MakerTakerExchangeFeeRates
Frozen dataclass representing maker and taker fee rates for an exchange. Source:hummingbot/core/data_type/trade_fee.py:321
Maker fee rate as a decimal
Taker fee rate as a decimal
Flat fees for maker orders
Flat fees for taker orders