Skip to main content
Trading Agents can be created using the /agent command in Telegram or by manually creating the required files.

Why Use Agent Builder?

The Agent Builder guides you through a structured process that:
  1. Defines your strategy in a structured way so the agent has context
  2. Creates market data routines so analysis is deterministic and reproducible
  3. Builds decision logic in agent.md with rules and constraints
  4. Tests reasoning first before risking real money
  5. Deploys with confidence after verifying behavior
This flow exists because agents that work well require iteration. You want to verify the agent’s reasoning before letting it trade.

5-Phase Development Flow

Run Modes

These modes exist for debugging—you don’t want to put an agent to trade without understanding its reasoning first. Recommended flow: Start with dry_run to verify reasoning, then run_once to test with real money, then loop when confident.

Via Telegram

Use /agentSwitch ModeAgent Builder to start the guided flow:

Phase 1: Strategy Design

The Agent Builder asks questions to understand your goals:
You’ll answer questions about:
  • Strategy type (grid, DCA, momentum, etc.)
  • Direction (long only, short only, or both)
  • Budget allocation
  • Timeframe (scalping, intraday, swing)
  • Risk tolerance

Phase 2: Market Data Routine

The Agent Builder creates a Python routine to fetch and analyze market data:
The routine fetches candles, order book data, and calculates indicators. This routine runs deterministically—same input always produces same output. The agent doesn’t spend tokens computing indicators at runtime.

Phase 3: Strategy Logic

The Agent Builder generates agent.md with your decision rules. You can review and refine:

Phase 4: Dry Run

Test reasoning without real trading:
The dry run shows:
  • What data the agent received
  • How it reasoned about the data
  • What decision it would make
Review the dry run in the web dashboard under Agents → [Agent] → Sessions.

Phase 5: Deploy

When confident, start a live session:

Manual Creation

Create a new agent directory with the required files:

Directory Structure

agent.md

The strategy definition with YAML frontmatter and Markdown instructions:

learnings.md

Start with an empty learnings file—the agent populates it as it learns:
When the agent discovers something valuable—like “price below EMA 7 while EMA 7 > EMA 25 indicates weakness”—it writes it to this file. Learnings persist across sessions.

Inspecting Agent Sessions

View agent sessions in the web dashboard:
For each session you can see:
  • Snapshots: Every tick’s system prompt, agent response, and actions taken
  • Dry Runs: Test sessions without real trading
  • Executors: All executors created by the agent with P&L
  • Learnings: Insights the agent has accumulated

Analyzing Snapshots

Each snapshot shows:
  • System Prompt: Everything the agent received (strategy, configs, market data)
  • Agent Response: The agent’s reasoning and decision
  • Actions: Executors created, routines called
This lets you understand exactly why the agent made each decision.

Common Patterns

Grid Scalping

Deploy grids that straddle current price with tight take-profits:

Dynamic Grid Replacement

Replace grids when price moves significantly:

One Position Constraint

Many exchanges (like Hyperliquid) only allow one position per pair:

Best Practices

Always test reasoning before real trading. The dry run shows exactly what the agent would do without risking money.
Move indicator calculations into routines. The agent shouldn’t spend tokens computing EMAs—that should be deterministic code.
Structure agent.md with explicit steps: 1) Run analysis, 2) Make decision, 3) Execute. This makes the agent’s reasoning predictable.
The agent writes observations to learnings.md. Review these to understand what the agent is learning and refine accordingly.