AI AGENTS·TRADING MATH·VERIFIABLE COMPUTATION

Why AI agents need exact calculations they can verify

Current LLMs get most trading math right. The trouble is the answers they get wrong, because they look just like the right ones. If your agent moves money, it needs a way to check a number before acting on it.

01THE PROBLEM

Mostly right, and you cannot tell when it is not

In October 2026 we tested 6 current models, a flagship and a smaller model from each of OpenAI, Anthropic and Google, on 630 trading-math questions with fresh random inputs: option prices and Greeks, forex lot sizing, VaR and Sharpe ratios, Kelly sizing, inverse-contract PnL and liquidation. 97% of the answers were within 1% of the exact value, and the best model got all of its answers right.

The rest is the problem. 12 of the 17 wrong answers came with a stated confidence of 80% or more, several at 95 to 100%. They clustered where real agent work happens: statistics over a series of returns (VaR from 40 daily returns was wrong in 6 of 30 answers) and contract conventions (a short on an inverse contract reported as a profit after the price rose). Results by model and task, method and every raw reply.

Researchers at MIT CSAIL describe the same pattern from the training side: standard reinforcement learning rewards a lucky guess as much as careful reasoning, so models become more capable and more overconfident at the same time.

So the issue is not that models are bad at math. It is that:

  • A wrong answer looks the same as a right one, confidence included
  • Venue conventions (inverse contracts, coin-settled options, fee schedules) are easy to get backwards
  • The same prompt can return different answers on different calls
  • There is no way to audit why a specific number was produced

For a person asking “roughly what's my VaR,” 97% is fine. For an autonomous agent that sizes and closes live positions, an error it cannot detect is not.

02CONCRETE EXAMPLE

One answer from the test, worked

The question, as a user would ask it: “My last 40 daily returns in %: … What is my 1-day 99% parametric (normal) VaR, in %, using the sample mean and sample standard deviation?” Here is one flagship model's answer next to a tool call on the same 40 numbers:

MODEL ANSWERING ON ITS OWN

“Sample mean −0.03025%, sample standard deviation 2.968108%. VaR 99% = 2.326348 × s − mean ≈ 6.9351%.” Stated confidence: 100.

The exact value is 6.7877%. The true sample mean is +0.04475% and the standard deviation 2.937002%, so both inputs were slightly off and the VaR came out about 2% too high. Every step looks reasonable. You would only catch the slip by redoing the math.

DETERMINISTIC TOOL CALL
workflow.run_var_cvar
{
"returns": [ -0.025, 0.0447, /* the same 40 returns, as decimals */ ],
"confidence": 0.99
}

Returns var 0.067877 (6.7877%), plus cvar, mean and stdev, in a signed result. Same on every call, and anyone can recompute it from the published formula.

A 2% error on one VaR figure looks harmless. An agent that sets position limits from it, every day, across many accounts, carries it into every decision.

03BEYOND ACCURACY

It is about verifiability, not just accuracy

As models improve, accuracy alone stops being a reason to call a tool. What a deterministic, verifiable calculation adds is a number that can be reproduced and checked. That matters for four reasons:

Proof that travels with the number

Every tool result is signed, so an agent, a reviewer or another system can confirm offline that a figure came from the tool unaltered. The formulas and test vectors are public, so the figure itself can be recomputed independently.

Debugging

When a trade goes wrong, you can replay the exact calculation that sized the position. With an LLM-computed number, you cannot reproduce it.

Compliance

"The LLM said so" is not a defensible answer for regulated trading systems. A deterministic formula with traceable inputs is.

Consistency across agents

Multi-agent systems (analyst, risk, execution) must agree on the same numbers. Shared deterministic tools enforce that; each calling an LLM inline does not.

04ARCHITECTURE

What a deterministic computation layer looks like

The right architecture separates reasoning (LLM) from computation (deterministic tool). The LLM reads user intent, selects the appropriate tool, and interprets the result. The tool does the math.

ARCHITECTURE PATTERN
1.
User intent: LLM reads: "Buying EUR/USD at 1.0850, stop at 1.0820, risk 1% of my $10,000 account"
2.
Tool selection: LLM selects: workflow.run_forex_position_size_live with extracted parameters
3.
Deterministic call: Tool runs the exact formula: returns { stopDistancePips, units, lots, fxRate }
4.
Interpretation: LLM explains the result in plain English: "Trade 0.33 lots, risking exactly $100"

The LLM never touches the arithmetic. It is the interface. The tool is the calculator.

05NO ROOM FOR ERROR

Which calculations need to be exact

Not every calculation in a trading system carries equal weight. These are the ones where approximation is not acceptable:

Option Greeks and implied volatility

Hedge ratios come straight from delta, and a volatility read sets what an option is worth. A small slip in N(d1) or in the volatility solve moves every hedge built on it.

Position size from risk %

Over-sizing by 20% because the stop distance or the pip value was mis-calculated means you are risking 1.2% of account when you believe you are risking 1%. Compounded over time, this breaks your risk model.

VaR and Sharpe from a return series

This is where models slipped most in our test: one wrong sum of squares changes the standard deviation, and every limit or allocation built on that figure inherits the error.

Liquidation price

An agent that underestimates liquidation distance may recommend holding a position that is closer to forced closure than the user thinks. A 5% error on this number can mean the difference between a managed exit and an automated liquidation.

Breakeven price

If an agent tells you your breakeven is $83,050 but it is actually $83,091 (because fees were ignored), you may hold a position longer than needed, or exit too early believing you are at breakeven.

Funding cost over time

A long-running carry trade or hedge position that fails to account for funding accumulation can turn profitable on paper into a loss in practice. The difference is deterministic math on funding rate × notional × periods.

R:R ratio and verdict

An agent deciding whether to take a trade needs an exact R:R ratio, not an approximation. A 2.05:1 real R:R versus a 1.8:1 estimate can flip a trade recommendation.

06SETUP

Add exact math to your agent in 5 minutes

TradingCalc exposes 100 deterministic tools via MCP (Model Context Protocol), the standard interface for giving AI agents access to external tools. Setup takes one config change.

CLAUDE DESKTOP / CURSOR / VS CODE
claude_desktop_config.json
{
"mcpServers": {
"tradingcalc": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://tradingcalc.io/api/mcp"]
}
}
}
DIRECT HTTP CALL
curl
curl -X POST https://tradingcalc.io/api/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0", "id": 1,
"method": "tools/call",
"params": {
"name": "workflow.run_pre_trade_check",
"arguments": {
"side": "long",
"entry_price": 83000,
"stop_loss": 81000,
"account_balance": 5000,
"risk_pct": 1,
"leverage": 5,
"funding_rate": 0.0001,
"hold_hours": 24
}
}
}'

Free tier: no signup required. 100 calls/day anonymously. View all 100 tools →

07SELF-VERIFICATION

An agent can verify its own computation layer

One of the MCP tools is system.verify. It runs all 60 canonical test vectors against the live production code and returns pass/fail with expected vs actual values.

An agent starting a trading session can call this first. If it passes, every calculation during that session is guaranteed to use verified formulas. If it fails (e.g. after a deployment), the agent can refuse to trade rather than operating on potentially broken math.

Read the full methodology → · View live verification proof →

TL;DR

  • + Current LLMs get most trading math right, about 97% in our October 2026 test.
  • + Their wrong answers look just as confident, so an agent cannot tell which ones to distrust.
  • + So an agent should take its numbers from a tool whose results can be recomputed and checked.
  • + The right pattern: LLM for intent + deterministic tool for computation.
  • + TradingCalc provides 100 MCP tools covering position sizing, liquidation, PnL, funding, risk, Market Profile, on-chain safety, options, forex, and prediction markets.
  • + Free tier, no signup. One config line to connect.