A virtual automated market maker (vAMM) is a pricing mechanism used by some decentralised derivatives exchanges, mainly for perpetual futures. It borrows the constant-product formula of an automated market maker, but applies it to "virtual" reserves that exist only as numbers in a smart contract. Traders deposit real collateral, usually a stablecoin, into a vault, while the vAMM curve decides the price at which their long or short positions open and close.
The design was popularised by Perpetual Protocol, whose first version launched on the xDai chain (now Gnosis Chain) in December 2020. vAMMs are one of several ways to run on-chain perpetuals, alongside order books (used by exchanges such as dYdX) and oracle-priced pools (used by GMX). They are an example of DeFi applying an existing building block to a new market.
Virtual AMM in plain terms
Imagine a fairground game where the price of a prize is shown on a board. Every time someone buys, a person behind the board raises the price a little; every time someone sells back, it drops a little. There is no warehouse of prizes behind the board, only the rule for moving the price, and a cash box where everyone's deposits are kept.
A vAMM is that board. It does not hold the asset traders are betting on. It only follows a fixed rule that moves the price as people go long or short, and the cash box (the vault) pays winners from losers and from a reserve fund.
How a vAMM works
A regular AMM holds two real token balances in a liquidity pool and keeps their product constant; see formulas for AMMs. A vAMM uses the same rule on virtual balances:
- is the virtual reserve of the base asset (for example, ETH).
- is the virtual reserve of the quote asset (for example, USD).
- is a constant set when the market is created.
The current price, often called the mark price, is the ratio of the reserves:
When a trader opens a long position, the notional value they buy is added to , and the vAMM calculates how much leaves the virtual pool to keep constant. That amount becomes the trader's position size. The price rises as a result, so larger trades get worse average prices, the same slippage effect seen on real AMMs.
Worked example. A market starts with virtual reserves of 1,000 ETH and 2,000,000 USD, so and the price is USD per ETH. A trader posts 1,000 USD of collateral and opens a 10,000 USD long at 10x leverage. The quote reserve becomes 2,010,000, so the base reserve becomes . The trader's position is about ETH, at an average price of about 2,010 USD. The new mark price is USD.
Keeping the price in line
Because the vAMM price moves only with trades on the protocol, it can drift away from the asset's market price on other venues. Protocols use a price oracle to read an index price and charge a periodic funding rate: when the mark is above the index, longs pay shorts, and when it is below, shorts pay longs. This encourages trades that pull the prices back together. Positions whose losses approach their collateral are liquidated, in the same way as a margin call on a traditional account, and an insurance fund covers shortfalls.
Advantages and limitations
vAMMs offered several advantages when they appeared:
- No liquidity providers needed. In Perpetual Protocol v1, there was no pool of real tokens, so markets could be listed without attracting depositors and with no impermanent loss.
- Always-available prices. The curve quotes a price for any trade size, unlike a thin order book.
- Simple on-chain logic. Pricing is a short formula that a contract can compute cheaply, which mattered on networks with high gas fees.
The model also has known weaknesses:
- Fixed depth. The constant sets how much prices move per trade; set too low, large trades move prices sharply, and changing later is complex.
- Protocol as counterparty. Winners are paid from the collateral of losers and the insurance fund; if traders on one side profit heavily, the system can become undercollateralised.
- Oracle and manipulation risk. Funding and liquidations depend on outside price feeds, and thin markets can be pushed around, enabling front-running and manipulation attempts.
Perpetual Protocol's second version, called Curie and launched on Optimism in 2021, replaced the pure vAMM with markets built on Uniswap v3 pools that use real liquidity providers supplying virtual liquidity. Later perpetual exchanges have moved towards order books and oracle-based designs, though the vAMM remains a reference point in the history of the derivatives market on-chain.