ISeawaterExecutorSwapPermit2

Git Source

Functions

swapPermit2EE84AD91

swaps within a pool using permit2 for token transfers

function swapPermit2EE84AD91(
    address pool,
    bool zeroForOne,
    int256 amount,
    uint256 priceLimit,
    uint256 nonce,
    uint256 deadline,
    uint256 maxAmount,
    bytes memory sig
) external returns (int256, int256);

Parameters

NameTypeDescription
pooladdressthe pool to swap on
zeroForOnebooltrue if swapping token->fluid token
amountint256the amount of token to swap, positive if exactIn, negative if exactOut
priceLimituint256the price limit for swaps, encoded as a sqrtX96 price
nonceuint256the permit2 nonce
deadlineuint256the permit2 deadline
maxAmountuint256the permit2 maxAmount
sigbytesthe permit2 signature

Returns

NameTypeDescription
<none>int256(token0, token1) delta
<none>int256

swap2ExactInPermit236B2FDD8

performs a two stage swap across two pools using permit2 for token transfers

permit2's max amount must be set to amount

function swap2ExactInPermit236B2FDD8(
    address from,
    address to,
    uint256 amount,
    uint256 minOut,
    uint256 nonce,
    uint256 deadline,
    bytes memory sig
) external returns (uint256, uint256);

Parameters

NameTypeDescription
fromaddressthe input token
toaddressthe output token
amountuint256the amount of the input token to use
minOutuint256the minimum valid amount of the output token, reverts if not reached
nonceuint256the permit2 nonce
deadlineuint256the permit2 deadline
sigbytesthe permit2 signature

Returns

NameTypeDescription
<none>uint256(amount in, amount out)
<none>uint256