· four exchange APIs · rebuilt daily

The finding
Large language models generate inaccurate arithmetic in up to 30 percent of multi-step financial calculations because they predict text tokens rather than performing mathematical operations.
They summarize forum threads, extract smart contract events, and group wallet clusters efficiently.
They fail when calculating liquidation thresholds, funding rate drag, or position sizes.
Execution workflows require Python or deterministic code for numbers, leaving language models to handle text.
Large language models excel at processing unstructured text onchain and offchain. Governance proposals on forums contain thousands of words of technical context. A model can extract parameter changes, voting deadlines, and target contract addresses from proposals across multiple protocols in seconds.
Address labeling represents another functional application. Smart contract logs emit raw event data, transfer traces, and function calls. Language models convert these raw traces into readable descriptions by matching byte patterns against known application binary interfaces. They classify wallet behavior into arbitrage bots, liquidation engine calls, or treasury transfers without manual pattern matching for every contract update.
Smart contract code auditing at a high level also benefits from language model ingestion. Models flag standard vulnerability patterns, missing access control modifiers, and unhandled return values across Solidity files. They serve as automated code readers, highlighting specific functions for human verification before deployment.
Worth knowing
Parsing smart contract source code with a language model identifies variable names and logic flows, but it does not verify formal execution proofs or state transitions.
Language models process input by breaking text into tokens, which are character chunks rather than numerical values. When a model processes numbers like 10,762,888,506 or 0.00055, it splits those digits into arbitrary token blocks based on statistical training data.
The model does not possess a built-in calculator or memory registers for arithmetic logic units. It selects the next token based on statistical probability across its training corpus. Asking a model to multiply a margin position size by leverage and subtract cumulative funding drag is mathematically identical to asking it to complete a sentence.
Tokenization introduces errors when numbers cross digit boundaries. Multiplying a 6-digit contract size by an 8-digit price feed produces token sequences that look statistically plausible to the model but contain wrong digits in intermediate positions. A single wrong digit in an account margin calculation alters a liquidation price by hundreds of dollars.
Where this goes wrong
Prompting a language model to compute position leverage or margin requirements directly risks unexpected liquidation. Always pass raw numbers to a script engine.
Calculating holding costs across venues requires exact arithmetic. Per-8-hour funding rates look small as percentage points, but leverage multiplies their impact on equity over time.
Consider the live perpetual futures funding rates across major exchanges for major assets:
| Asset | Venue | 8h Funding Rate | Futures Maker Fee | Futures Taker Fee |
|---|---|---|---|---|
| BTC | Bybit | +0.0020% | 0.0002 | 0.00055 |
| BTC | MEXC | +0.0035% | 0.0 | 0.0002 |
| BTC | Bitget | +0.0100% | 0.0002 | 0.0003 |
| BTC | OKX | +0.0100% | 0.0002 | 0.0005 |
| ETH | Bybit | -0.0121% | 0.0002 | 0.00055 |
| ETH | MEXC | -0.0051% | 0.0 | 0.0002 |
| ETH | OKX | -0.0030% | 0.0002 | 0.0005 |
| ETH | Bitget | +0.0024% | 0.0002 | 0.0003 |
For a long ETH position, Bybit offers the lowest funding rate at -0.0121% per 8 hours. Holding a long position on Bybit yields a funding credit, whereas holding the same long position on Bitget incurs a funding debit of +0.0024% per 8 hours. The spread between Bybit and Bitget is 0.0145 percentage points per 8 hours.
If an AI model processes this venue comparison and misreads Bitget's taker fee of 0.0003 as 0.003, or miscalculates the 24-hour cumulative funding spread, the venue selection logic fails. On a 100,000 USD position at 10x leverage, a 0.0145 percentage point shift per 8 hours equals 14.50 USD per interval, or 43.50 USD per day in avoidable funding cost.
What to do instead
Use language models exclusively to generate executable code or parse contract events, then execute all mathematical operations inside a dedicated runtime environment like Python.
A reliable trading infrastructure separates qualitative parsing from quantitative calculation. The language model acts strictly as a translation layer between human language, contract documentation, and system parameters.
In an automated workflow, the language model reads governance updates or protocol parameters, converts the information into JSON format, and outputs structured key-value pairs. A local execution script reads that JSON payload, validates the schema, and routes the numerical parameters into standard execution code.
The execution script computes margin ratios, position sizing, order routing fees, and slippage tolerances using double-precision floating point standard libraries or arbitrary-precision decimal modules. The language model never sees or calculates the final order size. This separation guarantees that probabilistic output never touches account balances or order submission endpoints directly.
Language models process governance updates, label active wallet addresses, and summarize contract logic. They remove manual overhead when reading protocol documentation or tracking onchain events.
Language models predict text tokens based on statistical probability rather than calculating equations with arithmetic hardware logic. Numerical digits are split into arbitrary token patterns that cause rounding and multiplication errors.
Restrict the model to parsing unstructured text into standard JSON parameters. Pass those parameters to deterministic code written in Python or Rust to perform position sizing, liquidation math, and fee calculations.
Live spreads reach 0.0145 percentage points per 8 hours on ETH perps across Bybit and Bitget. Holding positions on the wrong venue accumulates substantial fee drag over multi-day holding periods.