ISeawaterExecutorSwapPermit2
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
Name | Type | Description |
---|---|---|
pool | address | the pool to swap on |
zeroForOne | bool | true if swapping token->fluid token |
amount | int256 | the amount of token to swap, positive if exactIn, negative if exactOut |
priceLimit | uint256 | the price limit for swaps, encoded as a sqrtX96 price |
nonce | uint256 | the permit2 nonce |
deadline | uint256 | the permit2 deadline |
maxAmount | uint256 | the permit2 maxAmount |
sig | bytes | the permit2 signature |
Returns
Name | Type | Description |
---|---|---|
<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
Name | Type | Description |
---|---|---|
from | address | the input token |
to | address | the output token |
amount | uint256 | the amount of the input token to use |
minOut | uint256 | the minimum valid amount of the output token, reverts if not reached |
nonce | uint256 | the permit2 nonce |
deadline | uint256 | the permit2 deadline |
sig | bytes | the permit2 signature |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | (amount in, amount out) |
<none> | uint256 |