Skip to main content
Helpful?

Quoter

Git Source - Generated with forge doc

Inherits: IQuoter, BaseV4Quoter

Functions

constructor

constructor(IPoolManager _poolManager) BaseV4Quoter(_poolManager);

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

_quoteExactInput

external function called within the _unlockCallback, to simulate an exact input swap, then revert with the result

function _quoteExactInput(QuoteExactParams calldata params) external selfOnly returns (bytes memory);

_quoteExactInputSingle

external function called within the _unlockCallback, to simulate a single-hop exact input swap, then revert with the result

function _quoteExactInputSingle(QuoteExactSingleParams calldata params) external selfOnly returns (bytes memory);

_quoteExactOutput

external function called within the _unlockCallback, to simulate an exact output swap, then revert with the result

function _quoteExactOutput(QuoteExactParams calldata params) external selfOnly returns (bytes memory);

_quoteExactOutputSingle

external function called within the _unlockCallback, to simulate a single-hop exact output swap, then revert with the result

function _quoteExactOutputSingle(QuoteExactSingleParams calldata params) external selfOnly returns (bytes memory);
Helpful?