Pair
Imported types#
Token#
TokenAmount#
Query schemas#
pairAddress#
Returns address of pair liquidity token contract.
pairLiquidityToken#
Returns pair liquidity token.
pairReserves#
Returns reserves for pair tokens in sorted order.
pairToken0Price#
Returns the current mid price of the pair in terms of token0, i.e. the ratio of reserve1 to reserve0.
pairToken1Price#
Returns the current mid price of the pair in terms of token1, i.e. the ratio of reserve0 to reserve1.
pairOutputAmount#
Pricing function for exact input amounts. Returns maximum output amount, based on current reserves, if the trade were executed.
pairOutputNextPair#
Pricing function for exact input amounts. Returns next pair state, based on current reserves, if the trade were executed.
pairInputNextPair#
Pricing function for exact output amounts. Returns next pair state, based on current reserves, if the trade were executed.
pairInputAmount#
Pricing function for exact output amounts. Returns minimum input amount, based on current reserves, if the trade were executed.
pairLiquidityMinted#
Calculates 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.
pairLiquidityMinted#
Calculates 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.