Pair
#
Imported typesToken#
TokenAmount#
#
Query schemas#
pairAddressReturns address of pair liquidity token contract.
#
pairLiquidityTokenReturns pair liquidity token.
#
pairReservesReturns reserves for pair tokens in sorted order.
#
pairToken0PriceReturns the current mid price of the pair in terms of token0, i.e. the ratio of reserve1 to reserve0.
#
pairToken1PriceReturns the current mid price of the pair in terms of token1, i.e. the ratio of reserve0 to reserve1.
#
pairOutputAmountPricing function for exact input amounts. Returns maximum output amount, based on current reserves, if the trade were executed.
#
pairOutputNextPairPricing function for exact input amounts. Returns next pair state, based on current reserves, if the trade were executed.
#
pairInputNextPairPricing function for exact output amounts. Returns next pair state, based on current reserves, if the trade were executed.
#
pairInputAmountPricing function for exact output amounts. Returns minimum input amount, based on current reserves, if the trade were executed.
#
pairLiquidityMintedCalculates the exact amount of liquidity tokens minted from a given amount of token0 and token1. totalSupply is total supply of pair liquidity token. totalSupply must be looked up on-chain. The value returned from this function cannot be used as an input to getLiquidityValue.
#
pairLiquidityMintedCalculates the exact amount of token0 or token1 that the given amount of liquidity tokens represent. totalSupply is total supply of pair liquidity token. 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.