Dynamic Virtual AMM - dynAMM
Introduction to the dynAMM
Denaria’s perpetuals run on a dynamic virtual AMM that delivers deep, capital-efficient, and oracle-anchored execution entirely onchain. Unlike traditional vAMMs with static liquidity curves, Denaria’s solution adjusts dynamically to market conditions by anchoring pricing around a real-time oracle and shaping slippage based on liquidity distribution and trade size.
Instead of moving along a fixed liquidity curve, the dynAMM constructs a new invariant curve for each trade based on the current pool state and oracle price, ensuring that execution begins from a price-aligned baseline. This architecture ensures that traders receive pricing close to the fair market value, while the system introduces slippage only when necessary to protect LPs and preserve security.
Crucially, Denaria’s dynAMM relies on virtual assets (vAssets and vStables) as an efficient and flexible internal accounting mechanism. These synthetic balances represent position exposure and quote balances without requiring actual asset transfers, allowing the system to accurately track user positions and the protocol’s liquidity state in a capital-efficient, non-custodial way.

Core Mechanics: Curve Anchoring & Dynamic Shape
Each time a trade is executed, the dynAMM uses two inputs to shape its pricing curve:
- The latest oracle price, fetched from a trusted decentralized feed.
- The current pool state, i.e., the virtual balances of vAsset and vStable held in the AMM.
From these, dynAMM applies two operations: Recentering and Resloping. Before each trade, the curve is dynamically constructed based on the oracle price and the liquidity present in the system. This ensures that trades occur around the market price, with slippage conditions determined by the mathematical formulation.
A well-balanced and sufficiently deep liquidity pool results in a flatter curve, which minimizes slippage and enables more cost-efficient trading. Conversely, when the pool is imbalanced due to disproportionate liquidity or directional trading, the curve becomes steeper. This design increases slippage for trades that would further exacerbate the imbalance, discouraging such actions and thereby protecting LPs from excessive exposure. Denaria achieves this behavior through a transparent mathematical formulation, inspired by and improving upon the most effective AMM models developed in DeFi, such as Curve’s hybrid approach, ensuring both precision and resilience in pricing.
Slippage Logic: Curve-Inspired, Custom-Built
Denaria’s dynAMM is conceptually inspired by Curve’s CryptoSwap invariant, blending constant sum and constant product curves, but re-engineered with a new mathematical foundation tailored for leveraged perpetual trading.
A dynamic function A(x, y)denoted as the slippage control parameter, drives the shape of the pricing curve:
- When vAsset and vStable are balanced relative to the market price, and the trade size is consistent with the available liquidity,
Aflattens the curve, minimizing slippage. - When imbalance grows,
Adynamically increases, steepening the curve and introducing slippage that discourages further one-sided trading.
Global Position
Denaria adopts a global position architecture, where each trader holds only one unified position per market. This design simplifies risk management, ensures consistent accounting, and enhances protocol solvency.
At the protocol level, every user's exposure is aggregated into a single global position that represents the net result of all trades, combining all longs and shorts into one virtual balance and debt. All PnL calculations, funding payments, and liquidation conditions are derived exclusively from this global position.
This approach eliminates redundant position tracking, minimizes computational complexity, and allows for an optimized liquidation threshold, since all collateral and exposure are evaluated as a whole.
From a user perspective, all trading actions (opening, closing, increasing, or reducing exposure) dynamically adjust the same position:
- Opening a trade in the same direction increases the position size.
- Opening in the opposite direction reduces or flips it.
- Closing partially or fully reduces the global exposure.
Advantages of the dynAMM
Here is your TL;DR on the key advantages the dynAMM brings to traders and LPs:
- Oracle Execution – Trades execute directly around the oracle price, ensuring fair fills for traders and eliminating arbitrage opportunities at LPs’ expense. This alignment optimizes outcomes for both sides of the market.
- Virtual Market Depth – Deep liquidity is simulated around the market price using virtual balances, enabling capital-efficient trading without requiring equivalent real asset deposits.
- Low Slippage Execution – The dynAMM delivers minimal slippage under normal conditions, even during volatility, by adapting the curve’s shape in real time.
- Dynamic LP Protection – As the pool becomes unbalanced, slippage steepens automatically to deter further imbalance, protecting LPs from excessive directional exposure.
- Trustless and Onchain – Every aspect of trade pricing, execution, and funding is computed and enforced onchain—without centralized actors or offchain matching layers.