Inventory (also called Position Hold) is the virtual portfolio that tracks a Trading Agentβs cumulative trading impact. It enables accurate P&L attribution when multiple agents share the same exchange accounts.Documentation Index
Fetch the complete documentation index at: https://condor.hummingbot.org/llms.txt
Use this file to discover all available pages before exploring further.
Why Inventory Tracking?
When multiple agents trade on shared accounts, you need to know:- Which agent made which trades
- Each agentβs individual P&L
- Total exposure per agent
controller_id (agent ID).
Position Hold
Each position is uniquely keyed by(connector_name, trading_pair):
Two agents can trade the same pair on the same exchange, and each maintains their own separate position with their own breakeven price and P&L.
Position Types
| Type | Connectors | Description |
|---|---|---|
| Spot | binance, coinbase, jupiter | Standard buy/sell positions |
| Perp | binance_perpetual, hyperliquid_perpetual | Leveraged long/short positions |
| LP | meteora, uniswap_v3 | Liquidity provider positions |
Trading Pair Format
amount is always in base asset. All P&L is in quote asset.
Position State
Each position tracks cumulative trading activity:| Field | Description |
|---|---|
buy_amount_base | Total base asset bought |
buy_amount_quote | Total quote spent on buys |
sell_amount_base | Total base asset sold |
sell_amount_quote | Total quote received from sells |
cum_fees_quote | Cumulative fees paid |
Derived Values
Net Amount:buy_amount_base - sell_amount_base
Side:
- Positive net β Long (BUY)
- Negative net β Short (SELL)
- Zero net β Closed
P&L Calculation
All P&L values are in quote asset.Unrealized P&L
Mark-to-market value at current price:Realized P&L
When positions are reduced (buys matched against sells):Global P&L
Example
Trade 1: Buy 100 SOL at $150Via API
Related
- Position Handover - How executors add to inventory
- Executors - Trading operations that create positions

