Agentic tradingMulti-agentRiskDevelopers

How to architect a multi-agent trading system with real money

A multi-agent trading system needs strict capital partitions, scoped credentials, and per-agent kill switches so one faulty agent cannot drain the entire portfolio.

By the Felix team9 min read
Key takeaways
  • 01A multi-agent trading system partitions capital by budget cap, not by moving funds between accounts, so every agent spends only what it is assigned.
  • 02Each agent must receive its own scoped API key with position limits, market restrictions, and a kill switch that operates independently of other agents.
  • 03Portfolio-level risk controls must net exposures across agents because two agents can accidentally take opposite sides of the same trade and waste margin.
  • 04All funds remain in the owner-controlled wallet under a non-custodial model; agents can place orders but cannot withdraw or reassign capital.
  • 05Paper trading and explicit live-key authorization let you test multi-agent interactions before any real money is exposed to automated decisions.

A multi-agent trading system with real money is a collection of independent programs that share a single capital pool but make autonomous decisions. The architecture must prevent any single agent from exceeding its budget, accessing another agent's allocation, or withdrawing funds to an external address. This requires non-custodial wallet design, per-agent scoped credentials, and circuit breakers that can isolate one agent without freezing the entire portfolio. Trading can lose money, including everything, and these boundaries only control how failure spreads, not whether it occurs.

What does a multi-agent trading system actually do?

In practice, a multi-agent system runs several strategies simultaneously across stocks, crypto, perps, options, and prediction markets. One agent might collect volatility signals, another might scan for relative-value dislocations, and a third might hedge tail risk. They all connect through the same infrastructure, but they do not share a single monolithic account. Instead, the owner defines a budget envelope for each agent, and the API translates each agent's dollar-denominated intent into the specific contract math required by the underlying venue. The agent does not need to understand lot sizes, tick values, margin tiers, or settlement conventions. It simply states the desired exposure in US dollars, and the system normalizes the order into the format each venue expects. Agents connect through MCP tools for Claude, Cursor, and other MCP clients, or directly through the REST API, depending on the owner's preference.

The coordination layer is minimal by design. Agents do not share internal state or position tables unless the owner explicitly builds a message bus between them. Keeping agents ignorant of each other's open orders reduces the blast radius of a logic error. If one agent begins to loop or emit bad orders, the others continue to operate within their own scoped lanes. This isolation is the core architectural principle that separates a robust multi-agent system from a fragile script farm. You want each agent to behave as if it is the only program in the world, while the infrastructure quietly enforces the guardrails. The owner can choose to let agents read a shared market data stream, but even then, the execution layer should remain separated so that an order from one agent never interferes with an order from another. This separation lets you swap out one agent on a Tuesday without reconfiguring the others.

How should capital flow between agents?

Capital does not flow between agents in the traditional sense. The owner keeps all funds in a self-controlled wallet, and the system enforces budget caps at the API level. Suppose you assign ten thousand dollars to Agent A and five thousand dollars to Agent B. Agent A can place orders up to its limit, but it cannot requisition Agent B's unused budget without an explicit owner action. The API rejects any order that would breach the cap, regardless of how much unspent capital sits elsewhere in the wallet. This means an agent cannot expand its reach simply because another agent is idle. The budget is a hard ceiling, not a soft suggestion. The wallet itself never fragments into sub-accounts; the partitioning is logical and enforced by the API.

This non-custodial structure means the agent never takes possession of the funds. It can only place orders within its limit. If an agent needs more capital, the owner must adjust its scoped key or reallocate the budget through the dashboard. There are no automated transfers initiated by the agent itself. Withdrawal addresses are owner-approved only, and the agent cannot add new destinations. This prevents a compromised agent from draining the wallet, even if it has live trading privileges. The architecture treats every agent as potentially untrustworthy, which is the safest posture when real money is at stake. Even if an agent's logic is sound, its environment might not be. A prompt injection or a corrupted data feed could turn a benign strategy into a destructive one. The budget cap is the final backstop.

Why does each agent need its own scoped credentials?

Sharing one API key across every agent is equivalent to giving every employee the master password. If one agent leaks its context window or suffers a prompt injection, the attacker gains access to the entire portfolio. Scoped API keys solve this by binding each agent to a narrow set of permissions. A key can be restricted to a single market type, a maximum position size, a specific direction such as long-only, and a maximum daily loss. These constraints are enforced server-side, so the agent cannot talk its way out of them. The scope travels with the key, not with the agent's code, which means the permission model is independent of whatever large language model or script happens to be holding the credential. You can scope a key so narrowly that it only allows orders on a single venue or a single prediction market contract.

{
  "agent_id": "volatility_hedge_01",
  "scope": {
    "markets": ["perps", "options"],
    "max_position_usd": 5000,
    "allowed_sides": ["long", "short"],
    "daily_loss_cap": 500
  },
  "auth": "YOUR_KEY"
}

When you rotate or revoke one key, the other agents are unaffected. This is critical in a multi-agent setup because you may need to pause a single strategy without stopping the entire system. Paper trading keys are separate from live keys, and moving to live trading requires explicit owner authorization. The agent cannot authorize itself. You can also set time-bound keys that expire automatically, forcing a periodic review of whether the agent still deserves its budget. This practice limits the window of damage if a key is leaked or if the strategy degrades over time. Key rotation should be routine, not an emergency-only procedure. In a multi-agent fleet, you might rotate one key per week so that you never have to perform a scary global revocation unless a true systemic threat appears. This granularity turns a potential disaster into a contained incident.

What happens when one agent disagrees with another?

Agents will sometimes conflict. One agent might go long a crypto perp while another goes short the same underlying. Without portfolio-level controls, you pay spread and funding on both sides while netting close to zero exposure. This is not diversification; it is waste. A multi-agent architecture therefore needs a portfolio risk layer that sits above the individual agents and monitors net delta, correlation, and margin usage across the entire account. This layer is not a trading strategy. It is a referee that applies rules the owner wrote before any agent started running. The owner should review these nets at least daily when the system is new.

This risk layer does not tell agents what to trade. It simply enforces global limits. If the combined exposure across all agents exceeds a threshold, the API can block new orders in that direction until the owner adjusts the limits. Keeping a multi-market portfolio safe means watching how agents interact, not just how each one performs in isolation. You can also define symbol-level concentration caps so that no single underlying absorbs too much of the total budget. Imagine three agents all detecting the same momentum signal. Without a concentration cap, they might collectively pile into a position that exceeds your risk tolerance. The portfolio layer prevents that collision by rejecting the third agent's order even though the first two are still within their individual budgets. The system treats the owner-level limit as the ultimate authority.

How do you stop the system before losses cascade?

Every agent needs its own exit plan and its own kill switch. A global panic button is necessary, but it is too blunt for daily operations. If one agent hits a tail event, you want to flatten that agent and revoke its key without disturbing the others. Per-agent exit plans can include stop-loss rules, take-profit triggers, and time-based exits that run automatically. Automating exit plans prevents a single bad day from turning into a catastrophic drawdown. The owner defines these rules before the agent starts trading, so emotion does not override discipline during volatility. An exit plan is a contract between the owner and the infrastructure, not a suggestion that the agent can debate.

The kill switch mechanism should flatten positions and disable the scoped key within seconds. Because the system is non-custodial, the agent cannot resist the shutdown by moving funds elsewhere. The owner retains the root credentials and can inspect every order that led to the breach. After the agent is stopped, the owner can reallocate its unused budget to other agents or simply leave it idle until the strategy is debugged. You can also configure a circuit breaker that halts an agent after a sequence of failed orders, which prevents a stuck loop from burning through transaction costs. In a multi-agent system, these circuit breakers must be per-agent. A global circuit breaker would let one noisy agent silence the entire fleet, which defeats the purpose of diversification. Speed matters because an agent running on an LLM can generate orders faster than a human can read them.

How do you test a multi-agent strategy without risking capital?

Before any agent touches live markets, you run the entire ensemble against paper trading environments. Each agent receives a paper-scoped key that mimics the live market behavior without committing real money. You watch how the agents interact under realistic conditions: do they crowd into the same trade, do their hedges offset or collide, does the portfolio risk layer catch concentration breaches correctly? Paper trading reveals pathologies that backtests miss, especially when multiple agents compete for the same bandwidth or capital. An agent that looks brilliant in isolation might become toxic when it shares a budget with five other agents. Treat paper trading as a load test for your risk controls, not just a strategy validator.

Only after the owner explicitly authorizes a live key does the agent gain the ability to place real orders. This authorization is a deliberate human action, not an automatic graduation from paper to live. The single API safety model applies uniformly across agents, so the transition from testing to production is a permission change rather than a system swap. You can also run one agent live and the rest in paper mode, which is useful for gradual rollouts. This staged approach means you are never in a position where a fleet of untested agents suddenly gains access to your entire wallet. Paper trading is not a guarantee of future performance, but it is a necessary filter that catches architectural errors before they cost money. Trading with real money carries the risk of total loss, and paper profits do not predict live outcomes.

Frequently asked questions

Can one agent steal funds from another agent?

No. Agents operate under scoped keys with budget caps. They cannot withdraw funds or access another agent's allocation. All funds remain in the owner-controlled wallet.

What happens if two agents try to trade the same asset in opposite directions?

The portfolio risk layer monitors net exposure. If the combined position violates a global limit, the API blocks new conflicting orders. You can also set symbol-level caps to prevent this waste.

Do I need separate wallets for each agent?

No. The non-custodial design lets multiple agents share one wallet while enforcing strict spending partitions at the API level. The owner controls the wallet and approves withdrawals.

How do I shut down one agent without stopping the others?

Each agent has its own scoped key and kill switch. Revoking one key or triggering its panic button flattens only that agent's positions. The remaining agents continue to trade within their own budgets.

Can I mix paper and live agents in the same system?

Yes. You can authorize live keys for some agents while keeping others in paper mode. This lets you test new strategies alongside live ones without risking the entire portfolio.

Who authorizes an agent to move from paper to live trading?

The owner must explicitly authorize the live key. The agent cannot promote itself. This prevents an automated system from accidentally committing real money before it is ready.

Give your agent a key.

One key to trade stocks, crypto, perps, options, and prediction markets. Live after owner authorization.

Keep reading

Not a brokerage, exchange, or investment adviser. Not investment advice. Trading involves risk, including total loss.