AMM audit for DEXs, pools and order books
In an AMM, anyone can call the pricing math with any amount, and a rounding error repeated enough times can drain a pool. Guardian tests that math with two independent teams and invariant fuzzing, and has published 20+ DEX and AMM reports.
Smart contract audits for




Jupiter

Olympus
Limit Break
Dolomite
Onchain · AMM and DEX Audit
Every curve, every tick, every fee.
- Swap math and curve invariants Constant product, stableswap and custom curves: the invariant never falls on a swap, exact-in and exact-out quotes agree, and every decimal conversion holds.
- Concentrated liquidity and ticks Tick crossing, net and gross liquidity, tick spacing and bitmaps, and positions whose bounds sit exactly on the current price.
- Rounding direction Every division rounds in the pool’s favor, tested with tokens of fewer than 18 decimals, dust trades and near-empty pools.
- Swap and protocol fees Fee growth inside and outside ranges, protocol cuts, dynamic fees, and pools that charge more than they declare.
- LP shares, mint and burn Share pricing on deposit and withdrawal, first depositors and donations, and fees a mint followed by a burn can capture.
- Price manipulation and MEV Sandwiches, front-run liquidity adds, direct token transfers and flash swaps that move a price before the pool acts on it.
- TWAP and oracle exposure Observation windows and minimum TWAP lengths, rate limits on price moves, and spot prices other protocols read from your pool.
- Reentrancy and callbacks Swap and flash callbacks, native-token refunds, token hooks, and read-only reentrancy into quote functions.
- Routers and multi-hop swaps Callback caller checks, standing approvals, per-hop fees and slippage, partial fills and leftover balances.
- Order books with onchain settlement Price buckets and order lists, cancels after fills, fee transfers on every match, and a settlement ledger that stays solvent.
- Liquidity managers Rebalancing vaults on concentrated liquidity pools: share slippage, tick checks before deposits, and reward claims.
- Pool creation and admin Factories, initializers, deterministic deployments, fee switches, whitelists and the roles that pause or change them.
Covers constant product, stableswap and concentrated liquidity AMMs, onchain order books, routers and liquidity managers on Ethereum, L2s and other EVM chains. Uniswap v4 hooks have their own Uniswap v4 Hook Audit.
Public findings
What Guardian’s DEX security audits have found.
Each card links a finding in a public Guardian report. All were resolved.
-
C-02Baseline AMM · Critical
Quotes rounded against the trader, but the transfer rounded down, so with a 6-decimal reserve token a dust buy paid about half its quoted price. That price became the pool’s average, and one small sell made it the pool price: anyone could then buy at roughly half off.
Rounding Read the finding C-02 in the Baseline AMM Round 2 report
-
TK-1Poolshark Limit · Critical
Active liquidity was stashed on a tick without being zeroed, so it counted twice. Swaps then drew on tokens from positions far from the price, and LPs could not burn.
-
H-03Limit Break AMM · High
Protocol fees were checked against an estimate from the pool’s declared fee. A pool could declare a tiny fee, charge more on swaps, and pay the protocol only its cut of the declared one.
-
POS-1Poolshark Limit · High
Accrued fees were valued at a position’s range boundary, not the current price. An attacker could mint while fees were undervalued, then burn for their full value, taking yield from other LPs.
LP shares Read the finding POS-1 in the Poolshark Limit report
-
C-02Baseline V2 · Critical
A whale could sell into the floor, send reserve tokens straight to the pool and trigger a slide. The donation deepened floor liquidity, so buying back ended at a lower price: a guaranteed profit on a short.
Manipulation Read the finding C-02 in the Baseline V2 report
-
EP-4Poolshark Cover · Critical
Cover pools follow a TWAP, capping how far the price moves per auction. When elapsed blocks were not a whole number of auctions, the cap fell off the tick grid: positions landed on invalid ticks and swaps took more than the auction held.
-
H-09Baseline AMM · High
A native-token refund ran before swap reserves reached the vault. Reentering mid-swap, a buyer could stake while harvestable yield read as zero and share in yield owed to existing stakers.
Reentrancy Read the finding H-09 in the Baseline AMM Round 2 report
-
PROU-1Poolshark Limit · Critical
The router’s swap callback never checked that its caller was a real Poolshark pool. Anyone could call it and pull tokens from every user who had approved the router.
Routers Read the finding PROU-1 in the Poolshark Limit report
-
C-01Ethereal Orderbook DEX · Critical
Matching credited maker and taker fees to the fee collector without debiting traders. Once the collector claimed them, the ledger fell short and depositors could not withdraw.
Settlement Read the finding C-01 in the Ethereal Orderbook DEX report
-
C-01Limit Break AMM · Critical
closeOrder zeroed an order’s amount before reading it for the refund. Closing any order that was not first in its price bucket refunded nothing and left the maker’s tokens stuck.
Order book Read the finding C-01 in the Limit Break AMM report
-
H-01Gamma MultiPositionManager · High
MultiPositionDeployer.deploy() had no access control. Anyone could copy a pending deployment’s public parameters, deploy first at the same CREATE2 address and make the real deployment revert, blocking token launch migrations and pools created with limit order support.
Pool creation Read the finding H-01 in the Gamma MultiPositionManager report
Onchain · How it runs
Two teams, and pool math written as code.
-
01 / Two teams
Two independent teams, one scope.
Team A pairs expert manual review with the fuzzing suite. Team B runs Helix across every corner. Each cross-checks the other.
- Expert manual review
- Competitive incentives
- Cross-checked findings
-
02 / Helix AI Auditor
Helix, the leading AI Auditor.
Hundreds of parallel agents spend billions of tokens across the entire codebase. Only human-verified findings reach the report.
- Billions of tokens
- Human-guided context
- Human-triaged findings
-
03 / Invariant fuzzing
An invariant suite around your pool.
Core safety properties become executable invariants, fuzzed across every reachable state. On an AMM, those are its liquidity and solvency rules.
- Pool liquidity never underflows
- Transfers never exceed pool balance
- Capacity covers circulating supply
-
04 / Price manipulation
An attacker who trades first.
Reviewers take every path that reads or sets a price and ask what happens if someone moved the pool first: front-run, donated to, flash-swapped or reentered.
- Sandwiches and front-run adds
- Donations and direct transfers
- Pool prices read as oracles
The suite stays with your code for every later change. Poolshark kept the Echidna harness from its Limit review: 22 invariants, more than half a billion fuzzing runs. In Baseline V2’s report, “Anchor liquidity should not decrease” failed under fuzzing, and H-01 shows how a sweep could thin the anchor range.
Published work
AMMs and DEXs Guardian has reviewed.
- Case studyPoolsharkCover and Limit directional AMMs, and the Echidna harness Poolshark kept.
- ReportsPoolshark reportsThe Cover and Limit reports, finding by finding, with Limit’s 22 invariants.
- ReportsBaselineConcentrated liquidity that holds a price floor, reviewed across releases.
- ReportsLimit BreakFixed, dynamic and single-provider pools beside an onchain order book.
- ReportsEtherealOrder book perps with onchain settlement, and later protocol updates.
- ReportsGammaPosition managers that rebalance liquidity across concentrated liquidity pools.
- ReportsFlowRouterA swap router across Uniswap v4, Ekubo, RFQ and bonding-curve venues.
- ReportsBridges ExchangeExchange pair contracts that paid dividends to liquidity holders.
Recent incidents
The failures an AMM audit tests for.
-
$223MCetus
A faulty overflow check in an imported math library let a one-token deposit buy enormous liquidity in a narrow tick range. The attacker withdrew it as real tokens.
May 2025 Our breakdown of the Cetus incident
-
$121.1MBalancer
Exact-out swaps rounded the trader’s input down. Rate providers added imprecision and low liquidity magnified it; Rekt counts 65 or more swaps in one exploit transaction.
-
606 daysCurve pools
Vyper 0.2.15 to 0.3.0 compiled the pools’ reentrancy locks incorrectly, so the locks did not hold. Four Curve pools built with those versions were drained in July 2023, 606 days after Vyper 0.3.1 fixed the bug.
“10/10 They are hands down some of the absolute best security minds in the space. This is how auditing DeFi protocols should be.”
AlphakeyPoolshark“My team and I have worked with many auditors in the past, including generally considered top tier firms. I can confidently say that we have never felt as secure as when working with Guardian.”
IndigoBaselineResource Hub
Before you book an AMM audit.
- ExplainerConstant product AMMSwaps, LPs and impermanent loss, worked by hand.
- ExplainerConcentrated liquidityHow Uniswap V3 ranges and ticks work.
- GuideRounding errorsWhy Solidity rounds, and two real findings.
- GuideOracle manipulationFrom spot price to TWAP, and what to use instead.
- GuideSandwich attacksHow they work, and the slippage limit that stops them.
- GuideRead-only reentrancyReading Curve and Balancer prices safely.
- ResearchBaseline MarketsThe High findings behind Baseline V2, and how they were fixed.
- GuideInvariant testingHandlers, ghost variables and actors in Foundry.
Questions
AMM audit questions
What does an AMM audit cover?
The pool, factory, router and position contracts, and every math library they import. Cetus lost about $223 million through a library its auditor had left out of scope, so list imported libraries in your scope too. Uniswap v4 hooks get their own Uniswap v4 Hook Audit.
Do you audit Uniswap forks and integrations?
Yes. A fork is new code wherever it differs from upstream, and an integration inherits the pool’s math. Guardian’s public reports include Gamma’s position managers on Algebra pools and FlowRouter’s routes into Uniswap v4 and Ekubo pools.
How do you test sandwich and MEV risk?
Each deposit, liquidity add and swap is reviewed against a trader who moves the price first. A slippage check must compare against state the attacker cannot move: in Gamma’s position managers, the slippage check added as a fix computed expected shares from the same manipulable state, so it always passed. That finding is acknowledged.
Do you audit order book DEXs?
Yes, where orders settle onchain. Limit Break’s AMM includes an onchain order book of linked price buckets, and Ethereal’s settlement contracts keep the balances its order book trades settle against. An offchain matching engine is scoped separately, as an Offchain Automation Pentest.
How long does an AMM audit take?
Published Guardian reviews ran under two weeks on Baseline V2 and on Ethereal’s settlement contracts, and a month on Poolshark Limit. How long a smart contract audit takes covers lead time, code freeze and fix review.
Which invariants do you fuzz on an AMM?
Liquidity and solvency rules. Poolshark Limit’s report lists “Minting a position then burning the position causes no change in global liquidity”. Baseline V2’s report lists 125 invariants, from “Positions Ticks Always Multiple Of Tick Spacing” to its solvency rule on circulating supply.
Smart Contract Audit
Other engagements
- Featured · Onchain Vanguard Audit A security audit designed to protect onchain teams facing unprecedented cyber risk. Explore Vanguard
- Managed services Managed Security Dedicated response team, red team, 24/7 attack and defense across every surface you run, onchain and off. Explore Managed Security
- OnchainSmart Contract AuditTwo competing teams, Helix AI and invariant fuzzing.
- OnchainUniswap v4 Hook AuditPermissions, callbacks, delta settlement, hook-owned liquidity and limit orders.
- OnchainPerp DEX AuditFunding, liquidations, oracles, auto-deleveraging and keepers.
- OnchainToken Launchpad AuditBonding curves, graduation, fee splits, anti-snipe guards, vesting and claims.
- OnchainYield Vault AuditERC-4626 share math, strategies, fees and withdrawal queues.
- OnchainDeFi Protocol AuditAccounting, oracles, liquidations and integrations.
- OnchainPrediction Market AuditResolution, disputes, bonds, payout math and outcome tokens.
- OnchainLending Protocol AuditInterest math, liquidations, oracles, bad debt, forks and credit.
- OnchainOptions and Derivatives AuditPricing, margin, expiry, rate swaps, tranches and leveraged tokens.
- OffchainOffchain Automation PentestKeepers, relayers, bots and the automation-to-chain boundary.
- OffchainOpSec AuditKeys, signers, privileged roles, and critical operations.
- Penetration testingAll pentestsEvery offchain engagement, and how Guardian runs them.
Start now