Agentic tradingPerpetual futuresRiskMCP

How AI agents mishandle perpetual futures and how to prevent it

AI agents trading perpetual futures through MCP often fail because they ignore funding, misuse leverage, and forget margin. Prevent these errors with scoped limits and proper testing.

By the Felix team11 min read
Key takeaways
  • 01Perpetual futures are not spot assets; funding rates and margin mechanics will erode or destroy capital if the agent ignores them.
  • 02Leverage magnifies errors, so an agent must size positions by notional exposure and account for liquidation distance, not just entry price.
  • 03A stateless MCP agent can open trades and forget them; exit plans and stop losses must be defined before the first order is placed.
  • 04Hard limits, scoped keys, and a kill switch enforced at the API level are the only reliable defenses against an agent that misinterprets market data.
  • 05Paper trading on Felix reveals whether an agent respects funding, margin, and stops before any real money is at risk.

AI agents trading perpetual futures through MCP often fail because they treat perps like spot assets, ignore funding costs, and miscalculate leverage. These mistakes compound quickly when an agent opens large positions, forgets to monitor margin, or assumes a perps venue behaves like a stock broker. The result is usually forced liquidation or slow capital erosion rather than the intended systematic edge. Preventing these errors requires understanding the specific mechanics of perpetual contracts and enforcing strict safety limits before the agent touches live markets.

What makes perpetual futures different for AI agents?

Perpetual futures are derivatives that track an underlying price but never expire. Unlike a spot market, where owning an asset means you hold it in a wallet, a perps contract is a margined bet on direction. The price you see on a perps venue is the mark price or last traded price, which can diverge from the spot index, especially during volatile periods. An AI agent that consumes a generic market data feed may not distinguish between spot and mark price, leading it to believe an arbitrage exists when it is actually looking at two different instruments. Because perps use margin, the agent must also track collateral, notional exposure, and the liquidation price. A single large position can tie up most of the account's free margin, leaving no room for the agent to open hedges or absorb adverse moves. On Felix, orders are sized in plain US dollars and the API normalizes venue specific contract math, but the agent still decides how many dollars of notional exposure to request. If the agent treats that dollar figure as a spot purchase, it may not realize that a 10 times levered position moves ten times faster than the account balance suggests. On a stock broker, a margin call gives you time to deposit more capital. On a perps venue, liquidation is instant and automatic. The agent cannot negotiate for more time. It must maintain a buffer above the maintenance margin at all times. This means the agent needs to know not just the entry price, but the exact distance to liquidation in percentage terms. If that distance is smaller than the asset's typical daily range, the position is unsafe regardless of the agent's directional conviction. The funding rate is another layer that spot markets do not have. A perps venue charges or pays funding periodically to keep the contract aligned with the underlying index. An agent that holds a position through multiple funding intervals without accounting for these payments is effectively leaking value. The agent might even flip direction repeatedly, paying funding on both sides, because it does not read the funding rate as a cost of carry. Developers should expose funding data to the agent explicitly and prompt it to consider the cost before deciding to hold overnight.

Why do agents ignore funding rates?

Funding rates are invisible to an agent unless the developer surfaces them in the tool schema or system prompt. Many MCP toolkits expose price, balance, and order status, but omit funding rate history or predicted funding. An agent with incomplete context will optimize for price direction alone. Suppose the agent detects a bullish trend and opens a long. If the funding rate is highly positive, longs pay shorts every eight hours. Over a week, the funding cost can exceed the profit from the price move, yet the agent marks the trade as successful because it only looks at close price minus entry price. The problem worsens when the agent uses leverage. A leveraged long pays funding on the full notional size, not just the margin posted. A 5 times leveraged position pays five times the funding that a single unlevered position of the same equity would pay, if the equity were deployed in spot. The agent sees a small margin requirement and assumes the carrying cost is equally small. It is not. Some developers try to solve this by telling the agent to avoid holding positions during funding. This is impractical. Funding occurs on regular intervals, often every hour or every eight hours. An agent that trades on hourly signals will almost always cross a funding window. The correct approach is to include the funding rate as a cost in the expected return formula, not to avoid it entirely. If the agent cannot perform this calculation, it should not trade perps. To fix this, the developer should include a funding cost estimate in the reasoning step before the trade. Before the agent calls the trade tool, it should calculate the expected funding drain over the intended hold period. If the expected funding exceeds the expected price move, the agent should pass. This sounds simple, but in practice many agents lack the reasoning depth because the prompt does not force the calculation. A well designed MCP server for trading should expose funding as a first class input, not a footnote.

How does leverage break position sizing?

Position sizing is the most common failure point for AI agents on perps. The agent receives a portfolio value, say ten thousand dollars, and decides to allocate twenty percent to a single trade. In a spot market, that means buying two thousand dollars of the asset. On a perps venue, the agent might set leverage to 5 times, so the two thousand dollars of margin controls ten thousand dollars of notional exposure. The agent has now put the entire account's equity at risk on a single directional bet. A two percent move against the position wipes out the allocated margin, and a ten percent move threatens the whole account. The Felix API sizes orders in plain US dollars, which helps, but the agent still chooses the leverage parameter or the notional target. If the agent requests a ten thousand dollar position because it wants a ten percent allocation on a ten thousand dollar account, but also selects 10 times leverage, it has accidentally created a position that is one hundred percent of equity. The API cannot read the agent's intent; it can only enforce the hard limits that the developer configured beforehand. This is why scoped API keys and position limits matter. A scoped key can cap the notional size per order, per market, or per day. The developer should set these caps based on the worst case the account can survive, not on the agent's optimistic plan. If the agent cannot request more than two thousand dollars of notional exposure, the leverage mistake becomes less dangerous. The single API safety model also enforces budget caps and drawdown limits that stop the agent before it compounds a sizing error into a liquidation.

What happens when agents chase liquidation prices?

Liquidation is automatic on a perps venue. When margin drops below the maintenance requirement, the position is closed by the venue at a loss. An AI agent that does not track its liquidation price, or that does not understand how adding to a losing position changes that price, can march directly into a wipeout. The typical failure pattern looks like this. The agent opens a long. The price drops. The agent reasons that the asset is now cheaper, so it should buy more to lower its average entry price. It adds to the position, using more margin. The price drops further. The agent repeats the logic. Each addition raises the liquidation price, because the maintenance margin requirement is calculated on the total notional size. Eventually a small wick triggers liquidation, and the entire position is lost. Another subtle error is the agent using notional value to calculate its remaining margin. It sees a ten thousand dollar position and one thousand dollars of margin, then concludes it has nine thousand dollars of free capital. That is false. Free capital is the distance to liquidation minus a safety buffer, not the difference between notional size and margin. An agent that allocates its free capital this way will stack overlapping positions that share the same collateral, creating a hidden cross margin risk. An agent may do this because its training or prompt suggests that averaging down is a valid strategy. In spot trading, averaging down only risks the capital deployed. In leveraged perps, averaging down accelerates the approach to liquidation. The agent also confuses mark price with last price. It sees a recent trade at a favorable level and believes it has more breathing room, while the mark price used for liquidation is already closer to the danger zone. The only reliable protection is a kill switch and a hard stop. A kill switch flattens the position and revokes the agent's access when the margin ratio crosses a threshold. This must be set outside the agent's reasoning loop, because the agent will rationalize why it should stay in the trade. Felix provides a panic switch that operates at the infrastructure level, so the owner can intervene even if the agent is stuck in a loop.

Why do agents forget to set stop losses?

An MCP agent is stateless by default. Each turn, it receives context and decides what to do next. It does not inherently remember that it opened a position three hours ago unless the developer includes that position in the context window. This means an agent can open a trade, lose the thread during a long reasoning chain, and never return to manage the exit. Developers sometimes assume that because the agent is intelligent, it will naturally manage open positions. Intelligence does not imply memory. Without explicit retrieval of open positions, profit and loss, and margin status on every turn, the agent is effectively flying blind. The MCP server must push this state into the context window, or the agent will treat each decision as if the portfolio were empty. Stop losses on perps are also more subtle than on spot. A stop loss set too tight will be hit by normal volatility wicks, especially on leverage. A stop loss set too loose will not trigger before liquidation, making it useless. The agent must set the stop outside the noise zone but inside the liquidation zone. That requires knowing the maintenance margin requirement and the typical volatility of the market. The better approach is to define an exit plan before entry. The exit plan includes a stop price, a take profit price, and a time limit. If the agent cannot monitor the position continuously, it should not enter. On Felix, the developer can enforce this by requiring the agent to submit a stop order simultaneously with the entry order. If the agent refuses, the API rejects the entry. This forces the agent to plan the exit as part of the entry decision. Audit logs and observability are essential here. They let the developer review whether the agent is actually managing positions or simply opening them and abandoning them. During the first weeks of live trading, every position should be reviewed for exit discipline.

How should you test before going live?

Paper trading is the only way to see whether an agent understands perps mechanics without risking capital. Felix offers paper trading that simulates margin, funding, and liquidation. The developer should run the agent for a meaningful period, ideally through different volatility regimes, to see if it accumulates funding costs, if it respects position limits, and if it exits according to plan. Do not judge the agent solely on paper profit. A profitable agent during a strong trend may still be broken, because it might be ignoring funding and simply getting lucky on direction. Instead, review the logs for behavior.

  • ·It doubles down after losses instead of exiting.
  • ·It opens positions that exceed the scoped notional limit.
  • ·It holds through multiple funding intervals without mentioning cost.
  • ·It enters trades without calculating the liquidation price first.
  • ·It abandons positions and never submits exit orders.

Developers often rush to live markets because paper trading feels slow. Resist this. The purpose of paper trading is not to prove the agent is profitable; it is to prove the agent is safe. A safe agent that breaks even in paper trading is a better candidate for live capital than a risky agent that happens to be up twenty percent during a lucky week. Live capital should only follow a long period of predictable, disciplined behavior. If the agent's logic changes with every context window, or if it hallucinates new strategies mid session, it is not ready. When the behavior is consistent, move to live trading with a small budget cap and a tight kill switch. Taking an AI trading agent live with MCP requires explicit owner authorization of the key, which is a deliberate speed bump. Use that pause to verify that the live limits are stricter than the paper limits. If the agent passes the paper stage but fails in live markets, the difference is usually emotional or related to infrastructure, but with an AI agent the failure is usually a limit that was too loose or a context window that was too short.

Frequently asked questions

Can an AI agent trade perpetual futures without taking my funds?

Yes. Felix is non-custodial by construction. The agent can place orders within scoped limits but cannot withdraw funds or change approved withdrawal addresses.

What is the most common mistake when an AI agent first trades perps?

The most common mistake is treating perps like spot assets. The agent ignores funding rates, uses leverage without understanding margin, and opens positions that are far too large for the account balance.

How do I stop an agent from losing everything on a bad trade?

You set hard budget caps, position limits, and a kill switch before the agent starts. Felix enforces these at the API level, so the agent cannot override them.

Should I let an AI agent use high leverage?

No. High leverage amplifies mistakes. Start with low or no leverage, confirm the agent understands notional sizing, and only increase exposure after prolonged paper trading.

Does paper trading capture the real risks of perpetual futures?

Paper trading captures funding costs and liquidation mechanics on Felix. It will not predict future price movements, but it will reveal whether your agent respects margin and stops.

How do I monitor what my agent is doing?

Use audit logs and observability tools to track every order, funding payment, and margin change. Review these logs daily during the first weeks of live trading.

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.