Skip to main content

AI-First Trading Principles for Crypto Scalping

· 17 min read
Vadim Nicolai
Senior Software Engineer

A fill-at-touch backtest can show Sharpe 5 where live reality is negative. The fills you actually receive are the ones that lose money. An AI graded by that simulator learns to farm phantom maker fills. The simulator is not a test. It is the model's reward function. That is the sharpest trap I know.

Everything that decides whether an AI makes money on a crypto perp lives in the coupling between model and market: fees, fills, latency, funding, regime. A round trip costs 4–14 bps before the model says a word. Here are eleven principles, ordered the way a trader would order them, each ending with the condition that breaks it.

Where these come from

The screen is a two-leg removal test: delete the AI and the principle must go vacuous, delete the market and it must go inapplicable. I ran the same test over my own codebase, where 0 of 108 modules survived both legs. Everything below is enforced in a running system or measured in one, and the numbers are mine unless a paper is named.

I. The economics come before the model

Edge is denominated in fees, and the model inherits the denomination

Before any model runs, the venue has already priced the game. On a Binance USDT-M perpetual at VIP0, maker is ≈2 bps a side and taker ≈5 bps, so the full round trip lands anywhere between 4 and 14 bps depending on the leg mix: maker-in/maker-out ≈4–5 bps, maker-in/taker-out ≈8–9, taker both ways 12–14. My minimum-viable-edge rule is that the expected move must clear 1.5× the worst-case round trip, which is how the design geometry became +15 bps take-profit against −6 bps stop: realised, that is roughly +11 on a maker-exit win and −15 on a taker-exit loss, a breakeven win rate around 58%.

The AI-first consequence is that this arithmetic is not advice the model receives — it is the shape of the model's vocabulary. My proposer may move exactly three numbers, and their walls were computed from the fee table before any model was ever called: tp_bps in [10, 25], sl_bps in [4, 10], time_stop_s in [20, 120]. A proposal outside a wall is refused by name, never clipped. The AI cannot propose the trade the fee schedule already killed, because the fee schedule was compiled into its cage.

Breached when the model's proposal space contains geometries that lose to fees — or when a band is widened without redoing the fee arithmetic that set it.

At retail latency, the AI trades events, not time

Physics first: the round trip from my desk to the matching engine is ~272 ms, and see-signal-to-order lands at 300–600 ms against colocated participants operating under 5 ms. Order-book imbalance has most of its predictive mass in the first few hundred milliseconds — exactly the unreachable window. What survives at retail latency is the slow residue of the signal: discrete liquidity events. A genuine sweep is followed by 15–25 bps of continuation over roughly 45 seconds, which is one of the few sub-minute structures wide enough and slow enough to trade from 300 ms away.

So the entry is an event conjunction, not a forecast: six conditions must hold at one instant — the sweep itself, imbalance ≥ +0.30 toward the side, CVD z-score ≥ +1.0, microprice tilt agreeing, regime and spread admissible, risk layer green. The order joins the passive quote, rests 800 ms, and is cancelled if unfilled — never repriced, because chasing converts maker economics into taker economics and taker economics lose by the table above. Low signal frequency is a feature. An AI that must trade every bar has already lost to fees; the discipline is teaching it to wait.

Breached when the model is asked for a decision on every tick — or when an unfilled entry is repriced instead of expired.

II. What the market does to the model

The fill the model wants most is the fill that loses money

A resting order is filled by someone who knows more. The spread exists to pay for that. Bid, ask and transaction prices in a specialist market with heterogeneously informed tradersGlosten & Milgrom 1985 — derived the spread from adverse selection alone, with no inventory cost and no transaction fee. On my book, that compensation is thin: BTC spread sits at 1–2.5 bps, against a 2 bps maker fee per side.

The Market Maker's Dilemma (arXiv:2502.18625) runs a live trading experiment on the Binance Bitcoin perpetual — real orders, real fills, not a backtest. It documents a negative correlation between maker fill likelihood and post-fill returns. The conclusion: "viable maker strategies often require a contrarian approach, counter-trading the prevailing order book imbalance," and these dynamics render the commonly-cited maker strategies unprofitable. The sign reproduced in my own data unprompted: on a 24,000-row synthetic fill panel, order-book imbalance averaged 0.0047 on filled rows against 0.0446 on unfilled — a 9× gap, the fills arriving exactly when the flow runs against the resting order.

The taker side is no kinder, only asymmetric. The good, the bad, and latency (Quantitative Finance, 2025) sends millions of live market and marketable-limit orders across Bybit and Binance. It is the same four authors and one research programme, so read it as one body of evidence rather than two confirmations. The finding is "a consistent disadvantage to the trader": profitable orders fill worse than expected, while unprofitable ones fill exactly as badly as modelled. At taker costs of ~5 bps a side plus 1–2 bps of slippage at top-of-book size, an execution that lands even 2 bps worse than modelled erases a quarter of the +11 bps win the geometry was built on. The trading principle for an AI: any learned fill model must be two-headed, predicting fill probability and post-fill markout jointly, or optimising it steers the strategy into the adverse half of its own distribution.

Breached when an AI is trained to maximise fills — or when a fill model has one head.

The trade's sign is an experiment, not a parameter

My entry follows the sweep — continuation. The best live evidence on the venue says the money is in counter-trading it — reversal. That disagreement is genuine, current, and exactly the kind of question an AI operator will try to resolve by quietly flipping a parameter, which is why the sign is structurally not proposable: direction carries no clamp band, so the proposer's no-band branch refuses it by name the moment a proposal mentions it.

The sign gets settled the only way a sign should: one pre-registered experiment, continuation and reversal as each other's control, spending one holdout read, on my venue at my latency. Until that run, both templates exist and neither is believed. The model may move numbers inside declared walls; it may not change what the strategy is while nobody is looking — because a flipped sign is not a tuned strategy, it is a different strategy wearing the old one's track record.

Breached when the model can flip long/short semantics — or when a sign is adopted from a paper instead of from a pre-registered run on your own venue.

Crypto's native state is an input advantage, not an edge

The inputs that make crypto crypto have no equities analogue: the funding countdown, the mark-versus-index basis, liquidation flow — and a strange algorithmic clock. The Quarter-Hour Effect (arXiv:2607.09426) documents it: periodic bursts of volatility and volume at the 1-minute, 5-minute and 15-minute marks on Binance perpetuals, measured across 6 perpetual contracts. Opening order imbalance predicts returns over a 4–12 hour horizon, with "much weaker effects at finer clock-time frequencies." These are the only inputs that could ever put a trading model at the AI × crypto intersection, and I decoded them into my own feature set for exactly that reason.

Then the trap, and it is the most instructive negative result I know in this space. Funding-Aware Optimal Market Making for Perpetual DEXs (arXiv:2605.06405) treats the funding rate as a stochastic state variable — inventory carries both mark-to-market exposure and a state-dependent funding cash flow — and solves the control problem with a monotone finite-difference HJB scheme. No learned model anywhere. In 100-seed holdout simulations with funding calibrated on Hyperliquid ETH, BTC and SOL perpetual data, "the funding-aware HJB improves mean ETH/BTC performance while lowering inventory RMS relative to classical Avellaneda-Stoikov" — better performance and less inventory risk than the 2008 baseline, from adding one state variable to forty-year-old machinery. So I shipped my own funding and basis feature badged crypto-native × classical, and moved the intersection count by zero: a crypto-native input does not make an AI-native edge. The model leg has to be earned separately, on data, with the classical scheme as the baseline it must beat.

Breached when "we use funding/on-chain/liquidation data" is offered as evidence the strategy is AI-first — without a classical control fitted on the same inputs.

III. The AI as trader

The best trade the AI makes is no trade

The regime filter is the highest-leverage decision in the whole stack, and it is a decision not to act. In LOW volatility the expected move is smaller than the round-trip cost, so every signal is noise you pay fees to hold; in EXTREME volatility, slippage and stop-gap risk dominate the geometry. Both block. Fees are fixed; opportunity scales with volatility; the tradable band is the middle.

Which makes the filter's warmup a trading matter, not a code style. An unwarmed volatility estimate substituted as 0.0 ranks LOW — and my entry gate treats LOW as merely one blocked regime while the volatility percentile gate reads that same zero as calm and lets trades through elsewhere: the identical fabricated number blocks one path and unblocks another. So every feature refuses when it does not know — None, never zero. I paid for this lesson twice, measured. A p99 threshold computed over ten samples is pinned to its top order statistics: 0.99 × 9 = 8.91 interpolates between the 9th and 10th values. So my sweep detector's bar was effectively "the largest bucket seen so far", and ordinary flow cleared it — 42 sweeps before the warmup floor, 30 after, every vanished one inside the warmup window. And a volatility EWMA fed into its own percentile distribution during warmup labelled 93% of quotes EXTREME, silently refusing every sweep the detector had found. A detector and a filter, each plausible alone, cancelling to zero trades.

Breached when an unwarmed statistic reaches the entry decision as a number — or when "don't trade" is treated as a failure mode instead of the most profitable output the AI has.

The AI trades at tick speed and learns at week speed

A scalper's tick loop runs at ≤100 ms. A model is a seconds-long network call. Those two facts alone dictate the architecture: no model call sits on any path that reaches submit_order — enforced as an import graph, so the AI plane and the engine literally cannot share a process, and the composition root is two processes exchanging JSON. The model emits an expiring, signed policy; deterministic code interprets it at tick speed.

Between those extremes sits supervision — 1 s breakers, 60 s incident sweeps, a 5-minute review, safe at any frequency because every action available to that loop reduces exposure — and above it sits research, which is weekly, and here is the arithmetic that makes weekly a trading principle rather than a preference. My proposer emits up to 5 hypotheses per call and a dataset retires from gating after 20: at a five-minute cadence the twentieth hypothesis lands on iteration four — twenty minutes — after which that dataset can never gate anything again. A week of five-minute iterations is 2,016 calls against a cap of 5, moving the Bonferroni-corrected two-sided evidence bar from 2.58σ to 4.22σ; and with one deployment allowed per week, 2,015 of those 2,016 iterations could not have shipped what they found. A fast research loop does not learn faster. It spends its holdout in twenty minutes and then runs forever, unable to conclude.

Breached when a model-bound call appears in the tick path — or when the learning loop's cadence outruns the statistics that make its conclusions mean anything.

The AI proposes; the market disposes

The AI's job is to propose trades as falsifiable hypotheses. Each proposal is pre-registered before the data is touched. At most five per call, at most one deployment a week, dataset retired at 20 holdout reads. The model may not choose its own yardstick — the branch it is judged under and the holdout range it is judged on are overwritten with the caller's values whatever the model returned. The backtest process deliberately omits the p-value, so no artifact in the loop can certify itself.

Its memory is a ledger it cannot edit. No weight updates in production; no memory across sessions — the prompt is a pure function of its context, byte-identical on a second session, pinned by the prompt's SHA-256 so that a changed prompt is a changed model requiring a new evaluation. What accumulates instead is on disk: a graded-claim ledger in which every predicate the previous policy asserted is recomputed and recorded as held-or-not, and a demotion record with a similarity check, so a killed hypothesis cannot come back next week with only its numbers moved. The loop improves by narrowing a bounded search with evidence it recomputed itself — and every widening of the search is a human act.

Breached when any output of the model changes how the model is evaluated — or when agent state persists anywhere outside ledgers the model cannot write.

IV. What counts as evidence

The backtest is the model's reward function — keep it pessimistic

The opening of this post promised the sharpest trap; this is where it pays off. A fill-at-touch simulator fills every resting order the moment price touches it — handing the strategy exactly the adverse-selected subset the market would never give it, which is how a backtest reports that phantom Sharpe 5 against a negative live reality. And the model optimises into the trap with conviction, because inside the simulator's world the strategy genuinely works. Whatever grades the proposals is the objective being maximised — there is no separate loss function the AI secretly respects.

So my gate-grade fill model uses both pessimistic levers at once — no at-touch fills, and passive orders wait behind a queue the backtest could not observe — and a run under the optimistic profile is INADMISSIBLE, a different verdict from FAIL. The distinction matters: a failed gate is evidence about a strategy, while an inadmissible report is evidence about nothing, and the gate refuses to even open it. No metric escapes an exploratory run into a promotion decision, because the one thing worse than a rejected strategy is a promoted one whose evidence was manufactured by its own reward function.

Breached when any promotion evidence comes from a fill assumption the venue would not honour — or when "backtest passed" is accepted without asking which fill model graded it.

Parity failure fixes the simulator, never the strategy

When live results diverge from the backtest, there are two suspects and only one correct repair. If my realised maker fill rate drifts more than 15 percentage points from the backtest's — in either direction, because filling more often than modelled is not good luck, it is the queue model being wrong about who is ahead of you — the session halts and the finding is charged to the simulator. The suspect number is the one every gate was decided with; retuning the strategy to match a broken simulator is letting the model repair its own examiner.

The cost of getting this backwards is on the record. The Red Queen's Trap (arXiv:2512.15732) is the post-mortem of a hybrid deep-RL and evolutionary trading system — the DRL-plus-evolutionary-computation pairing "frequently hypothesized to be the 'Holy Grail' of algorithmic trading" — reporting validation APY above 300% against live capital decay above 70%. Same system; one number from the selection environment, one from the market. It names three failure modes rather than settling for "it overfit": overfitting of aleatoric uncertainty in low-entropy series, survivor bias inherent in evolutionary selection under high variance, and "the mathematical impossibility of overcoming microstructure friction without order-flow data." A gap that wide is not a tuning problem. It is the selection procedure measuring itself.

Breached when a live-versus-backtest divergence is closed by adjusting the strategy — or when the parity check has no teeth to halt anything.

Literature inspires a hypothesis; only local fills promote one

No paper can show that an edge survives your venue, your fee tier and your latency — the transfer is exactly what a pre-registered local run exists to test. In this corpus that old rule has acquired a new, sharper edge: the literature itself is adversarial, and adversarial precisely on scalping vocabulary. Of 21,305 records in my research corpus, 121 titles are exchange referral-code SEO documents, 114 of them wearing Zenodo DOIs that make them look peer-reviewed to any automated filter. On a fee-worded query they outranked every real paper — 42 spam records above the first genuine result on dense retrieval, 59 on BM25 — while conceptual queries surfaced almost none. The pollution bites exactly when you ask the question a scalper cares about, so a citation may inspire a hypothesis and may never, ever gate a promotion.

The closing evidence is the one that justifies this whole list. When Agents Trade (arXiv:2510.11695) benchmarks LLM agents trading live across multiple markets — not on historical replays — and finds that "agent frameworks display markedly distinct behavioral patterns... whereas model backbones contribute less to outcome variation." Swap the model and little changes; swap the scaffold — the fee walls of principle 1, the event discipline of principle 2, the 2-headed fill objective, the regime gate, the pessimistic simulator, the pre-registration caps of 5 hypotheses and 1 weekly deployment — and everything changes. The 11 principles above are not overhead around the interesting part. On the current evidence, they are the interesting part.

Breached when a paper's number reaches a promotion gate — or when effort flows to the model backbone while the scaffold stays unexamined.

So what

Put together, these eleven are a trader's discipline restated for a machine operator: know your costs before your signals, trade the events your latency can reach, respect what fills do to you, let experiments settle signs, treasure the no-trade, keep learning slower than trading, and never let the thing being graded own the grader.

None of this requires believing AI adds alpha — that question is still open on my desk, and the honest scoreboard so far reads: one learned fill model, refused for scoring below the constant base rate; one pre-registered sign experiment, not yet run. What the principles guarantee is narrower and worth more: when the AI does find something, the number will be real — priced against true fees, filled by a pessimistic simulator, judged on a holdout it could not peek at, at a latency it actually has.

The adjective is cheap. The count was zero. The discipline is the part you get to keep.