# What 54 invariants and 1,895 mutants mean for you

> Canonical: https://blazephoenix.xyz/learn/what-54-invariants-mean-for-you/
> License: CC BY-NC-ND 4.0 (attribution + link) · © 2026 BlazePhoenix
> Updated: 2026-11-16

An invariant is a rule that must still be true after any sequence of actions, and a mutant is an error planted on purpose to see whether the tests turn red. In the V2 source at commit 969bcc6, 54 counts stateful invariants in 18 files and 1,895 counts registered mutants. These numbers describe how the code is tested, not a probability that it is correct, and they say nothing about V1.

An invariant is a rule that must still be true after any sequence of actions, and the test tool tries to break it with random sequences. A mutant is an error planted on purpose, to see whether the tests turn red (Whitepaper 2.4 §15.1).

Think of a smoke alarm. Pressing the test button shows that the alarm can sound. Holding real smoke under it for a minute is the invariant test. Breaking the alarm on purpose and checking that the monthly test notices is the mutant.

## What each number counts

All counts are for the V2 source at commit 969bcc6, and each one is printed next to what it was counted against (Whitepaper 2.4 §15.1).

## Why it matters to a swapper

The invariants include the rules you care about: the Router holds nothing after a swap, and what is delivered never falls below your minimum or the protocol floor. The invariant campaigns run 50 sequences of depth 50 with a fixed seed, so a failure can be reproduced (Whitepaper 2.4 §15.1).

The staking contract has its own count: 21 stateful invariants in 6 files. Staking is scheduled for Q2 2027 and has no address yet.

## What the numbers do not say

They do not give a probability that the code is correct. The whitepaper says that testing cannot produce one, and it states none (Whitepaper 2.4 §15.11).

They describe V2, which launches on 15 December 2026. Nothing in them protects V1, the generation that is live today (Whitepaper 2.4 §19).

## Count one of them yourself



**Verify it yourself:** In a checkout of the V2 repository at commit 969bcc6, run git grep -h "function invariant_" -- test | wc -l. The count should be 54. Add the -c option and drop -h to see the per-file counts across 18 files.

Related: https://blazephoenix.xyz/learn/invariants-for-beginners/ · https://blazephoenix.xyz/learn/mutation-testing-for-beginners/ · https://blazephoenix.xyz/learn/what-1320-tests-mean-for-you/
