Skip to main content

IV4Quoter

Git Source - Generated with forge doc

Inherits: IImmutableState

Interface for the V4Quoter contract

Functions

quoteExactInputSingle

Returns the delta amounts for a given exact input swap of a single pool

function quoteExactInputSingle(QuoteExactSingleParams memory params)
external
returns (uint256 amountOut, uint256 gasEstimate);

Parameters

NameTypeDescription
paramsQuoteExactSingleParamsThe params for the quote, encoded as QuoteExactSingleParams poolKey The key for identifying a V4 pool zeroForOne If the swap is from currency0 to currency1 exactAmount The desired input amount hookData arbitrary hookData to pass into the associated hooks

Returns

NameTypeDescription
amountOutuint256The output quote for the exactIn swap
gasEstimateuint256Estimated gas units used for the swap

quoteExactInput

Returns the delta amounts along the swap path for a given exact input swap

function quoteExactInput(QuoteExactParams memory params) external returns (uint256 amountOut, uint256 gasEstimate);

Parameters

NameTypeDescription
paramsQuoteExactParamsthe params for the quote, encoded as 'QuoteExactParams' currencyIn The input currency of the swap path The path of the swap encoded as PathKeys that contains currency, fee, tickSpacing, and hook info exactAmount The desired input amount

Returns

NameTypeDescription
amountOutuint256The output quote for the exactIn swap
gasEstimateuint256Estimated gas units used for the swap

quoteExactOutputSingle

Returns the delta amounts for a given exact output swap of a single pool

function quoteExactOutputSingle(QuoteExactSingleParams memory params)
external
returns (uint256 amountIn, uint256 gasEstimate);

Parameters

NameTypeDescription
paramsQuoteExactSingleParamsThe params for the quote, encoded as QuoteExactSingleParams poolKey The key for identifying a V4 pool zeroForOne If the swap is from currency0 to currency1 exactAmount The desired output amount hookData arbitrary hookData to pass into the associated hooks

Returns

NameTypeDescription
amountInuint256The input quote for the exactOut swap
gasEstimateuint256Estimated gas units used for the swap

quoteExactOutput

Returns the delta amounts along the swap path for a given exact output swap

function quoteExactOutput(QuoteExactParams memory params) external returns (uint256 amountIn, uint256 gasEstimate);

Parameters

NameTypeDescription
paramsQuoteExactParamsthe params for the quote, encoded as 'QuoteExactParams' currencyOut The output currency of the swap path The path of the swap encoded as PathKeys that contains currency, fee, tickSpacing, and hook info exactAmount The desired output amount

Returns

NameTypeDescription
amountInuint256The input quote for the exactOut swap
gasEstimateuint256Estimated gas units used for the swap

Structs

QuoteExactSingleParams

struct QuoteExactSingleParams {
PoolKey poolKey;
bool zeroForOne;
uint128 exactAmount;
bytes hookData;
}

QuoteExactParams

struct QuoteExactParams {
Currency exactCurrency;
PathKey[] path;
uint128 exactAmount;
}