research

Using Trading Traces to Improve Agent Behavior

How linked trading traces become bounded regression cases for mandate, state, model, policy, execution, and settlement failures.

WRITTEN
AUTHORDXRG
PUBLISHED
UPDATED
Using Trading Traces to Improve Agent Behavior

The fee sentence never changed. We moved it from paragraph eight to paragraph one.

Before the move, DX Terminal Pro agents cited the 2.3% trading fee in 3% of sampled reasoning traces. Moving it forward raised citation from 3% to 74%. The model stayed fixed. The wording stayed fixed. The market data stayed fixed.1

That trace did more than show a behavioral change. It located the intervention. A conventional outcome chart could tell us that agents traded differently; the linked record showed that reading order had changed what the model attended to.

This page explains how we turn a trading trace into a regression case without laundering a diagnostic into a claim about returns. It is the feedback spoke in our trading-agent harness and runtime framework. The execution and reconciliation spoke ends with an authoritative portfolio effect. Feedback begins when that effect is joined back to the mandate and state that produced it.

Download the trace-derived regression registry or the CSV edition. Each case records the frozen components, changed component, observed measure, evidence class, and promotion limit.

Evidence boundary: The measured examples below come from controlled DX Terminal Pro pre-launch tests, one bounded historical deployment, and a separate MEMEbench evaluation. Reinforcement learning sits outside the paper's evaluation. Trace completeness and regression performance do not establish alpha, profitability, universal safety, or transfer to another market.

A Trace Sorts Look-Alike Failures

Two missed trades can look identical in an aggregate action count. Their fixes can be opposite.

One agent may observe because the current mandate says to wait. Another may observe because a fee sentence dominates the prompt. A third may propose a buy that policy rejects for insufficient balance. A fourth may submit correctly while the venue times out.

The aggregate event is "no fill." The mechanism depends on the path.

We use mandate-to-settlement trace for the linked record from authenticated mandate through rendered context, model decision, policy result, submitted payload, venue response, and reconciled portfolio effect. Its value is classification with evidence. The trace lets an evaluator place the break in the mandate, state, model, policy, execution, or settlement stage.

Failure locationMinimum recordExample question
MandateSource map, precedence, compiler versionDid the active strategy survive compilation?
StateSnapshot ID, lineage, freshnessDid the model see the balance and market state used by policy?
ModelRendered context, response, typed actionDid the decision follow the visible mandate?
PolicyRule version, inputs, decision reasonWas a valid action rejected or an invalid one allowed?
ExecutionPayload hash, request ID, acknowledgementDid one approved action become one venue order?
SettlementFill, fee, final balance, reconciliation markerDid the next state reflect the authoritative outcome?

The same market result can pass or fail different rows. A losing trade may have perfect mandate fidelity and execution reliability. A profitable trade may violate its capital limit. Evaluation has to retain both truths.

Start With the Smallest Reproducible Case

An incident becomes useful when we can replay the mechanism at lower risk. The first step is to identify the earliest field where the observed path diverged from the expected path.

For the fee-placement case, the divergence appeared in rendered context and reasoning. We could freeze the model, market snapshot, portfolio state, wording, and sampling setup. The changed component was sentence position. Fee citation supplied a local diagnostic, while action rates and capital deployment remained downstream measures.

For fabricated rules, sell traces cited names such as "Hierarchy rule #2" and "Rule A." A compound intervention removed law-like wording, labeled prior decisions as context, and prohibited invented named rules. Fabricated sell rules fell from 57% to 3% in the affected controlled traces.1 The result belongs to the compound change because the test did not isolate its parts.

A good regression case preserves that honesty. It names what changed, what stayed fixed, and what the measure can support. It also records what the case cannot answer.

Freeze Before You Compare

The registry uses a simple comparison contract:

  1. Bind the case to a mandate version and state snapshot.
  2. Freeze the model, sampling setup, tool schema, and policy version.
  3. Change one component or declare a compound intervention.
  4. Score the same trace field and downstream action contract.
  5. Preserve the result with its evidence class and promotion limit.

This keeps a prompt fix separate from a model upgrade. It also keeps a policy fix separate from a venue change. When several components must change together, the registry labels the intervention as compound and refuses single-component attribution.

Production traces add one more constraint. The live outcome occurred once under a moving market. We can reconstruct its mandate and state, then replay controlled variants, but the replay result belongs to replay evidence. The historical fill remains live evidence from its original setting. The Agentic Trading Evidence Ladder prevents those two records from merging into a stronger claim than either supports.

Put the Metric Beside the Mechanism

Reasoning labels are diagnostics. They become dangerous when they drift away from the behavior they were designed to explain.

Fee citation illustrates the point. A 100% citation rate was never the goal. Some market states should justify trading despite a fee. The useful test was whether the cost had enough salience to prevent reflexive churn without becoming fee paralysis. We therefore read fee citation beside action rate and capital deployment.

The same rule applies to other measures:

DiagnosticNearby behavioral measureInterpretation limit
Fabricated-rule incidenceTyped action and policy resultDetects visible invented rules, not all hidden confusion
Fee citationTrade rate and observation rateMeasures salience, not calibrated profitability
Strategy-condition matchAction or abstention under fixed stateMeasures mandate fidelity in the registered cases
Payload validitySubmission and settlement stateMeasures construction and runtime reliability
Reconciliation completenessNext-snapshot integrityMeasures whether feedback reached state correctly

The pairing keeps the classifier in its place. In the Terminal Pro work, Claude Sonnet 4.5 classified 4,900 sampled reasoning traces for aggregate diagnosis. Those labels did not execute trades.1 They helped locate failure modes, which were then checked against operational measures.

Rebuild the Scene, Then Perturb It

Trace reuse becomes more powerful when a case can be reconstructed without pretending the future replay is the original market.

MEMEbench used this pattern on live-format trading scenarios. It held market statistics constant and rotated ticker names across 18,560 inference calls and 383 names. Animal tickers received higher selection rates across several model families, and the bias appeared in actions even when explanations cited market data.1

The important move was the controlled perturbation. A production-shaped scene supplied the state. Name rotation supplied the intervention. Identical statistics made ticker choice inspectable as its own factor.

We can use the same method for execution and harness defects. Rebuild a timeout with the same request identity, then vary retry policy. Rebuild an expired strategy conflict, then vary compiler precedence. Rebuild a stale balance, then vary the pre-submit refresh rule. Each perturbation should target one named mechanism.

This produces a library of hard cases with lineage. It also avoids a common trap: training on an incident summary that has lost the mandate and state responsible for the original action.

Send the Correction to the Right Layer

The trace tells us where a correction belongs.

A context-order failure returns to the compiler. A stale balance returns to state assembly and reconciliation. A schema error returns to the action contract or parser. An excessive action that policy correctly rejected may return to model evaluation, while an action policy should have blocked returns to the rule set. A duplicate order returns to request identity and recovery.

Model training is one destination among several. Some failures are cheaper and more reliable to close outside the weights. The fee-placement result required no model update. Final-payload binding belongs in deterministic software. Venue recovery belongs in the execution adapter.

When a case does belong in model work, the trace can supply its mandate, state, and rendered context. It also carries the action, policy result, and outcome. Reward design still needs care. Settlement success can reward transaction construction while saying nothing about whether the trade was wise. Profit can reward a policy violation during a favorable move. A useful reward must match the stage under evaluation.

Promotion Requires a New Evidence Class

A regression passing in replay is evidence that a registered failure stayed closed in replay. Moving toward paper, shadow, or live operation requires fresh checks at that level.

Our promotion record asks four questions:

  1. Did the target failure fall under the registered measure?
  2. Did adjacent action-validity and policy checks remain stable?
  3. Did the intervention create a new failure elsewhere in the trace?
  4. Does the evidence class support the proposed increase in authority?

Low sample stays inconclusive. A clean reasoning trace does not override a broken action. A successful settlement does not override a mandate violation. Independent measures can move in different directions, and the review should show that tension rather than force one synthetic score.

The DXRG Benchmark Card records the evaluated model and harness, data timing, execution assumptions, controls, and artifacts. The trace registry sits beneath that disclosure. It supplies the cases and version bindings that make the card reproducible.

The Feedback Loop Ends in Another Decision

The loop closes only when a correction reaches the next evaluation without corrupting the next state.

Execution first produces an acknowledged and reconciled outcome. The trace then joins that outcome to the mandate, context, decision, and policy result. Review assigns a failure location and creates a bounded case. The case runs against a frozen comparison. A passing intervention advances through the evidence ladder before receiving more authority.

That sequence is slower than calling every outcome a model lesson. It is faster than repeatedly fixing the wrong layer.

DX Terminal Pro gave us enough linked records to see prompt order, rule fabrication, cadence drift, tokenomics misreads, and execution outcomes as different problems. The practical use of the trace is to keep them different. We can then improve the compiler, model, policy, runtime, or training data with evidence tied to the stage that changed.

Return to the harness and runtime map for the full cluster. Read how mandates become executable instructions, how state and memory are bound, and how a typed action reaches settlement before using the registry. The trace earns its value by preserving that entire path.


Version 1.0. Published July 24, 2026. Corrections: poof@dxrg.ai. This article is research and educational material, not financial, investment, legal, compliance, or security advice.

Footnotes

  1. DXRG, Operating-Layer Controls for Onchain Language-Model Agents Under Real Capital, April 28, 2026, and the DX Terminal Pro companion. See Control-Loop Method, Failure Modes and Fixes, Trace Reuse and Harness Transfer, and Limitations. 2 3 4