The StableSwapNG Pool Standard is the foundational AMM specification for Curve's stablecoin pools, representing the next-generation evolution of the original Stableswap invariant. It defines the mathematical formula that combines a constant-sum invariant for low-slippage trading near the peg with a constant-product invariant to ensure liquidity at all prices. The 'NG' (Next Generation) architecture introduces a gas-optimized implementation, dynamic fee logic, and a factory-deployed pattern that allows permissionless pool creation for any set of pegged assets.

Stableswap (StableSwapNG) Pool Standard
What is the StableSwapNG Pool Standard?
The technical specification for Curve's StableSwapNG architecture, defining the invariant, dynamic fees, and factory interface for efficient stablecoin-to-stablecoin exchanges.
Operationally, the standard specifies the get_dy and exchange interface that aggregators, trading bots, and wallets must integrate to correctly route stablecoin swaps. A key technical component is the amplification coefficient (A), which is now dynamic and can adjust based on pool conditions to tighten or loosen the spread around the peg. The standard also defines the get_virtual_price method, which is critical for lending protocols and yield aggregators to accurately value LP tokens as collateral. Integrators must handle the new fee getter, which returns a dynamically calculated fee that can change per-block based on the pool's internal balance and the offpeg_fee_multiplier.
For protocol architects and risk teams, the StableSwapNG standard introduces a new trust model for factory-deployed pools. Unlike the original Stableswap, where pools were often deployed individually and verified against a canonical bytecode, the NG factory pattern means that pool logic is a child contract of a verified factory. Auditors and integrators must verify the factory's immutability and the correctness of the find_pool_for_coins lookup. Chainscore Labs can assist teams with an upgrade readiness review, ensuring that smart contract integrations, oracle consumption, and LP token valuation logic are correctly aligned with the StableSwapNG interface before mainnet deployment.
StableSwapNG Quick Facts
Key technical and operational facts about the StableSwapNG pool standard for integrators, auditors, and risk teams.
| Field | Value | Why it matters |
|---|---|---|
Core Invariant | StableSwap (amplified constant sum/constant product hybrid) | Enables low-slippage trades between pegged assets; deviation from peg increases slippage and impermanent loss. |
Amplification Coefficient (A) | Dynamic; can be adjusted by governance or factory logic | Controls pool sensitivity to imbalance. A higher A makes the pool behave more like a constant sum, increasing peg-keeping efficiency but raising risk if a peg breaks. |
Fee Model | Dynamic fee based on price deviation and internal balance | Fees increase when the pool is imbalanced to protect LPs and decrease when balanced to encourage arbitrage. Aggregators must query dynamic_fee(). |
LP Token Valuation | Uses get_virtual_price() | This method accounts for accrued fees and is the canonical way to value an LP share. Using a simple ERC-20 balance ratio will misprice the position. |
Deployment Pattern | Factory-deployed via StableSwapNG Factory | Ensures a canonical, audited bytecode. Integrators should verify a pool's factory origin before interacting to avoid unverified clones. |
Oracle | No native internal EMA oracle | Unlike Cryptoswap pools, StableSwapNG pools do not provide a manipulation-resistant price oracle. Protocols requiring a price feed must use an external oracle or a separate pool type. |
Key Affected Actors | Aggregators, wallets, lending protocols, yield aggregators, stablecoin issuers | Any system that routes trades, values LP tokens, or uses the pool as a price reference must adapt to the dynamic fee and virtual price logic. |
Primary Risk | Peg devaluation of a constituent asset | The invariant assumes assets are pegged. If one asset depegs, the pool will be drained of other assets, and LP losses are amplified by the high A coefficient. |
Core Invariant and Dynamic Fee Logic
How Curve's StableSwapNG invariant concentrates liquidity and adjusts fees dynamically to protect LPs and maintain the peg.
The StableSwapNG pool standard is defined by its core invariant, which mathematically combines a constant-sum formula for near-parity assets with a constant-product formula to prevent pool drainage. This creates an amplified bonding curve that concentrates liquidity tightly around the current price, enabling low-slippage swaps between stablecoins or like-kind assets. The A (amplification coefficient) parameter governs the concentration depth: a higher A flattens the curve, reducing slippage for small trades, while a lower A increases slippage and protects LPs during volatility. In StableSwapNG, the A parameter is dynamic and can be adjusted by the pool admin or factory logic, allowing the pool to adapt to changing market conditions without a full migration.
A critical operational component of StableSwapNG is its dynamic fee logic, which replaces the static fee model of earlier Curve pools. The pool can programmatically adjust swap fees based on the current state of the pool's balance, specifically targeting deviations from the peg. When the pool becomes imbalanced, the fee increases to disincentivize further trades that would exacerbate the imbalance and to compensate LPs for the increased inventory risk. Conversely, fees decrease when the pool is near equilibrium to encourage arbitrage and restore the peg. This logic is implemented via the _dynamic_fee() function, which calculates the fee as a function of the pool's current balance deviation, an offpeg_fee_multiplier, and a base fee. Integrators must query the fee() method before routing trades, as the fee is not a constant.
For builders and risk teams, the dynamic fee model introduces a state-dependent cost that aggregators and trading bots must simulate before submitting transactions to avoid reverted trades or unexpected slippage. Auditors reviewing StableSwapNG pools should verify that the dynamic fee cannot be manipulated through flash loans or multi-block attacks to unfairly penalize LPs or traders. Chainscore Labs can assist integration teams in modeling the fee surface against historical volatility, reviewing factory-deployed pool parameters, and ensuring that off-chain pricing engines correctly consume the dynamic fee to prevent MEV leakage.
Who is Affected by the StableSwapNG Standard?
Aggregators and Trading Bots
Aggregators and arbitrage bots must update their routing logic to correctly call the new exchange and exchange_received functions. The dynamic fee logic means that static fee assumptions will cause transaction failures or suboptimal routing.
Action Steps:
- Integrate the
get_dyandget_dxviews to simulate swaps with the current amplification coefficient and dynamic fee. - Update on-chain router contracts to handle the new factory-deployed pool interface.
- Monitor pool deployment events from the StableSwapNG factory to automatically index new liquidity venues.
Integration and Implementation Impact
StableSwapNG introduces a new factory-deployed architecture with dynamic fees and an updated interface. Integrators must update ABI handling, LP valuation models, and exchange routing to avoid mispricing or failed transactions.
Dynamic Fee Handling
Unlike legacy stableswap pools with a fixed fee parameter, StableSwapNG implements a dynamic fee that adjusts based on internal conditions such as price deviation. Integrators must query the on-chain fee state before constructing swap calldata. Off-chain routing engines that cache a static fee will produce inaccurate quotes and may cause transaction reversion.
LP Token Valuation Update
The get_virtual_price method remains the canonical source for LP token valuation, but the underlying amplification coefficient (A) and fee logic have changed. Yield aggregators and lending protocols using LP tokens as collateral must update their valuation oracles to read from the new pool implementation. Failing to update will result in stale or incorrect collateral pricing.
Exchange and Aggregator Routing
DEX aggregators must add the StableSwapNG factory address and pool interface to their routing algorithms. The dynamic fee requires a simulation or on-chain get_dy call for accurate quoting. Relying on the legacy exchange method signature without verifying the pool type will break swaps for newly deployed stablecoin pairs.
Oracle and Price Feed Impact
StableSwapNG pools do not contain the internal EMA oracle found in cryptoswap pools. Protocols using Curve stableswap pools as a price feed must ensure they are not incorrectly assuming an on-chain oracle interface. For stablecoin pricing, external oracles or the pool's spot price via get_dy should be used with appropriate manipulation resistance checks.
Audit and Security Review Scope
Protocols composing with StableSwapNG should scope audits to include the factory's permissionless deployment model and the dynamic fee module. The new architecture changes the trust assumptions for pool creation. Chainscore Labs can perform an integration review to verify correct ABI usage, fee handling, and LP token accounting before mainnet deployment.
Integration Risk and Compatibility Matrix
Evaluates the operational and technical changes that wallets, aggregators, lending protocols, and other integrators must handle when moving from the legacy Stableswap to the StableSwapNG pool standard.
| Area | What changes | Who is affected | Action |
|---|---|---|---|
Pool Interface | New factory-deployed pool bytecode and ABI. Core exchange functions (e.g., exchange, add_liquidity) may have updated signatures or event structures. | Aggregators, Wallets, DeFi Protocols | Verify the canonical ABI from the Curve StableSwapNG factory repository. Update integration adapters and re-run full interface conformance tests. |
LP Token Valuation | The get_virtual_price logic and fee accrual mechanism are updated. The internal balances and dynamic fee may alter the LP token's value accrual pattern. | Yield Aggregators, Lending Protocols, Wallets | Do not rely on legacy Stableswap valuation models. Re-audit the virtual price calculation and test against on-chain state to prevent mispricing of LP positions. |
Dynamic Fee Logic | Fees are no longer a static parameter. The new dynamic fee algorithm adjusts based on pool imbalance and internal oracles. | Arbitrage Bots, Trading Desks, Aggregators | Replace static fee assumptions with an on-chain query of the current fee before constructing swap transactions. Backtest strategies against the new fee volatility. |
Amplification Coefficient (A) | The A parameter dynamics and optimization logic have been refined. The pool's sensitivity to imbalance may differ from legacy pools. | Liquidity Providers, Risk Teams | Re-evaluate impermanent loss and liquidity concentration models. Monitor pool behavior under volatile conditions to understand the new A parameter's practical effect. |
Oracle Integration | The internal EMA oracle implementation and its interface may differ from legacy cryptoswap pools. The standard for querying price data is updated. | Lending Protocols, Derivatives Platforms | Do not assume the legacy EMA oracle interface. Verify the new price_oracle function signature, update staleness checks, and reassess manipulation resistance assumptions. |
Event Monitoring | Event signatures and indexed parameters for swaps, deposits, and withdrawals are likely changed to support new features. | Data Indexers, Subgraph Operators, Monitoring Tools | Update subgraph mappings and event listeners to parse the new StableSwapNG event schemas. Rebuild historical data pipelines to ensure continuity. |
Gauge Compatibility | The interface for depositing LP tokens into a LiquidityGauge is standardized but must be verified for the new pool type. | Protocols Launching Pools, veCRV Voters | Confirm the StableSwapNG LP token is compatible with the canonical LiquidityGauge contract. Test the full deposit-stake-reward flow on a testnet deployment. |
Integrator and Auditor Readiness Checklist
A technical checklist for teams integrating or auditing StableSwapNG pools. Each item maps to a specific architectural change from the legacy stableswap invariant, highlighting the verification steps, failure modes, and signals that confirm correct handling of the new dynamic fee, amplification coefficient, and oracle logic.
StableSwapNG introduces a dynamic fee that adjusts based on internal state variables, replacing the fixed fee model of legacy pools. Integrators must confirm that their swap routing, aggregator logic, and liquidity management bots do not rely on a static fee assumption.
- What to check: Trace the
exchange,add_liquidity, andremove_liquidityfunctions to ensure the fee is read from the pool's state at the time of transaction simulation, not from a hardcoded constant or off-chain registry. - Why it matters: A mismatch between the expected and actual fee can cause transaction reversions, failed MEV bundles, or incorrect profit calculations for arbitrageurs and solvers.
- Readiness signal: Successful mainnet-fork simulation of a multi-hop trade through a StableSwapNG pool where the fee changes between the quote and the settlement.
Canonical Resources and Source Materials
Use these primary sources to validate StableSwapNG behavior before integrating Curve pool routing, LP token accounting, gauges, or risk systems. Teams should treat deployed bytecode, factory state, and DAO-controlled parameters as the final operational source of truth.
Looking to build on a specific blockchain?
We build smart contracts, DeFi applications, wallets, tokenization platforms, and blockchain infrastructure across the major ecosystems teams choose today. That includes Ethereum, Arbitrum, Optimism, Polygon, Avalanche, Solana, Sui, Aptos, Hedera, Stellar, and NEAR, with support for additional EVM and non-EVM networks based on your product requirements.
EVM ecosystems
- Ethereum
- Arbitrum
- Optimism
- Polygon
- Avalanche
- Cronos

Non-EVM ecosystems
- Solana
- Sui
- Aptos
- Hedera
- Stellar
- NEAR
Additional ecosystems
- Polkadot
- Cosmos
- TON
- Cardano
- Algorand
- Tempo
Also available for Base, appchains, custom EVM networks, and cross-chain product architecture.
Frequently Asked Questions
Common questions from integrators, aggregators, and risk teams about the StableSwapNG architecture, dynamic fees, oracle compatibility, and LP token valuation.
StableSwapNG pools can adjust fees dynamically based on internal conditions such as price imbalance or volatility, rather than using a single static fee parameter.
What to check:
- Query the
fee()method on the pool contract before constructing a swap path. Do not cache a static fee value. - Monitor the
ma_exp_timeandoffpeg_fee_multiplierparameters to understand how aggressively fees can change. - For aggregators, ensure your routing algorithm can handle fee variability within a single block; the fee at simulation time may differ from the fee at execution time.
Why it matters: A static fee assumption leads to failed transactions, unexpected slippage, or suboptimal routing. Dynamic fees are a core architectural change from the original Stableswap invariant.
Signal of readiness:
Your integration correctly simulates and executes swaps using the live fee() return value and includes a slippage buffer that accounts for potential fee movement between simulation and execution.
Delivering blockchain solutions for 5+ years.
We have partnered with 50+ leading DeFi protocols, NFT ecosystems, and fintech innovators to build secure, scalable, and capital-efficient blockchain products.
Selected Partners & Clients
“I've been working with Chainscore Labs for last 3+ years, they've consistently delivered with strong ownership across multiple projects. The team is reliable and detail-oriented.”
How to get started?
If you're looking for blockchain integration, ChainScore Labs has 5+ years of experience helping teams build and integrate exchanges, wallets, smart contracts, tokenization solutions, and protocol-connected products, we can help you choose the right path, integrate securely, and get to production faster. Our team consists of experienced blockchain developers and architects who can help you with your blockchain integration needs.
Exploration & Strategy
Define your product goals and choose the right blockchain architecture for your use case.
Architecture & Design
Design the smart contracts, tokenomics, and security parameters of your system.
Development & Integration
Build and integrate with wallets, oracles, and front-end dApps for a seamless experience.
Security & Launch
Comprehensive audits followed by a risk-managed mainnet deployment to protect your users.
Discover our
blockchain development services.
We build production-grade blockchain solutions for top-tier projects across DeFi and Web3.
Need a blockchain engineering team?
Send the project context and we will respond with next steps, scope questions, and a practical path to delivery.


