NFT / Marketplace·Ethereum · Arbitrum · Base · Optimism
Sudoswap
On-chain NFT AMM (LSSVM v2) on Ethereum and several L2s. Liquidity providers create pools with bonding curves (Linear, Exponential, XYK) that quote NFT↔ETH/ERC20 prices algorithmically — there is no off-chain orderbook. Buyers and sellers interact directly with pool contracts.
- 01NFT AMM liquidity provision
- 02instant NFT buy/sell with no off-chain orderbook
- 03bonding-curve-priced collections
- 04trading floor / sweep flows
- 05marketplace aggregators (sudo as a liquidity source)
- # No official npm SDK; interact with LSSVM v2 contracts directly via viem/ethers, or via aggregators (Reservoir, 0x).
- pnpm add viem
- pnpm add @reservoir0x/reservoir-sdk # optional: aggregated buy/sell across sudo + others
| Variable | Scope | Description |
|---|---|---|
| NEXT_PUBLIC_SUDOSWAP_FACTORY | Client | Address of the LSSVMPairFactoryV2 contract on the target chain (varies per chain — see docs.sudoswap.xyz/contracts). |
Sudoswap is pure on-chain — there is no API key or REST endpoint. To create a pool, call `LSSVMPairFactoryV2.createPairERC721ETH({ nft, bondingCurve, assetRecipient, poolType, delta, fee, spotPrice, propertyChecker, initialNFTIDs })`. Each pool is its own contract; query a quote via `pair.getBuyNFTQuote(numItems)` / `getSellNFTQuote(numItems)` then execute `swapTokenForSpecificNFTs` or `swapNFTsForToken`. Bonding curves are pluggable: `LinearCurve` (delta = absolute step), `ExponentialCurve` (delta = multiplier with 18-decimal scaling), `XykCurve` (Uniswap-style). For batch buys across multiple pools use `VeryFastRouter.swap(...)`. Aggregators like Reservoir index sudo pools and expose them as standard `asks`/`bids`.
- ⚑Sudoswap does NOT enforce creator royalties on pool trades — pool LPs may opt to pay (via `RoyaltyEngine` lookup) or not; assume worst case (0%) when modeling creator revenue.
- ⚑Bonding curve math is unforgiving: with `ExponentialCurve`, a wrong `delta` (it's a 1e18-scaled multiplier, not a percentage) can make pool prices double per swap or never move — always simulate `getBuyNFTQuote` for several depths before deploying.
- ⚑Marketplace protocol fee is configurable per pool (`fee`) plus a small protocol fee (`protocolFeeMultiplier` on the factory, currently 0.5%); confirm both when computing LP returns.
- ⚑`PropertyChecker` lets pools accept only specific token IDs (e.g. trait-filtered) — skipping it on a 1-of-1 collection means anyone can dump unwanted tokens into the pool.
- ⚑Chain coverage is multi-chain (ETH, Arbitrum, Base, Optimism) but factory addresses differ per chain; using mainnet addresses on an L2 silently calls into empty bytecode.
- ⚑Pools holding ERC20 quote tokens require the user to `approve` the pair contract before `swapTokenForSpecificNFTs`; missing approval reverts with a generic ERC20 transfer error.
- ⚑There is no first-party JS SDK in 2026 — community wrappers exist but are unmaintained; prefer raw viem ABI calls or aggregator SDKs (Reservoir, 0x) for production.