Skip to content
LogoLogo

AsyncOrder

Git Source

Represents an async order for a swap in the Uniswap V4 pool.

struct AsyncOrder {
    PoolKey key;
    address owner;
    bool zeroForOne;
    uint256 amountIn;
    uint256 amountOutMin;
    uint256 priorityFee;
    uint160 sqrtPrice;
    bytes32 salt;
}

Properties

NameTypeDescription
keyPoolKeyThe Uniswap V4 PoolKey identifying the pool the order is placed against.
owneraddressThe maker who supplied amountIn of the input currency at order submission.
zeroForOneboolDirection of the order. true => input is currency0, output is currency1.
amountInuint256Amount of input currency the maker escrowed. Direct matching may partially fill it;
unused input is returned when the maker's minimum output is satisfied.
amountOutMinuint256Minimum amount of output currency the maker accepts. The implicit limit price is
amountOutMin / amountIn. A filler or direct match must satisfy the live minimum
for the amount it consumes.
priorityFeeuint256Optional non-refundable USDC bid for equal-price priority. Zero is valid; a nonzero
bid must be at least $0.10, or 0.1% of the order's USDC notional when that is less.
Matched portions, and the remainder on a
fill, cancel or dust closure, go to the protocol FeeVault.
sqrtPriceuint160Sqrt-price limit passed to PoolManager.swap on submission. The hook consumes
the whole input in beforeSwap, so the pool never trades against it.
saltbytes32Contract-assigned salt that disambiguates orders. The hook computes this at create
time from keccak256(timestamp, block.number, msg.sender, owner, amountIn,<br/>amountOutMin, priorityFee) and emits it in AsyncOrderCreated so the maker can reference the
order in cancel / updatePrice. Submitters pass bytes32(0) on create — the value
in this slot is only read on cancel / updatePrice / fill paths.