Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

IPriceChecker

Git Source

Interface for price checker contracts used by Milkman to validate swaps

Functions

checkPrice

Check if a swap price is acceptable

function checkPrice(
    uint256 amountIn,
    address fromToken,
    address toToken,
    uint256 feeAmount,
    uint256 minOut,
    bytes calldata data
)
    external
    view
    returns (bool);

Parameters

NameTypeDescription
amountInuint256The amount of input tokens (including fee)
fromTokenaddressThe input token address
toTokenaddressThe output token address
feeAmountuint256The fee amount in input tokens
minOutuint256The minimum output amount from the solver
databytesAdditional data for price checking

Returns

NameTypeDescription
<none>boolTrue if the price is acceptable