Pair
Last updated
Was this helpful?
Last updated
Was this helpful?
The Pair entity represents a WhiteSwap pair with a balance of each of its pair tokens.
Computes the pair address for the passed s. See .
The reserve of token0.
The reserve of token1.
Returns reserve0 or reserve1, depending on whether token0 or token1 is passed in.
Pricing function for exact input amounts. Returns maximum output amount based on current reserves and the new Pair that would exist if the trade were executed.
Pricing function for exact output amounts. Returns minimum input amount based on current reserves and the new Pair that would exist if the trade were executed.
Calculates the exact amount of liquidity tokens minted from a given amount of token0 and token1.
totalSupply must be looked up on-chain.
The value returned from this function cannot be used as an input to getLiquidityValue.
Calculates the exact amount of token0 or token1 that the given amount of liquidity tokens represent.
totalSupply must be looked up on-chain.
If the protocol charge is on, feeOn must be set to true, and kLast must be provided from an on-chain lookup.
Values returned from this function cannot be used as inputs to getLiquidityMinted.
A Token representing the liquidity token for the pair. See .