Skip to content

[Evaluators] add Drex strategy evaluators and DrexEvaluator - #3775

Closed
chichengmessi wants to merge 2 commits into
Drakkar-Software:devfrom
chichengmessi:drex/ai-evaluators
Closed

chichengmessi wants to merge 2 commits into
Drakkar-Software:devfrom
chichengmessi:drex/ai-evaluators

Conversation

@chichengmessi

Copy link
Copy Markdown

Summary

Add optional Drex versions of the AI strategy evaluators and of GPTEvaluator: same inputs and eval note scale, used only when NACE_API_KEY is set, falling back to the existing LLM path on any Drex error.

Related issue: #3774 (the TA eval note convention the Drex strategy evaluators pass along)

Changelog

  • CryptoDrexStrategyEvaluator and GlobalDrexStrategyEvaluator (Evaluator/Strategies/drex_strategy_evaluator): the LLM strategy evaluators, with the agent team's decision answered by one Drex request.
  • DrexEvaluator (Evaluator/TA/drex_evaluator): GPTEvaluator, with the up/down call answered by Drex.
  • Tests for the Drex path, the fallback on errors and the no-key path, plus one doc page per tentacle.

What's new?

Drex strategy evaluators. The LLM strategy evaluators send the TA, social and real-time notes to a team of LLM agents, which summarize them into an eval note from -1 (strong sell) to 1 (strong buy). The Drex versions override only _run_agents_analysis:

  • Request: one POST /v1/systemone with the same aggregated_data and missing evaluator types, plus what each evaluator type's note means. OctoBot's TA and real-time evaluators use -1 for buy; social evaluators use 1 for positive.
  • Question: one score question with five stances, strong sell to strong buy.
  • Output: the eval note is the expected stance on the same -1 to 1 scale. The description names Drex and lists the probabilities, for example Drex: Buy (Strong sell 0%, Sell 1%, Neutral 2%, Buy 74%, Strong buy 23%). The AI Index trading mode reads both as before.

Measured on 60 constructed cases (evaluator notes that clearly point to buy, sell or neutral: 30 per-crypto TA setups, 30 global fear and greed / market cap / news setups), each run twice, through the real _run_agents_analysis, against the agent team on gpt-6-luna:

LLM agent team (gpt-6-luna) Drex strategy evaluator
Latency p50 / p95 7.06 s / 13.70 s 0.38 s / 0.52 s
Model calls per decision 2.33 1
Cost per 1,000 decisions $0.54 (critical path only) $0.009
Same answer on a repeat request 25/60 60/60
Stance matching the evaluators' signals 40/60 57/60

The last row mostly comes from the input. The agents get the TA notes without the -1 = buy convention, so they read them the other way (10/30 TA setups, #3774). Given the same convention, the agent team gets 59/60.

DrexEvaluator. GPTEvaluator with ask_gpt answered by one yes/no Drex question on the same candle data: will the next candle close above the last close? The probability is written in GPTEvaluator's up 62% format, so the threshold and profile settings work unchanged. With the key set, backtesting asks Drex for each candle instead of loading stored ChatGPT signals, so it works on any pair and date range.

60 BTC/ETH/SOL 4h cases, each run twice GPTEvaluator (gpt-6-luna) DrexEvaluator
Latency p50 / p95 1.26 s / 1.97 s 0.40 s / 0.62 s
Cost per 1,000 evaluations $0.127 $0.045
Same answer on a repeat request 8/60 60/60
Backtest candles with an answer (BTC/USDT 4h, 2026-08-14 to 11-05) 471/499 (stored signals) 499/499

Neither model predicts the next 4h candle better than chance from 20 raw candles.

Behaviour

  • Off by default. Enabling means setting NACE_API_KEY and selecting the Drex tentacle instead of the one it extends, with the same settings.
  • Without the key, both tentacles defer to their parent class. A BTC/USDT 4h backtest gives the same answers and orders as GPTEvaluator.
  • On a Drex error (connection, timeout, HTTP status, unexpected answer), each logs one warning and uses the existing LLM path for that decision.
  • No new dependency (aiohttp). NACE_DEFAULT_DECISION_MODEL (default drex-max-finance) and NACE_BASE_URL are optional.
  • Requests send X-Nace-Client / User-Agent: octobot/<LONG_VERSION>.

Tests

  • pytest tentacles/Evaluator/Strategies/drex_strategy_evaluator/tests tentacles/Evaluator/TA/drex_evaluator/tests tentacles/Evaluator/TA/ai_evaluator/tests: 14 passed.
  • Live, simulated trading:
    • The Drex strategy evaluators in a copy of AI Trading, and DrexEvaluator in a copy of GPT Trading: every request returned 200, with the headers above.
    • Key unset: no Drex request.
    • Invalid key, DrexEvaluator: a 401 warning per candle, then a ChatGPT answer. The strategy fallback is covered by the unit tests.
  • In those runs, the AI Index trading mode itself placed no orders, with or without this change. Its signal agent gets a 400 from gpt-6-luna on tool calls ("Function tools with reasoning_effort are not supported"). With gpt-4.1-mini, the distribution agent skips ("missing signal_synthesis and risk_output"). I can open separate issues for those.

Benchmark (Nace's Financial Decisions Benchmark, 48 held-out finance benchmarks, 3,361 decisions):

Benchmark Drex Max Finance GPT-6 Luna
Finance Index 77.3 58.4
Accuracy % 85.7 70.9
Markets & reasoning 41.5 30.1

Disclosure: I work at Nace, which makes Drex.

@Herklos

Herklos commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

No third party API please

@Herklos Herklos closed this Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants