Skip to main content

PathKey

Git Source - Generated with forge doc

struct PathKey {
Currency intermediateCurrency;
uint24 fee;
int24 tickSpacing;
IHooks hooks;
bytes hookData;
}

PathKeyLibrary

Git Source

Functions for working with PathKeys

Functions

getPoolAndSwapDirection

Get the pool and swap direction for a given PathKey

function getPoolAndSwapDirection(PathKey calldata params, Currency currencyIn)
internal
pure
returns (PoolKey memory poolKey, bool zeroForOne);

Parameters

NameTypeDescription
paramsPathKeythe given PathKey
currencyInCurrencythe input currency

Returns

NameTypeDescription
poolKeyPoolKeythe pool key of the swap
zeroForOneboolthe direction of the swap, true if currency0 is being swapped for currency1