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.
Global routines in ~/condor/routines/ are available to all agents. Condor includes several built-in routines for common trading tasks.
Built-in Routines
| Routine | Type | Description |
|---|
hello_world | One-shot | Simple example routine for testing |
market_scanner | One-shot | Scan markets for trading opportunities |
bot_report | One-shot | Generate performance reports for running bots |
arb_check | One-shot | Check for arbitrage opportunities across exchanges |
price_monitor | Continuous | Monitor price and alert on threshold changes |
Directory Structure
~/condor/routines/
βββ __init__.py
βββ base.py # Routine discovery and base classes
βββ hello_world.py # Simple example routine
βββ market_scanner.py # Market scanning routine
βββ bot_report.py # Bot performance reports
βββ arb_check.py # Arbitrage checking
βββ price_monitor.py # Continuous price monitoring
Hello World Example
The simplest routine to understand the structure:
# routines/hello_world.py
from pydantic import BaseModel, Field
from telegram.ext import ContextTypes
class Config(BaseModel):
"""Simple hello world example routine."""
name: str = Field(default="World", description="Name to greet")
repeat: int = Field(default=1, description="Number of times to repeat")
uppercase: bool = Field(default=False, description="Use uppercase")
async def run(config: Config, context: ContextTypes.DEFAULT_TYPE) -> str:
"""Execute the routine."""
greeting = f"Hello, {config.name}!"
if config.uppercase:
greeting = greeting.upper()
return "\n".join([greeting] * config.repeat)
Run it from Telegram:
/routines β hello_world β Run
Output: Hello, World!
Price Monitor (Continuous)
A continuous routine that monitors price and sends alerts:
# routines/price_monitor.py
from pydantic import BaseModel, Field
from telegram.ext import ContextTypes
# Mark as continuous routine
CONTINUOUS = True
class Config(BaseModel):
"""Live price monitor with configurable alerts."""
connector: str = Field(default="binance", description="CEX connector name")
trading_pair: str = Field(default="BTC-USDT", description="Trading pair to monitor")
threshold_pct: float = Field(default=1.0, description="Alert threshold in %")
interval_sec: int = Field(default=10, description="Check interval in seconds")
async def run(config: Config, context: ContextTypes.DEFAULT_TYPE) -> str:
"""Monitor price continuously until cancelled."""
chat_id = context._chat_id
client = await get_client(chat_id, context=context)
initial_price = None
last_price = None
try:
while True:
prices = await client.market_data.get_prices(
connector_name=config.connector,
trading_pairs=config.trading_pair
)
current_price = prices["prices"].get(config.trading_pair)
if initial_price is None:
initial_price = current_price
last_price = current_price
# Check threshold and alert if triggered
change = ((current_price - last_price) / last_price) * 100
if abs(change) >= config.threshold_pct:
await context.bot.send_message(
chat_id=chat_id,
text=f"{'π' if change > 0 else 'π'} {config.trading_pair}: ${current_price:,.2f} ({change:+.2f}%)"
)
last_price = current_price
await asyncio.sleep(config.interval_sec)
except asyncio.CancelledError:
return "Monitor stopped"
Creating Custom Global Routines
Add your own routines to ~/condor/routines/:
- Create a Python file with
Config class and run function
- The routine is auto-discovered on next Condor start
- Access via
/routines in Telegram
Global routines are shared across all agents. For agent-specific routines, place them in the agentβs routines/ folder instead.