Skip to content

feat: Add MnM adapter#16

Open
JoeStrangeQ wants to merge 2 commits intojup-ag:mainfrom
JoeStrangeQ:feat/mnm-dlmm-adapter
Open

feat: Add MnM adapter#16
JoeStrangeQ wants to merge 2 commits intojup-ag:mainfrom
JoeStrangeQ:feat/mnm-dlmm-adapter

Conversation

@JoeStrangeQ
Copy link
Copy Markdown

@JoeStrangeQ JoeStrangeQ commented Feb 16, 2026

MnM — Jupiter AMM Adapter

Adds a self-contained adapter for the MnM Market Maker protocol.

Program

  • ID: MnMRzPXhhuFFzfXvffkMGeodBqY7hnaqNpQcYGeREi5
  • Network: Solana Mainnet
  • Anchor: 0.31.1

What is MnM?

A concentrated liquidity AMM with bin shifting — bins automatically reposition with trades to keep liquidity around the active price. Features 5 fee tiers, Token-2022 support, and cross-BinArray quoting.

Implementation

  • mnm-dlmm/ crate — self-contained with quote engine, state deserialization, PDA derivation
  • No external dependencies beyond workspace crates
  • Implements full Amm trait: from_keyed_account, quote, get_swap_and_account_metas
  • 12 swap instruction accounts
  • Dynamic accounts (has_dynamic_accounts() = true) — BinArray PDAs shift with active bin

Security

  • 260M+ fuzz iterations on core swap logic (7 invariants)
  • 48/48 on-chain program tests passing
  • Internal security audit completed

Note

Uses Swap::MeteoraDlmm as placeholder — needs new Swap::MnmDlmm variant in jupiter-amm-interface.

Team: MnM Labs — https://mnm.ag
Explorer: https://explorer.solana.com/address/MnMRzPXhhuFFzfXvffkMGeodBqY7hnaqNpQcYGeREi5

Add Jupiter AMM interface adapter for MnM DLMM (Dynamic Liquidity Market Maker).

## What is MnM DLMM?
A concentrated liquidity AMM with bin shifting — bins automatically
reposition with trades to keep liquidity around the active price.

Program ID: MnMRzPXhhuFFzfXvffkMGeodBqY7hnaqNpQcYGeREi5

## Implementation
- Self-contained mnm-dlmm crate with quote engine, state deserialization, and PDA derivation
- Implements Amm trait: from_keyed_account, quote, get_swap_and_account_metas
- Cross-BinArray quoting for large trades
- Token-2022 support (SPL Token and Token-2022 mints)
- Dynamic accounts (BinArray PDAs shift with active bin)
- 12 swap instruction accounts

## Features
- 5 fee tiers (1bps-100bps)
- Bin shifting (auto liquidity repositioning)
- Q64.64 fixed-point math for precise pricing

## Security
- 260M+ fuzz iterations on core swap logic
- 48/48 on-chain program tests passing
- Internal security audit completed

## Note
Uses Swap::MeteoraDlmm as placeholder — needs new Swap::MnmDlmm variant
in jupiter-amm-interface.

Team: MnM Labs (https://mnm.ag)
@JoeStrangeQ JoeStrangeQ changed the title feat: Add MnM DLMM adapter feat: Add MnM adapter Feb 19, 2026
Use T::zeroed() + bytes_of_mut() instead of from_bytes() to guarantee
alignment when account data arrives from RPC with arbitrary pointer alignment.

Fixes: TargetAlignmentGreaterAndInputNotAligned on PoolState/BinArray
(u128 fields require 16-byte alignment).

Added regression tests for misaligned deserialization.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant