Multi-Agent Trading Experiment: Design and Practical Implementation Guide

    This article presents a practical guide to designing and running a multi-agent trading experiment, where large-model-driven agents trade freely in a shared market. It covers the experimental goals, the four-track control matrix, budget and settlement logic, agent initialization from structured intent, free trading in a shared channel, mixed-model and information-asymmetry comparisons, observability metrics, and common pitfalls. Readers will learn how to build a reproducible, observable, and replayable agent market with deterministic settlement.

    1. Background and Objectives

    Research on Multi-Agent Systems has recently shifted from evaluating single-turn question answering toward long-horizon, high-interaction scenarios involving collaboration and competition with real consequences. This experiment is a typical social-technical experiment: it places a large number of large-model-driven agents into the same free-trading space and observes what price-discovery mechanisms and collaboration norms emerge under information asymmetry, limited resources, and real settlement.

    The core objectives can be summarized in three points:

    • Observe whether multiple agents can spontaneously form order for quoting, bargaining, and closing deals without central scheduling or human prompts;
    • Test the strategy differences of models at different capability tiers in the same market, and whether these differences translate into differences in returns;
    • Build a reproducible experimental infrastructure that closes the loop of “budget issuance - agent initialization - free trading - settlement by real outcomes.”

    It is worth emphasizing that the value of this kind of experiment lies not in proving that a certain model is “smarter,” but in exposing the engineering problems of multi-agent systems under real constraints: state consistency, settlement methodology, concurrency conflicts, and observability.

    2. Overall Experimental Design

    At the end of the year, 69 participants were recruited at an offline office venue. Each participant received a virtual budget of USD 100, recorded as gift cards. During the trading phase, the budget served only as a paper chip; after the experiment, it was uniformly adjusted and redeemed based on the actual buy/sell profit and loss of the agents in the “real track.” The key to this design is that the virtual budget provides a “free trial-and-error” function, while real settlement provides a “consequence constraint” function. The two are separated but connected through final clearing.

    After entering, each participant first had an “onboarding interview” with an agent, describing their trading preferences, risk tolerance, and buy/sell intentions in natural language. The system then bound a dedicated agent to that participant based on this input. The models driving the agents were divided into two capability tiers: a high-capability model and a lightweight model. All agents were placed into the same shared channel, where they could freely post, bid, counter-offer, and close deals, with no human intervention throughout.

    The experiment ran four tracks in parallel, forming a complete control matrix:

    Track Model Composition Public Purpose
    Run A All high-capability models Yes Real settlement track
    Run B Half high-capability, half lightweight (allocation probability public) Yes Mixed-model control
    Run C Half high-capability, half lightweight (allocation not public) No Information-asymmetry control
    Run D All high-capability models No Homogeneous baseline control

    Run A is the only track that determines the physical gift-card settlement; the other three are used only for research comparison. Physically isolating the “settlement track” from the “control tracks” is a necessary means to prevent participants’ strategies from being contaminated by profit motives.

    3. Budget and Settlement Mechanism

    The settlement logic must be written as deterministic rules from the start; otherwise, disputes at the end of the experiment will not converge. The following pseudocode is recommended:

    1. INITIAL_BUDGET = 100.0 # Unit: USD, virtual accounting
    2. def settle(agent_id, trades, market_prices):
    3. cash = INITIAL_BUDGET
    4. holdings = {}
    5. for t in trades:
    6. if t.side == "BUY":
    7. cash -= t.price * t.qty
    8. holdings[t.asset] = holdings.get(t.asset, 0) + t.qty
    9. else:
    10. cash += t.price * t.qty
    11. holdings[t.asset] = holdings.get(t.asset, 0) - t.qty
    12. # Open positions are converted at the track's closing price
    13. liquidation = sum(holdings[a] * market_prices[a] for a in holdings)
    14. return cash + liquidation

    Three additional engineering guarantees are needed: first, the execution price must be booked at the price at the moment of matching, not at a later midpoint; second, all trades must be written to an append-only log so that the settlement process can be replayed; third, gift-card adjustments must have upper and lower bounds to avoid negative values or over-redemption.

    4. Agent Initialization: Turning Intent into an Executable Strategy

    The “onboarding interview” is essentially a structured intent extraction. Participants express preferences in natural language, and the system needs to normalize them into a configuration object that the agent can consume:

    1. {
    2. "agent_id": "p-017",
    3. "model_tier": "high",
    4. "risk_profile": "moderate",
    5. "target_assets": ["A", "C"],
    6. "max_position_ratio": 0.4,
    7. "reservation_price": {"A": 42.0}
    8. }

    The key design point here is not to stuff every sentence from the participant into the prompt, but to extract a limited set of dimensions as parameters. Once parameterized, the strategy becomes auditable and reproducible, and it is easier to perform attribution analysis afterward - you can clearly answer whether the return difference comes from model capability or from risk parameter settings.

    5. Free Trading in the Shared Channel

    The shared channel serves three roles: information board, order book, and transaction record. To maintain order with zero human intervention, a minimal message specification is needed:

    1. A quote message must include the asset identifier, direction, quantity, price, and validity period;
    2. A counter-offer is treated as a new quote, and the original quote does not automatically expire;
    3. A deal requires confirmation from both parties, and the system writes transaction events on a first-come-first-served basis;
    4. For abnormal behaviors such as duplicate quotes or over-quantity quotes, the infrastructure layer rejects them directly rather than relying on the agents’ self-discipline.

    Concurrency is where problems most easily arise here. When multiple agents accept the same quote at the same time, an atomic matching operation must ensure that only one deal succeeds, while the rest return failure and are allowed to re-decide. In practice, making matching a single-point serial queue is more stable than introducing complex distributed locks.

    6. Mixed-Model and Information-Asymmetry Controls

    The only difference between Run B and Run C is “whether the allocation probability is public.” This small change actually measures how agents handle uncertainty: when an agent knows the counterpart may be a lightweight model, is it more inclined to quote aggressively; and conversely, is it more conservative. Run D and Run A are both homogeneous models, but Run D does not participate in settlement; it is used to strip away the interference of profit motives, so as to determine whether the observed behavioral differences originate from model heterogeneity or from the incentive structure.

    The four tracks share the same matching and logging infrastructure, distinguished only by configuration for model distribution and the settlement switch. This approach of “homogeneous experiments with parameterized differences” can significantly reduce implementation costs and improve the credibility of the conclusions.

    7. Observability and Evaluation Metrics

    It is recommended to collect at least the following metrics: quote frequency and cancellation rate, distribution of bargaining rounds, deal rate, price dispersion, position concentration, and the variance of final returns. Price dispersion is especially worth attention - it reflects whether the group has formed a consensus price. If the dispersion of a track does not converge over a long period, it usually means the message specification is unclear or matching latency is too high, rather than insufficient model capability.

    8. Common Pitfalls and Recommendations

    • Ambiguous settlement methodology: the source of the closing price and the conversion rules must be disclosed before the experiment;
    • Prompt leakage of track information: model allocation results should be injected through the infrastructure and not enter the visible context;
    • Missing logs: an experiment that cannot be replayed is equivalent to no conclusion;
    • Ignoring ethics and compliance: participants must clearly understand the conversion between the virtual budget and real redemption, and the scope of data use must be disclosed in advance.

    9. Conclusion

    The engineering essence of this kind of experiment is to build an observable, replayable, and settleable agent market in a controlled environment. To implement a similar solution in your own environment, you can rely on a container platform to host the concurrent matching service, use a message queue for event distribution, use object storage to save append-only logs, and leverage logging services and monitoring/alerting systems to track abnormal quotes and matching latency. Baidu AI Cloud provides complete product category support for these general capabilities, allowing research teams to focus their energy on the experiment design itself rather than on repeatedly building infrastructure.