Agentic tradingRiskDevelopersMulti-market

How to trade every market through one API with hard limits the agent cannot cross

One API connects an AI agent to stocks, crypto, perps, options, and prediction markets. Hard limits on budget and loss are enforced below the agent, so it cannot override them.

By the Felix team6 min read
Key takeaways
  • 01One API normalizes stocks, crypto, perpetual futures, options, and prediction markets so the agent reasons in dollars across every venue.
  • 02Hard limits on budget, position size, and loss are enforced in the wallet and key layer, so the agent cannot override them.
  • 03The owner retains full custody, and the agent cannot withdraw funds to any address that the owner has not explicitly approved.
  • 04Paper trading uses the same interface as live trading, but live keys require explicit owner authorization and real money can be lost.
  • 05A multi-market agent can lose across several positions at once, so limits should be tight, monitored through audit logs, and tested before live deployment.

One API and one key let an AI agent trade stocks, crypto, perpetual futures, options, and prediction markets with real money. Hard limits on budget, position size, and maximum loss are enforced below the agent level in the wallet and key layer, so the agent cannot override, withdraw, or escape them. The owner retains full custody, and every order is sized in plain US dollars regardless of the underlying market. This setup lets you automate across asset classes without rebuilding infrastructure for each venue.

What does one API for every market type look like?

The API normalizes the differences between market types. When your agent sends an order, it specifies a dollar amount, not contract counts, lot sizes, or margin formulas. The system translates that into the format required by the underlying stock broker, crypto exchange, perps venue, options venue, or prediction market. You do not need to maintain separate integrations for each asset class, which reduces the surface area for errors in the agent's reasoning.

Agents connect through MCP tools used by Claude, Cursor, and other MCP clients, or directly through the REST API. The exact request schema is in the docs; the shape looks like this.

curl -X POST ... \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "market_type": "perpetual_futures",
    "direction": "buy",
    "dollar_amount": 500,
    "symbol": "BTC"
  }'

Whether the agent is trading a stock or taking a position in a prediction market, the interface remains the same. The agent reasons about risk in dollars, and the API handles the translation. This consistency is important because it prevents the agent from making mistakes when switching between market types with different conventions. Still, trading can lose money, including everything, and a unified interface does not remove the risk of a bad strategy.

Where are the hard limits enforced?

Hard limits are enforced in the wallet and key layer, not inside the agent's prompt or logic. The owner controls the wallet, and the agent receives a scoped key that can only spend within predefined boundaries. The agent cannot withdraw funds to itself or to any address that the owner has not explicitly approved. This means that even if the agent's instructions drift or it encounters an unexpected state, it cannot escape its cage.

The custody model separates trading authority from fund ownership. The agent can place orders, but it cannot move the underlying capital. Withdrawal addresses are owner-approved only, and the key itself is scoped so that it stops working the moment it is revoked. This is non-custodial by construction. The funds sit in a wallet the owner controls, and the agent operates within a sandbox defined by that wallet.

How do you set budget caps and position limits?

Setting limits is a configuration task, not a coding task. You define the boundaries before the agent starts, and the system enforces them at the infrastructure level. Suppose you want to allocate five thousand dollars to a new agent. You would create a key with a total budget cap of five thousand dollars, a per-trade maximum of five hundred dollars, and a daily drawdown limit of one thousand dollars. These numbers are examples; you should set them according to your own risk tolerance.

  • ·Create a scoped API key that is restricted to specific market types.
  • ·Attach a total budget cap that cannot be exceeded over the key lifetime.
  • ·Set per-market position limits so the agent cannot concentrate too heavily in one asset.
  • ·Define an exit plan, such as a stop level or a time-based flatten rule.
  • ·Enable the panic switch so you can revoke the key and flatten positions instantly.
  • ·Test the entire configuration in paper trading before authorizing live funds.

The article on how to set spend caps and drawdown limits explains how these numbers interact. It is important to understand that a budget cap is a hard ceiling, not a suggestion. Once the agent has spent its allocated limit, the key refuses further orders until the owner resets or increases the cap. The agent cannot negotiate around this because the check happens outside the agent's execution loop.

What happens when the agent tries to exceed a limit?

When the agent sends an order that would breach a limit, the API rejects the request before it reaches the market. The agent receives an error stating that the cap has been reached, and it must either reduce the order size or stop. This rejection is not a prompt trick; it is a cryptographic and wallet-level refusal. The agent has no ability to override the refusal by rephrasing the request or creating a new key, because key creation requires owner authorization.

This behavior applies uniformly across stocks, crypto, perpetual futures, options, and prediction markets. The agent might not understand why a perps venue allows high leverage while the key refuses a large notional position, but the key's limit wins. Trading can lose money, including everything, and limits are there to cap the speed at which losses can accumulate, not to guarantee profitability.

How do you move from paper trading to live authorization?

Paper trading exists for testing exactly these boundaries. You should run the agent in simulation until you observe how it behaves when it hits a budget cap, how it handles rejected orders, and whether its strategy produces unintended cross-market exposure. Paper trading uses the same API shape, so the transition to live trading only requires one change: owner authorization of a live key.

Live trading requires explicit owner authorization. The agent cannot self-authorize. The owner must approve the specific key scope, the budget cap, and the allowed markets. Start with a small live limit, monitor the agent closely, and expand the caps only after you see consistent, expected behavior. The guide on taking an AI trading agent live in 2026 covers the full checklist for this transition. You should also review how audit logs keep MCP agents accountable so you have full observability from day one.

How should you monitor a multi-market agent?

Running one agent across multiple markets increases complexity. A position in a perps venue might hedge or amplify a position in an options venue, and the agent might not correctly account for correlation risk. You should monitor the agent through audit logs that record every MCP tool call, every order attempt, and every rejection. These logs let you reconstruct exactly what the agent was trying to do, and the article on how audit logs keep MCP agents accountable explains how this observability works.

Watch for dollar-based sizing errors. The agent might think it is risking one hundred dollars, but slippage or fees on the underlying venue can change the actual exposure. Watch for order book misreadings, which are common when agents switch between market types with different depth structures. Remember that automation does not reduce risk. Trading can lose money, including everything, and a multi-market agent can lose across several positions simultaneously if the limits are too loose.

Frequently asked questions

Can the agent trade all five market types at once?

Yes, if the owner authorizes the key for all five market types. The key can be scoped to any combination of stocks, crypto, perpetual futures, options, and prediction markets. The agent uses the same interface for each, but the owner can restrict it to a single market or a subset.

What happens if the agent tries to withdraw funds?

The agent cannot withdraw funds. Withdrawal addresses are owner-approved only, and the scoped key does not have permission to move capital out of the wallet. The agent can only place orders within its budget cap.

Can the agent override its own budget cap?

No. The budget cap is enforced at the key and wallet layer, not inside the agent's logic. The agent can request a larger budget, but the key will refuse orders that exceed the cap until the owner manually increases it.

How do I test limits without risking real money?

Paper trading uses the same API shape but executes against simulated markets. You can test the exact limit behavior, including rejections, before authorizing a live key. Live trading requires explicit owner approval.

Does the API guarantee profits?

No. Trading can lose money, including everything. Hard limits are designed to slow losses and cap exposure, not to prevent losses or guarantee returns. The owner must still set the limits and monitor the agent.

What is the difference between paper and live keys?

Paper keys simulate execution and do not move real funds. Live keys are authorized by the owner and interact with real markets. The transition from paper to live requires a deliberate authorization step that the agent cannot perform itself.

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.