vAMM
Last updated
Last updated
Perpetual markets on Butter.xyz are implemented with virtual automated market makers (vAMMs). This page describes how vAMMs work in general. Specifics about vAMMs on Butter.xyz are in the pages that follow.
Like AMMs such as Uniswap, vAMMs are asset pools that use the constant product formula , where and are the amounts of each asset in the pool. The price of the assets relative to each other is determined by the ratio of their amounts. In this documentation, we will refer to as the base asset and as the quote asset.
For example, in an ETH/USD pool with 100 ETH and 160000 USD, ETH is the base asset and USD is the quote asset, and the price of ETH relative to USD is .
Trading on an AMM changes the ratio of assets in the pool, and therefore changes the price. One benefit of trading on an AMM is that it does not require two parties to trade; the AMM itself is always the counterparty to a trade.
In an ordinary AMM, traders put one asset into the pool and receive the other. In a vAMM, the assets in the pool are virtual, and instead of putting one asset into the pool to receive the other, traders maintain collateral in their accounts to take long or short positions.
Please make sure you understand how the market price moves when trading on a vAMM.
As in an AMM, the only way for the price to move is for users to make trades in the market. If there are not enough users making trades, the price may not converge to the price of the underlying.