Security Developing

Lean AMM is on Solana mainnet

On 30 November 2026 Lean Client said Lean AMM is on Solana mainnet. The program is on-chain, and OtterSec matches the build. The README limits the proofs to the arithmetic. The upgrade authority is still set.

On 30 November 2026 Lean Client wrote on X that the open-source Lean AMM is on Solana mainnet. The post names two results of the formal check: a swap cannot drain a pool, and LP shares do not lose value to rounding.

Program, build, and proofs

Program AMXwyCL9aEBrbEWdMEi1ro89VCwPhNrQPdeRkGCf9n8E is executable on mainnet. The slot stored in the program data has block time 30 November, 3:11 p.m. Berlin. Upgrade authority BpfwxNmcGJSehj8x1qG6yCZDeGi8Yzyc2L3PJrUPkeSw is set, so the program is not frozen.

A query at 9:24 p.m. Berlin found verify.osec.io reporting the program verified, with last_verified_at at 3:29 p.m. Berlin. The on-chain hash matches the rebuilt executable. The record points at MidTermDev/lean-amm, commit 494d379, and is_frozen is false.

The README at that commit describes the proofs. Lean’s kernel checks that a swap does not lower the product of the reserves, that a deposit pays for its shares, and that a withdrawal pays no more than the shares are worth. Nine formula theorems sit under that, from swap_keeps_k to withdrawal_keeps_share_value.

The README leaves three things out of the proofs: which accounts an instruction accepts, the token transfers, and the translation to sBPF. It cites 56 tests in LiteSVM and a run of 2,000 random steps for those. It says the code has not been audited.

The verify image’s Dockerfile says the build checks the proofs before it produces the program. Lean Client’s verify page says the mark does not say whether the code is right. The OtterSec mark here means the rebuild matches the bytes on-chain.

The README says no key can change a pool, pause it, or take from it. The program’s upgrade authority is separate, and it is still set. A later upgrade can replace the bytes.

According to the README, anyone can open a pool for two SPL or Token-2022 tokens, if the program accepts the mints. It refuses transfer fees, hooks, and a permanent delegate. The theorems say nothing about the price of the two tokens.

The README sets the platform fee at 0 percent. A pool’s fee, 0.01%, 0.05%, 0.3%, or 1%, goes to liquidity providers, the README says.

Other Lean notes the same day

Lean Client says the program is compiled with lean-svm from Anatoly Yakovenko. The lean-svm README places the toolchain under teaching and research. It says there has been no independent audit, and that the proofs cover only the models they state.

Ludo Galabru, whose profile names the Solana Foundation, wrote on X the same day about several Lean efforts. He writes that HarmonicMath released a self-serve platform and that checking programs with the credits is free. The 18 November report records the state of Aristotle and the credits.

Galabru names 400,000 lines of Lean from PetarMax, from four months of work on 15 Solana protocols. The link under that point goes to Solanalib, the repository solana-foundation/leanprover-solanalib. The README describes an experimental library and does not state that line count.

Galabru writes that Lean Client has started validating blocks. The same evening Lean Client wrote of 12 percent fewer CPU cycles per mainnet block, and of bank hashes that match the network. Both figures are what those posts say.

What to watch

  • Whether the upgrade authority is removed
  • Whether a repository states the figure of 400,000 lines itself
  • Whether an independent audit of the AMM follows

Sources

  • Lean Client — Post, 30 November 2026, 3:15 p.m. Berlin. Lean AMM on Solana mainnet, open source, math formally checked. A swap cannot drain a pool, and LP shares do not lose value to rounding. Platform fee 0 percent. Page amm.leanclient.app
  • Lean Client — Reply, 30 November 2026, 3:15 p.m. Berlin. Program written in Lean 4 and compiled with lean-svm. Not proved: account checks and token transfers. 56 tests. No audit. Proofs and the build hash are in the README
  • Lean Client — Post, 30 November 2026, 3:52 p.m. Berlin. lean-verify, program AMXwyCL9aEBrbEWdMEi1ro89VCwPhNrQPdeRkGCf9n8E
  • Lean Client — Verify page, read 30 November 2026. The mark does not say whether the code is right
  • OtterSec — verify.osec.io status, retrieved 30 November 2026, 9:24 p.m. Berlin. is_verified true, is_frozen false, last_verified_at 3:29 p.m. Berlin, commit 494d379dd57ad006f4b1ea1ef606d615fc72d623, on-chain hash equals executable hash
  • Solana mainnet — getAccountInfo on the public endpoint, 30 November 2026, 9:24 p.m. Berlin. Program executable, owner BPFLoaderUpgradeable. Program data 2uogHQ6pKUXz6bT5cD8jqEZsfY3pwQvMDaNp2955dqSe, slot 475790798, block time 3:11 p.m. Berlin, upgrade authority set
  • MidTermDev — lean-amm README, commit 494d379, read 30 November 2026. Proofs, exclusions, 56 tests, 2,000 random steps, no audit, fees, upgrade authority until --final
  • MidTermDev — verify/Dockerfile, same commit. The build checks the proofs before it produces the program
  • Anatoly Yakovenko — lean-svm README, read 30 November 2026. Teaching and research, no independent audit
  • Ludo Galabru — Post, 30 November 2026, 4:05 p.m. Berlin. HarmonicMath, lean-svm, 400,000 lines of Lean from PetarMax, Lean Client validating blocks
  • Ludo Galabru — Replies in the thread, 30 November 2026, 4:05 p.m. Berlin. Credit form, lean-svm repository, introduction of Solanalib
  • Solana Foundation — leanprover-solanalib README, read 30 November 2026. Experimental Lean library, last push 24 November 2026. No line count of 400,000
  • Lean Client — Post, 30 November 2026, 7:24 p.m. Berlin. 12 percent fewer CPU cycles per mainnet block, bank hashes matching the network. The project’s own figure
  • SOLANA·HUB — Aristotle verifies Rust code, Foundation offers credits, 18 November 2026, updated 24 November 2026

Background and guides

#lean #amm #verification #ottersec