Skip to main content
Helpful?

IV4Router

Git Source - Generated with forge doc

Inherits: IImmutableState

Interface containing all the structs and errors for different v4 swap types

Errors

V4TooLittleReceived

Emitted when an exactInput swap does not receive its minAmountOut

error V4TooLittleReceived(uint256 minAmountOutReceived, uint256 amountReceived);

V4TooMuchRequested

Emitted when an exactOutput is asked for more than its maxAmountIn

error V4TooMuchRequested(uint256 maxAmountInRequested, uint256 amountRequested);

Structs

ExactInputSingleParams

Parameters for a single-hop exact-input swap

struct ExactInputSingleParams {
PoolKey poolKey;
bool zeroForOne;
uint128 amountIn;
uint128 amountOutMinimum;
bytes hookData;
}

ExactInputParams

Parameters for a multi-hop exact-input swap

struct ExactInputParams {
Currency currencyIn;
PathKey[] path;
uint128 amountIn;
uint128 amountOutMinimum;
}

ExactOutputSingleParams

Parameters for a single-hop exact-output swap

struct ExactOutputSingleParams {
PoolKey poolKey;
bool zeroForOne;
uint128 amountOut;
uint128 amountInMaximum;
bytes hookData;
}

ExactOutputParams

Parameters for a multi-hop exact-output swap

struct ExactOutputParams {
Currency currencyOut;
PathKey[] path;
uint128 amountOut;
uint128 amountInMaximum;
}
Helpful?