Documentation Index
Fetch the complete documentation index at: https://mintlify.com/deniszidbaev-cmyk/polyclaw-trading/llms.txt
Use this file to discover all available pages before exploring further.
PolyClaw Trading is entirely environment-driven. The file .env.example in the repository root is the exhaustive template; copy it to .env.local (which is gitignored) and fill in only the variables you need. Every variable is read once at startup by EngineConfig.from_env() in src/polyclaw_engine/config.py.
Malformed values raise ConfigError — there is no silent repair. Missing variables receive their documented defaults, but any variable that is present with an invalid value (wrong type, out-of-range number, a flag that is not exactly 0 or 1) causes the engine to fail at startup. Secrets must never appear in tracked files or logs; keep them in .env.local or environment variables only.
To get started:
cp .env.example .env.local
# Fill in the variables you need, then:
uv run python run_pipeline.py audit
uv run python run_pipeline.py dry-run
1. Wallet & connectivity
These variables identify the Polymarket wallet and configure network access. POLYCLAW_PATH and POCLAW_PATH locate the PolyClaw CLI binary used for live order submission.
| Variable | Default | Valid range / notes |
|---|
POLYMARKET_WALLET_ADDRESS | (empty) | Your Polymarket wallet address. Required for live trading. |
POLYCLAW_PRIVATE_KEY | (empty) | Wallet private key. Never commit this value. Required for live trading. |
CHAINSTACK_NODE | (empty) | Chainstack RPC node URL (with embedded token). Keep in .env.local only. |
POLYCLAW_PATH | (empty) | Absolute path to the PolyClaw CLI binary. NUL bytes are rejected. |
POCLAW_PATH | (empty) | Backward-compatible typo alias for POLYCLAW_PATH. Prefer POLYCLAW_PATH. |
HTTPS_PROXY | (empty) | Optional HTTPS proxy URL. Credentials in the URL are redacted from logs. |
CLOB_MAX_RETRIES | 10 | Maximum retry attempts for CLOB API calls. |
POLYCLAW_COMMAND_TIMEOUT_SEC | 30 | Timeout in seconds for each PolyClaw subprocess invocation. |
2. Bankroll
These variables set the starting capital and configure where the engine stores its runtime state.
| Variable | Default | Valid range / notes |
|---|
BANK_USD | 100 | Starting bankroll in USD. Used as fallback when BANKROLL_USD is absent. |
BANKROLL_USD | 100 | Working bankroll in USD. Takes precedence over BANK_USD when set. Range: 0 – 1,000,000,000. |
RUNTIME_DIR | runtime | Directory path where all runtime JSON files are written. Relative paths are resolved from the project root. |
3. Safety gates
These are the primary circuit-breaker controls. All default to the safest possible value.
| Variable | Default | Valid values | Behavior |
|---|
LIVE_TRADING | 0 | 0 or 1 | Hard gate. 0 logs orders without executing them. 1 sends orders via PolyClaw. The exact string 1 is required; any other value raises ConfigError. |
ALLOW_REDEEM | 0 | 0 or 1 | Enables automatic redeem on resolved markets. Opt-in only. |
PANIC_STOP | 0 | 0 or 1 | 1 halts all trade-gate execution immediately. The gate also halts while runtime/panic_stop.flag exists. |
PANIC_AUTO_THRESHOLD | 5 | Integer ≥ 0 | After this many consecutive failed live orders, the trade gate creates runtime/panic_stop.flag and halts. Set to 0 to disable auto-trip. |
The dry-run command in run_pipeline.py and polyclaw-mac pins LIVE_TRADING=0 and ALLOW_REDEEM=0 regardless of what .env.local contains. This pin cannot be overridden by value tails or environment injection.
4. Trade sizing
These variables control the size of individual orders. The engine takes the minimum of all active capital caps before submitting any order.
| Variable | Default | Valid range | Behavior |
|---|
MIN_TRADE_USD | 0.25 | 0.01 – 1,000,000 | Minimum order size in USD. Orders sized below this threshold are not submitted. |
MAX_TRADE_USD | 1.00 | 0.01 – 1,000,000 | Maximum order size in USD. MIN_TRADE_USD must not exceed this. |
BASE_RISK_PER_TRADE_PCT | 1.0 | 0.01 – 100 | Percentage of working bankroll risked per trade at baseline confidence. |
MAX_POSITION_BANKROLL_PCT | 5.0 | 0.01 – 100 | Hard cap: a single position cannot exceed this percentage of the working bankroll. |
MIN_TRADE_RISK_PCT | 1 | 0.01 – 100 | Minimum risk percentage applied per trade. |
MAX_TRADE_RISK_PCT | 2 | 0.01 – 100 | Maximum risk percentage applied per trade. |
MIN_CONVICTION | 0.55 | 0.0 – 1.0 | Minimum conviction threshold below which a trade is not sized. |
5. Daily & exposure limits
These variables enforce aggregate daily limits and cap the total open exposure at any point in time.
| Variable | Default | Valid range | Behavior |
|---|
MAX_DAILY_RISK_PCT | 8 | 0 – 100 | Maximum cumulative risk as a percentage of bankroll per UTC day. |
MAX_DAILY_NOTIONAL_PCT | 20 | 0 – 100 | Maximum cumulative notional deployed per UTC day. |
MAX_OPEN_EXPOSURE_PCT | 20 | 0 – 100 | Maximum combined open position exposure as a percentage of bankroll. |
MAX_OPEN_BANK_EXPOSURE_PCT | 50 | 0 – 100 | Maximum open exposure as a percentage of the total bank (equity). |
MAX_TRADES_PER_DAY | 6 | 0 – 10,000 | Hard cap on the number of executions per UTC day (dry-run entries count). |
6. Drawdown
The drawdown system reduces position sizing when cumulative losses reach the trigger and does not restore normal sizing until losses recover to the recovery level.
| Variable | Default | Valid range | Behavior |
|---|
DRAWDOWN_TRIGGER_PCT | 10 | 0.1 – 99 | Drawdown percentage at which the engine enters reduced-risk mode. Must exceed DRAWDOWN_RECOVERY_PCT. |
DRAWDOWN_RECOVERY_PCT | 5 | 0 – 99 | Drawdown percentage below which the engine exits reduced-risk mode. Must be strictly less than DRAWDOWN_TRIGGER_PCT. |
DRAWDOWN_REDUCED_TRADE_RISK_PCT | 1 | 0.01 – 100 | Per-trade risk percentage applied while in reduced-risk (drawdown) mode. |
DRAWDOWN_REDUCED_DAILY_RISK_PCT | 10 | 0 – 100 | Daily risk cap applied while in reduced-risk (drawdown) mode. |
DAILY_PROFIT_RESERVE_SHARE | 0.50 | 0.0 – 1.0 | Fraction of daily profit above the reserve trigger that is locked as reserve and excluded from position sizing. |
DAILY_PROFIT_RESERVE_TRIGGER_PCT | 5 | 0 – 100 | Daily profit percentage above which the reserve lock activates. |
DAILY_PROFIT_RESERVE_LOCK_PCT | 50 | 0 – 100 | Percentage of profits above the trigger that are locked as reserve. |
Drawdown multipliers applied to BASE_RISK_PER_TRADE_PCT: normal 1.00×, reduced 0.50×, critical 0.25×. Critical mode begins at twice DRAWDOWN_TRIGGER_PCT.
7. Stop/take levels
These variables define the ATR-based stop-loss and take-profit multipliers used for planned exit levels and the minimum reward-to-risk ratio check.
| Variable | Default | Valid range | Behavior |
|---|
MIN_REWARD_RISK_RATIO | 1.5 | 0.1 – 100 | Minimum required ratio of TAKE_PROFIT_ATR_MULTIPLIER to STOP_LOSS_ATR_MULTIPLIER. Startup validation enforces this relationship. |
STOP_LOSS_ATR_MULTIPLIER | 1.5 | 0.01 – 100 | Stop-loss distance expressed as a multiple of ATR14. |
TAKE_PROFIT_ATR_MULTIPLIER | 2.5 | 0.01 – 100 | Take-profit distance expressed as a multiple of ATR14. |
MAX_ENTRY_SLIPPAGE_PCT | 0.05 | 0.0 – 1.0 | Maximum acceptable slippage between the signal price and the live-price preflight. |
8. Market filters
These variables define the universe of acceptable markets. Every filter must pass for a market to be included in the pipeline.
| Variable | Default | Valid range / notes | |
|---|
MIN_MARKET_LIQUIDITY_USD | 100 | 0 – 1,000,000,000. Markets with total liquidity below this are rejected. | |
MIN_MARKET_VOLUME_24H_USD | 100 | 0 – 1,000,000,000. Markets with 24 h volume below this are rejected. | |
MAX_MARKET_MINUTES_TO_EXPIRY | 1440 | 2 – 1,000,000. Must exceed MIN_MARKET_MINUTES_TO_EXPIRY. | |
MIN_MARKET_MINUTES_TO_EXPIRY | 30 | 1 – 100,000. Markets expiring sooner than this are skipped. | |
MIN_ENTRY_PRICE | 0.05 | Strictly inside (0, 1). YES-token best ask must be above this. | |
MAX_ENTRY_PRICE | 0.95 | Strictly inside (0, 1). YES-token best ask must be below this. MIN_ENTRY_PRICE must be strictly less than this. | |
ALLOW_EXTREME_PRICE_STRATEGY | 0 | 0 or 1. Enables trading outside the normal price bounds when set to 1. | |
SUPPORTED_TIMEFRAMES | 5m,15m | Must be exactly 5m,15m. Any other value raises ConfigError. | |
MARKET_QUERY | btc,bitcoin | Must contain exactly the terms btc and bitcoin. | |
MIN_SEMANTIC_MAPPING_CONFIDENCE | 0.90 | (0, 1] | Minimum confidence for the outcome-to-direction semantic mapping. Must be positive. |
9. Signal quality
These variables tune the deterministic signal-scoring model. Weights must sum to exactly 1.0; penalties are subtracted after the weighted sum is computed.
| Variable | Default | Valid range | Behavior |
|---|
MIN_EXECUTION_CONFIDENCE | 0.72 | 0.0 – 1.0 | Minimum confidence score required to produce an executable decision. Anything below produces HOLD. |
SIGNAL_SCORE_WEIGHTS | See below | JSON object | Weights for all seven scoring components. Must sum to exactly 1.0. |
CONTRADICTION_PENALTY | 0.35 | 0.0 – 1.0 | Subtracted when EMA trend contradicts RSI direction or 5 m / 15 m timeframes conflict. |
SPARSITY_PENALTY | 0.15 | 0.0 – 1.0 | Subtracted when the candle series is too sparse for reliable indicator calculation. |
EXPIRY_PENALTY | 0.20 | 0.0 – 1.0 | Subtracted when the market is close to expiry. |
EXTREME_PRICE_PENALTY | 0.15 | 0.0 – 1.0 | Subtracted when the entry price is in the extreme range (near 0 or 1). |
OVEREXTENSION_PENALTY | 0.15 | 0.0 – 1.0 | Subtracted when price has extended beyond MAX_EMA_EXTENSION_ATR multiples from the slow EMA. |
TIMEFRAME_ALIGNMENT_BONUS | 0.10 | 0.0 – 1.0 | Added to the score when 5 m and 15 m timeframes agree on direction. |
TIMEFRAME_CONFLICT_PENALTY | 0.35 | 0.0 – 1.0 | Subtracted when 5 m and 15 m timeframes conflict on direction. |
TIMEFRAME_NEUTRAL_PENALTY | 0.10 | 0.0 – 1.0 | Subtracted when one or both timeframes produce a neutral signal. |
REQUIRE_15M_CONFIRMATION | 1 | 0 or 1 | When 1, a 15 m confirmation signal is required for an executable decision. |
Default SIGNAL_SCORE_WEIGHTS:
{
"trend": 0.25,
"rsi": 0.15,
"patterns": 0.25,
"candle_quality": 0.15,
"market_quality": 0.10,
"poc_context": 0.05,
"timeframe": 0.05
}
The JSON object must contain exactly these seven keys; any extra or missing key raises ConfigError. Each weight must be in [0, 1] and the sum must equal 1.0 within a tolerance of 1e-9.
10. Freshness / timeouts
These variables control how long runtime files remain valid before a stage refuses to use them, and set HTTP client parameters.
| Variable | Default | Valid range | Behavior |
|---|
MAX_DECISION_AGE_SEC | 600 | 1 – 86,400 | Maximum age of runtime/decisions.json before validate refuses it. |
MAX_MARKET_AGE_SEC | 600 | 1 – 86,400 | Maximum age of runtime/market_snapshot.json before candles refuses it. |
MAX_CANDLE_AGE_SEC | 1200 | 1 – 86,400 | Maximum age of runtime/candles.json before analyze refuses it. |
MAX_BANKROLL_AGE_SEC | 600 | 1 – 86,400 | Maximum age of runtime/bankroll_state.json before validate refuses it. |
HTTP_TIMEOUT_SEC | 20 | 1 – 120 | Per-request timeout for all outbound HTTP calls. |
HTTP_RETRIES | 3 | 0 – 8 | Number of retry attempts on transient HTTP failures. |
HTTP_MAX_BYTES | 8000000 | 1,024 – 50,000,000 | Maximum response body size in bytes. Larger responses are truncated and rejected. |
FAILED_ORDER_COOLDOWN_SEC | 1800 | 0 – 604,800 | After a failed live order, the engine blocks re-entry on that market for this many seconds. |
LOOP_INTERVAL_SEC | 300 | 1 – 86,400 | Sleep interval between cycles when running the loop command. |
SIGNAL_INTERVAL_SEC | 300 | 1 – 86,400 | Minimum interval between signal generation passes. |
MARKET_SCAN_TIMEOUT_SEC | 25 | 1 – 300 | Timeout for a single market-scan pass. |
HEDGE_SCAN_TIMEOUT_SEC | 25 | 1 – 300 | Timeout for a hedge-scan pass. |
11. Market data
These variables tune how many markets are fetched and how much price history is requested per market.
| Variable | Default | Valid range | Behavior |
|---|
MARKET_PAGE_SIZE | 100 | 1 – 100 | Number of markets to request per Gamma API page. |
MARKET_MAX_PAGES | 20 | 1 – 200 | Maximum number of pages to paginate before stopping. |
MAX_SELECTED_MARKETS | 8 | 1 – 100 | Maximum number of markets to carry forward for candle building and analysis. |
HISTORY_LOOKBACK_HOURS | 48 | 12 – 720 | How many hours of price history to fetch per market. Must be sufficient to satisfy MIN_CANDLES_5M and MIN_CANDLES_15M. |
HISTORY_FIDELITY_MINUTES | 1 | 1 – 60 | Granularity of the price-history request in minutes. |
12. Indicators
These variables configure the period lengths and RSI threshold zones used by the deterministic indicator engine.
| Variable | Default | Valid range | Notes |
|---|
EMA_FAST_PERIOD | 8 | 2 – 100 | Fast EMA period. Must be strictly less than EMA_SLOW_PERIOD. |
EMA_SLOW_PERIOD | 21 | 3 – 300 | Slow EMA period. Must be strictly greater than EMA_FAST_PERIOD. |
RSI_PERIOD | 14 | 2 – 100 | RSI calculation period. Wilder smoothing after arithmetic-mean seed. |
ATR_PERIOD | 14 | 2 – 100 | ATR calculation period. Wilder smoothing after arithmetic-mean seed. |
BULLISH_RSI_MIN | 52 | 0 – 100 | Lower bound of the bullish RSI zone. |
BULLISH_RSI_MAX | 72 | 0 – 100 | Upper bound of the bullish RSI zone. |
BEARISH_RSI_MIN | 28 | 0 – 100 | Lower bound of the bearish RSI zone. |
BEARISH_RSI_MAX | 48 | 0 – 100 | Upper bound of the bearish RSI zone. Bearish and bullish zones must not overlap. |
RSI_OVERBOUGHT | 75 | 0 – 100 | RSI level above which price is considered overbought. |
RSI_OVERSOLD | 25 | 0 – 100 | RSI level below which price is considered oversold. Must be less than RSI_OVERBOUGHT. |
MIN_EMA_SPREAD_PCT | 0.003 | 0.0 – 1.0 | Minimum required spread between EMA8 and EMA21 as a fraction of price. |
MAX_EMA_EXTENSION_ATR | 2.0 | 0.1 – 20.0 | Maximum allowed distance from the slow EMA expressed in ATR multiples before the overextension penalty is applied. |
13. Candle quality
These variables set the minimum candle data quality thresholds that must be met before the signal engine will generate an executable decision.
| Variable | Default | Valid range | Notes |
|---|
MIN_CANDLES_5M | 30 | 1 – 10,000 | Minimum number of 5 m candles required for analysis. |
MIN_CANDLES_15M | 30 | 1 – 10,000 | Minimum number of 15 m candles required for analysis. |
MIN_CANDLE_QUALITY_SCORE | 0.65 | 0.0 – 1.0 | Minimum composite candle quality score to proceed. |
AUTO_TRADE_CANDLE_QUALITY_SCORE | 0.75 | 0.0 – 1.0 | Candle quality score required to auto-approve a trade without manual review. |
MAX_SINGLE_SAMPLE_CANDLE_RATIO | 0.50 | 0.0 – 1.0 | Maximum fraction of candles that may have only one price sample. |
MAX_FLAT_CANDLE_RATIO | 0.60 | 0.0 – 1.0 | Maximum fraction of candles that may be flat (zero range). |
MAX_MISSING_BUCKET_RATIO | 0.20 | 0.0 – 1.0 | Maximum fraction of expected time buckets that may be absent. |
14. Pattern thresholds
These variables set the exact numeric boundaries for all nine deterministic candle-pattern groups.
| Variable | Default | Valid range | Pattern |
|---|
ENGULFING_BODY_MULTIPLIER | 2.0 | 1.0 – 20.0 | Current candle body must be ≥ this × previous body. |
HARAMI_BODY_MAX_RATIO | 0.60 | 0.0 – 1.0 | Current candle body must be ≤ this fraction of the previous body. |
TWEEZER_WICK_DIFFERENCE_PCT | 0.10 | 0.0 – 1.0 | Relative difference between the extreme wicks of the two candles must be ≤ this. |
STAR_MIN_RETRACE_RATIO | 0.60 | 0.0 – 2.0 | Third candle must retrace at least this fraction of the first candle. |
STAR_STRONG_RETRACE_RATIO | 0.70 | 0.0 – 2.0 | Strong-star classification requires retracement ≥ this. Must be ≥ STAR_MIN_RETRACE_RATIO. |
STAR_MIDDLE_BODY_MAX_RATIO | 0.40 | 0.0 – 1.0 | Middle candle body must be ≤ this fraction of the first candle body. |
THREE_CANDLE_PATTERN_LENGTH | 3 | Exactly 3 | Fixed window length for three-soldier/three-crow patterns. |
THREE_CANDLE_MIN_BODY_ATR_RATIO | 0.20 | 0.0 – 10.0 | Each candle’s body must be ≥ this × ATR. |
THREE_CANDLE_MAX_COUNTER_WICK_BODY_RATIO | 0.75 | 0.0 – 20.0 | Counter-direction wick must be ≤ this fraction of the candle body. |
SHADOW_BREAKOUT_ATR_MULTIPLIER | 1.5 | 0.0 – 20.0 | Relevant wick must be ≥ this × ATR for a shadow breakout. |
SHADOW_CLOSE_LOCATION_MIN | 0.65 | (0.5, 1.0] | Close must occur in the top (or bottom) fraction of the candle range. Must be > 0.5. |
ORDER_BLOCK_SWEEP_PCT | 0.02 | 0.0 – 1.0 | Price excursion must be ≥ this fraction of the deterministic 20-candle level. |
ORDER_BLOCK_LOOKBACK | 20 | 1 – 1,000 | Number of candles to look back when identifying order-block levels. |
IMPULSE_BODY_MULTIPLIER | 2.0 | 1.0 – 20.0 | Body must be ≥ this × average body for an impulse candle classification. |
IMPULSE_BODY_LOOKBACK | 20 | 1 – 1,000 | Lookback window for computing average body size for impulse detection. |
POC_CONTEXT_DISTANCE_PCT | 0.01 | 0.0 – 1.0 | Maximum distance from POC as a fraction of price for the POC-context signal. |
POC_BIN_SIZE | 0.01 | 0.001 – 1.0 | Price bin width used to compute the sample-density point of control. |
15. LLM providers
These variables configure the AI providers used by the multi-role LLM orchestration loop. The orchestration layer is advisory and separate from the deterministic execution gate.
API keys and base URLs
| Variable | Default | Notes |
|---|
OPENROUTER_API_KEY | (empty) | OpenRouter API key. |
OPENROUTER_BASE_URL | (empty) | OpenRouter API base URL. |
OPENAI_API_KEY | (empty) | OpenAI API key. |
OPENAI_BASE_URL | (empty) | OpenAI API base URL (override for compatible endpoints). |
ANTHROPIC_API_KEY | (empty) | Anthropic API key. |
ANTHROPIC_BASE_URL | (empty) | Anthropic API base URL override. |
ANTHROPIC_VERSION | 2023-06-01 | Anthropic API version header. |
GEMINI_API_KEY | (empty) | Google Gemini API key. Sent via header only — never appended to URLs. |
Kilo (Tokenator) provider
The KILO_* variables configure the Tokenator-backed Kilo LLM provider used by the Kilo worker and analysis loop.
| Variable | Default | Notes |
|---|
KILO_PROVIDER_ID | tokenator | Provider identifier string for the Kilo provider. |
KILO_DISPLAY_NAME | Tokenator | Display name shown in logs and dashboards. |
KILO_BASE_URL | https://api.tokenator.cloud/v1 | Base URL for Kilo/Tokenator OpenAI-compatible API. |
KILO_ANTHROPIC_BASE_URL | https://api.tokenator.cloud/anthropic | Anthropic-compatible base URL for Kilo. |
KILO_API_KEY | (empty) | API key for the Kilo/Tokenator service. |
KILO_MODEL | tokenator/claude-opus-4-7 | Default model for the Kilo worker. |
KILO_FALLBACK_MODELS | tokenator/gpt-5.5,tokenator/gemini-3.1-pro-preview | Comma-separated fallback model list for the Kilo worker. |
KILO_VARIANT | medium | Kilo prompt variant. |
KILO_AVAILABLE_MODELS | gpt-5.5,claude-opus-4-7,gemini-3.1-pro-preview,claude-sonnet-4-6,claude-opus-4-6,claude-haiku-4-5 | Comma-separated list of models available to the Kilo worker. |
KILO_TOKEN_BUDGET | 20000000 | Maximum token budget per Kilo analysis pass. |
KILO_ANALYSIS_TIMEOUT_SEC | 75 | Timeout in seconds for a single Kilo analysis call. |
KILO_WORKER_INTERVAL_SEC | 90 | Interval between Kilo worker passes. |
Orchestrator settings
| Variable | Default | Notes |
|---|
ORCH_TOKEN_BUDGET_TOTAL | 60000000 | Total token budget across all orchestrator roles per cycle. |
ORCH_LLM_RETRY_ATTEMPTS | 2 | Number of retry attempts for each orchestrator LLM call. |
ORCH_LOCAL_OPENAI_BASE_URL | http://127.0.0.1:11434/v1 | Base URL for local Ollama-compatible OpenAI endpoint used by orchestrator roles. |
ORCH_HEARTBEAT_SEC | 300 | Interval in seconds between orchestrator heartbeat ticks. |
ORCH_REDEEM_CRON_SEC | 900 | Interval in seconds between automatic redeem checks (when ALLOW_REDEEM=1). |
Orchestrator default models
| Variable | Default | Notes |
|---|
ORCH_DEFAULT_MARKET_MODEL | gpt-5.5 | Default model for market-analysis roles. |
ORCH_DEFAULT_CLAUDE_MODEL | claude-sonnet-4-6 | Default Claude model for roles that prefer Anthropic. |
ORCH_DEFAULT_COPY_MODEL | claude-haiku-4-5 | Default model for the copy role. |
ORCH_DEFAULT_EXPLAINER_MODEL | claude-haiku-4-5 | Default model for the explainer role. |
ORCH_DEFAULT_FINAL_MODEL | claude-opus-4-7 | Default model for the final synthesis role. |
Local Qwen (Ollama) provider
| Variable | Default | Notes |
|---|
LOCAL_QWEN_MODEL | qwen2.5:14b-instruct | Model name for the local Qwen Ollama endpoint. |
LOCAL_QWEN_BASE_URL | http://127.0.0.1:11434/v1 | Base URL for the local Ollama/Qwen endpoint. |
LOCAL_QWEN_API_KEY | local | API key sent to the local Ollama endpoint (not secret). |
LOCAL_QWEN_TIMEOUT_SEC | 90 | Timeout in seconds for local Qwen calls. |
Orchestrator role configuration
Each LLM role has three variables: ORCH_ROLE_<ROLE>_PROVIDER, ORCH_ROLE_<ROLE>_MODEL, and ORCH_ROLE_<ROLE>_TIMEOUT_SEC. Set _PROVIDER to disabled to skip that role. Token budgets per role are set via ORCH_ROLE_<ROLE>_TOKEN_BUDGET.
| Role | Default provider | Default model | Timeout | Token budget |
|---|
MEMORY | openai | qwen2.5:14b-instruct | 20 s | — |
SCOREBOARD | openai | qwen2.5:14b-instruct | 20 s | — |
CONTEXT | openai | qwen2.5:14b-instruct | 20 s | — |
MARKET | openai | gpt-5.5 | 90 s | 14,000,000 |
VOLATILITY | disabled | sonar | 60 s | 6,000,000 |
MACRO | disabled | sonar | 60 s | 6,000,000 |
MICROSTRUCTURE | disabled | sonar | 60 s | 6,000,000 |
CRITIC | anthropic | claude-sonnet-4-6 | 90 s | 10,000,000 |
RISK | anthropic | claude-sonnet-4-6 | 90 s | 10,000,000 |
COPY | anthropic | claude-haiku-4-5 | 90 s | 4,000,000 |
EXPLAINER | anthropic | claude-haiku-4-5 | 90 s | 6,000,000 |
FINAL | anthropic | claude-opus-4-7 | 90 s | 16,000,000 |
16. Integrations
CoinGecko
| Variable | Default | Notes |
|---|
COINGECKO_IDS | bitcoin,ethereum,solana | Comma-separated CoinGecko asset IDs to fetch spot prices for. Written to runtime/spot_prices.json. No API key required. |
Trader tracker
| Variable | Default | Notes |
|---|
TRADER_TRACKER_TRADES_LIMIT | 500 | Maximum number of recent trades to fetch per wallet. |
TRADER_TRACKER_MIN_TRADES | 2 | Minimum trade count for a wallet to appear in the watchlist. |
TRADER_TRACKER_ENRICH | 1 | 1 enables enrichment of wallet data with additional Polymarket API calls. |
TRADER_TRACKER_ENRICH_MAX | 20 | Maximum number of wallets to enrich per cycle. |
TRADER_TRACKER_SIGNAL_USD | 1.0 | Minimum position size in USD to generate a copy signal. |
TRADER_TRACKER_MAX_SIGNAL_AGE_SEC | 1800 | Maximum age of a wallet signal before it is considered stale. |
Dashboard
| Variable | Default | Notes |
|---|
DASHBOARD_HOST | 127.0.0.1 | Binding address for Mission Control. Non-loopback hosts require DASHBOARD_AUTH_TOKEN to be set; otherwise binding falls back to 127.0.0.1. |
DASHBOARD_PORT | 8080 | Port for the Mission Control Flask app. |
DASHBOARD_AUTH_TOKEN | (empty) | Bearer token / X-Auth-Token header value required for non-local bindings. Returns HTTP 401 if absent and the host is non-loopback. |
OpenClaw gateway
| Variable | Default | Notes |
|---|
OPENCLAW_GATEWAY_URL | (empty) | URL of the OpenClaw gateway service. |
OPENCLAW_GATEWAY_TOKEN | (empty) | Authentication token for the OpenClaw gateway. Keep in .env.local only. |
Telegram notifications
| Variable | Default | Notes |
|---|
TELEGRAM_BOT_TOKEN | (empty) | Telegram bot token for trade and report notifications. Keep in .env.local only. |
TELEGRAM_CHAT_ID | (empty) | Telegram chat ID to deliver notifications to. |
TELEGRAM_DELIVERY_ENABLED | 1 | 1 enables Telegram delivery; 0 disables it. |
TELEGRAM_DELIVERY_MIN_INTERVAL_SEC | 300 | Minimum interval in seconds between Telegram messages (rate limiting). |
Kimi Claw plugin
| Variable | Default | Notes |
|---|
KIMI_CLAW_PLUGIN_ENABLED | 0 | 1 enables the Kimi Claw plugin integration. |
KIMI_CLAW_BOT_TOKEN | (empty) | Bot token for the Kimi Claw plugin. Keep in .env.local only. |
KIMI_CLAW_DELIVERY_ENABLED | 1 | 1 enables Kimi Claw delivery. |
KIMI_CLAW_DELIVERY_TARGET | main | Delivery target name for Kimi Claw. |
KIMI_CLAW_ACCOUNT_ID | main | Account ID for Kimi Claw authentication. |
KIMI_CLAW_DELIVERY_MIN_INTERVAL_SEC | 300 | Minimum interval in seconds between Kimi Claw deliveries. |
KIMI_CLAW_DELIVERY_TIMEOUT_SEC | 25 | Timeout in seconds for Kimi Claw delivery calls. |
KIMI_CLAW_WS_URL | (empty) | WebSocket URL for the Kimi Claw service. |
KIMI_CLAW_KIMIAPI_HOST | (empty) | Host for the Kimi API. |
KIMI_CLAW_PROMPT_TIMEOUT_MS | 1800000 | Timeout in milliseconds for Kimi Claw prompt calls. |
KIMI_CLAW_EXPLICIT_CHAT_ID | (empty) | Explicit chat ID override for Kimi Claw delivery. |