RageTrade / core

Perpetuals on Uniswap V3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Name the price variables such that it easily distinguishes difference between oneByZero and vTokenByVBase

134dd3v opened this issue · comments

sqrt price in uniswap is oneByZero. But in funding payment the price we expect price is vTokenByVBase. To avoid bugs we need to make it obvious when price is normalised/flipped used isToken0 (comeup with some cool suffix if possible).

price means javascript number (without including token decimals e.g. eth price 4000)
priceX128 means fixed point price including decimals in denomination: vUSDC per vToken (used in the perpswap)
sqrtPriceX96 means fixed point price including decimals in denomination: token1 per token0 (used in uniswap)