Protocol Attributes

  • Updated

Base & Quotes Tokens

In Uniswap V3, a pool has two tokens: one designated as token0, and the other as token1. The order is decided by (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA)

The price of the pool is always token1/token0. The price range liquidity is added to is also based on this configuration.

Assuming we have pools such as vETH:vUSD or vBTC:vUSD, the price a Uniswap V3 Pool returns can be denominated in ETH, BTC or USD, depending on which is token0 and token1. This adds additional potential overhead.

To simplify, we force the ClearingHouse to only support Uniswap V3 Pools where token0 is base, and token1 isquote. This can be done by only deploying a BaseToken when its address is smaller than our QuoteToken (not using create2).