AsyncSwap
Inherits: BaseHook, EIP712
Title: AsyncSwap
Author: @msakiart
Uniswap v4 hook that converts an exact-input swap into an open async order: the maker
deposits their input via _beforeSwap. Crossing orders settle directly at the resting
limit; fillers settle unmatched orders.
Makers can also act by EIP-712 signature (setExecutorWithSig, updatePriceWithSig) so a
relayer pays gas and the wallet shows a readable message. See OrderSignatures for types.
Constants
feeVault
Holds fee claims separately from open-order escrow.
FeeVault public immutable feeVault;numeraire
Chain-specific USDC address. Every pool must include this exact currency.
Currency public immutable numeraire;router
The only swap caller the hook accepts, fixed at deployment. Only the Router settles a new order's input
and hands it to matchNewOrder, so an order opened through any other caller would leave the
transient pending-match id set for the rest of the transaction, and matchBook would skip that pool.
address public immutable router;minOrder
Minimum order in numeraire base units (0: none), fixed at deployment for every pool so the owner cannot change the rules under live orders.
uint256 public immutable minOrder;priorityFeeCap
$0.10 in numeraire base units, 10^(decimals - 1): the most a priority-bid floor can require.
uint64 public immutable priorityFeeCap;assetPrecision
Decimal places of a whole asset token an order may trade, fixed at deployment: with 4, every order trades at least 0.0001 token on its asset side. 36 or more leaves only a 1-unit floor.
uint8 public immutable assetPrecision;PENDING_NATIVE_DEPOSIT_SLOT
Transient slot — keccak256("asyncswap.hook.pendingNativeDeposit") - 1.
Tracks ETH deposited to this contract within the current tx via
receive(), so executeOrder can settle native output only out of
the filler's just-received deposit rather than the contract's
accumulated balance (which may include donations, stranded ETH,
or in-flight native-input escrow). Cleared after each settle.
bytes32 constant PENDING_NATIVE_DEPOSIT_SLOT = 0x9c2a7e4f3b1d8a5c6e0f2d4b7a9c1e3d5f8b6a0c2e4d7b9f1a3c5e7d9b1f3a50;PENDING_MATCH_ID_SLOT
Transient hand-off from _beforeSwap to the Router after it settles the new input.
bytes32 constant PENDING_MATCH_ID_SLOT = 0x247d5e35be7fbfd4d95fd66ea940bfb4ee942bef70db6afae46dc83ce0f89eb2;PENDING_MATCH_EXECUTOR_SLOT
bytes32 constant PENDING_MATCH_EXECUTOR_SLOT = 0x9583e36f799bab8c4d06dc676d85ba05b4dfbde5934d5684d8e431d0fd3948da;State Variables
asyncOrders
Per-pool order book.
mapping(PoolId poolId => AsyncFiller.State) public asyncOrders;priceBooks
mapping(PoolId poolId => AsyncFiller.Book) private priceBooks;owner
Protocol owner authorized to collect vault fees and sweep stranded balances.
address public owner;pendingOwner
Address nominated by transferOwnership; becomes owner on acceptOwnership.
address public pendingOwner;nonceUsed
Unordered nonces consumed by signed maker actions (setExecutorWithSig, updatePriceWithSig).
mapping(address maker => mapping(uint256 nonce => bool)) public nonceUsed;Functions
onlyOwner
Restricts a call to the protocol owner.
modifier onlyOwner();constructor
constructor(
IPoolManager _poolManager,
Currency _numeraire,
address _owner,
address _router,
uint256 _minOrderUsd,
uint8 _assetPrecision
) BaseHook(_poolManager) EIP712("AsyncSwap", "1");Parameters
| Name | Type | Description |
|---|---|---|
| _poolManager | IPoolManager | |
| _numeraire | Currency | |
| _owner | address | Explicit protocol owner. Not msg.sender: CREATE2 deployments run theconstructor from the deterministic deployer, which could never act as owner. |
| _router | address | The Router, deployed after the hook (it takes the hook in its constructor): pass its predicted address. |
| _minOrderUsd | uint256 | Minimum order in whole numeraire units, e.g. dollars (0: none). The constructor scales it and the $0.10 bid cap by the numeraire's own decimals(), so neither can be mis-scaled. |
| _assetPrecision | uint8 | Decimal places of a whole asset token an order may trade (4: at least 0.0001 token). |
transferOwnership
Start a two-step ownership transfer. The deployer (or a factory) should call this after
deployment to hand control to the intended fee recipient / governance address, which
then calls acceptOwnership.
function transferOwnership(address newOwner) external onlyOwner;Parameters
| Name | Type | Description |
|---|---|---|
| newOwner | address |
acceptOwnership
Complete a two-step ownership transfer. Only the nominated pendingOwner may call.
function acceptOwnership() external;sweep
Sweep an accumulated balance of currency held by this hook to to.
Between transactions the hook's raw balance holds only stranded funds or donations; fees belong to feeVault. Maker input is escrowed as ERC-6909 claims in the PoolManager, and the transient native-deposit ledger is cleared at the end of every tx, so no per-order escrow lives in the hook's balance across calls.
function sweep(Currency currency, address to) external onlyOwner;Parameters
| Name | Type | Description |
|---|---|---|
| currency | Currency | |
| to | address |
_beforeInitialize
Anyone may open a pool that pairs the numeraire with a dynamic fee. No order check reads the pool price, so the initializer's choice of price cannot block orders.
function _beforeInitialize(address, PoolKey calldata key, uint160) internal virtual override returns (bytes4);Parameters
| Name | Type | Description |
|---|---|---|
| _ | address | |
| key | PoolKey | |
| _ | uint160 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes4 |
getHookPermissions
Returns a struct of permissions to signal which hook functions are to be implemented
Used at deployment to validate the address correctly represents the expected permissions
function getHookPermissions() public pure override returns (Hooks.Permissions memory);Returns
| Name | Type | Description |
|---|---|---|
| <none> | Hooks.Permissions |
_beforeAddLiquidity
function _beforeAddLiquidity(address, PoolKey calldata, ModifyLiquidityParams calldata, bytes calldata)
internal
pure
override
returns (bytes4);Parameters
| Name | Type | Description |
|---|---|---|
| _ | address | |
| _ | PoolKey | |
| _ | ModifyLiquidityParams | |
| _ | bytes |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes4 |
_minAssetAmount
10^(decimals - assetPrecision) base units of asset, at least 1. Native ETH has 18 decimals. A token
without a readable decimals() gets the 1-unit floor, and reported decimals are capped at 36. An asset
with no code reverts: a pool opened before its token is deployed would otherwise keep a 1-unit floor.
function _minAssetAmount(Currency asset) private view returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
| asset | Currency |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
asyncOrder
Read an order's currently-open input amount. Returns 0 if the order does not exist.
function asyncOrder(PoolId poolId, bytes32 orderId) external view returns (uint256 amountIn);Parameters
| Name | Type | Description |
|---|---|---|
| poolId | PoolId | |
| orderId | bytes32 |
Returns
| Name | Type | Description |
|---|---|---|
| amountIn | uint256 |
asyncOrderInfo
Read both legs of an open order. Returns (0, 0) if the order does not exist.
function asyncOrderInfo(PoolId poolId, bytes32 orderId)
external
view
returns (uint256 amountIn, uint256 amountOutMin);Parameters
| Name | Type | Description |
|---|---|---|
| poolId | PoolId | |
| orderId | bytes32 |
Returns
| Name | Type | Description |
|---|---|---|
| amountIn | uint256 | |
| amountOutMin | uint256 |
asyncOrderPriorityFee
The priority bid an order escrowed when it was created.
function asyncOrderPriorityFee(PoolId poolId, bytes32 orderId) external view returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
| poolId | PoolId | |
| orderId | bytes32 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
minAssetAmount
The least asset amount an order on this pool may trade (0 if not initialized).
function minAssetAmount(PoolId poolId) external view returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
| poolId | PoolId |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
bestOrder
Return the best live limit order for a pool side. isBuy is true
when the maker escrows the pool numeraire to buy the other asset.
priceKey is a WAD-scaled raw-amount ratio for sorting within this pool,
not a human-readable price. Equal-price orders queue by bid, then submission order.
function bestOrder(PoolId poolId, bool isBuy)
external
view
returns (bool found, uint128 priceKey, bytes32 orderId, address maker);Parameters
| Name | Type | Description |
|---|---|---|
| poolId | PoolId | |
| isBuy | bool |
Returns
| Name | Type | Description |
|---|---|---|
| found | bool | |
| priceKey | uint128 | |
| orderId | bytes32 | |
| maker | address |
orderBookLevel
Return the first and last order under the pool's configured ordering mode, plus count.
function orderBookLevel(PoolId poolId, bool isBuy, uint128 priceKey)
external
view
returns (bytes32 head, bytes32 tail, uint32 count);Parameters
| Name | Type | Description |
|---|---|---|
| poolId | PoolId | |
| isBuy | bool | |
| priceKey | uint128 |
Returns
| Name | Type | Description |
|---|---|---|
| head | bytes32 | |
| tail | bytes32 | |
| count | uint32 |
orderBookOrder
Read one live order: its terms, price key, queue position (sequence) and bid.
function orderBookOrder(PoolId poolId, bytes32 orderId)
external
view
returns (
address maker,
uint256 amountIn,
uint256 amountOutMin,
uint128 priceKey,
bool isBuy,
uint64 sequence,
uint64 priorityFee
);Parameters
| Name | Type | Description |
|---|---|---|
| poolId | PoolId | |
| orderId | bytes32 |
Returns
| Name | Type | Description |
|---|---|---|
| maker | address | |
| amountIn | uint256 | |
| amountOutMin | uint256 | |
| priceKey | uint128 | |
| isBuy | bool | |
| sequence | uint64 | |
| priorityFee | uint64 |
orderCreatedSequence
Immutable incarnation of a live order, used to bind cancellation signatures.
function orderCreatedSequence(PoolId poolId, bytes32 id) external view returns (uint64);Parameters
| Name | Type | Description |
|---|---|---|
| poolId | PoolId | |
| id | bytes32 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint64 |
orderReprices
How many times the order has been repriced: a signed UpdatePrice commits to it.
function orderReprices(PoolId poolId, bytes32 id) external view returns (uint32);Parameters
| Name | Type | Description |
|---|---|---|
| poolId | PoolId | |
| id | bytes32 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint32 |
isExecutor
function isExecutor(PoolId poolId, address maker, address executor) external view returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| poolId | PoolId | |
| maker | address | |
| executor | address |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
calculateHookFee
function calculateHookFee(uint256) public pure returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
| _ | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
calculatePoolFee
Surcharge a filler pays on top of the maker's minimum: none. The 0.02% trade fee comes
out of what each side receives instead (AsyncFiller.tradeFee).
function calculatePoolFee(uint24, uint256) public pure virtual returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
| _ | uint24 | |
| _ | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
executeOrder
Fill order in full. Must be called from an authorized executor (router) that has
already paid the filler's gross output within the same unlock: for ERC20 output via
PoolManager.settleFor(hook), for native output by sending ETH to this hook.
function executeOrder(AsyncOrder calldata order, bytes calldata data) external;Parameters
| Name | Type | Description |
|---|---|---|
| order | AsyncOrder | |
| data | bytes | abi.encode(filler) — the address that should receive the maker's input. |
matchNewOrder
Match the order just created by the current Router unlock callback.
The Router calls this only after settling the maker's input. The transient hand-off prevents stale order ids or a different executor from triggering a match.
function matchNewOrder(AsyncOrder calldata order) external returns (uint8 matched);Parameters
| Name | Type | Description |
|---|---|---|
| order | AsyncOrder |
Returns
| Name | Type | Description |
|---|---|---|
| matched | uint8 |
tryFillOrderFromPoolLiquidity
Permissionless executor entry for retrying a resting order against current pool LPs.
Must run inside PoolManager.unlock. Router calls this after validating the request path.
function tryFillOrderFromPoolLiquidity(AsyncOrder calldata order) external returns (bool filled);Parameters
| Name | Type | Description |
|---|---|---|
| order | AsyncOrder |
Returns
| Name | Type | Description |
|---|---|---|
| filled | bool |
fillOrderFromPoolLiquidity
The self-call boundary makes a failed AMM attempt atomic while preserving the resting
order. PoolManager skips hook callbacks when the hook itself is the swap caller, so this
swap does not create an order.
sqrtPriceLimitX96 is a price the swap may not cross (0 for none). Without one the whole order
fills or the call reverts; with one the pool may fill part and leave the rest on the book.
function fillOrderFromPoolLiquidity(AsyncOrder calldata order, bytes32 id, uint160 sqrtPriceLimitX96) external;Parameters
| Name | Type | Description |
|---|---|---|
| order | AsyncOrder | |
| id | bytes32 | |
| sqrtPriceLimitX96 | uint160 |
matchBook
Permissionlessly continue a crossed book inside a PoolManager unlock.
The Router exposes the unlock wrapper; each call processes at most eight pairs.
function matchBook(PoolKey calldata key, uint8 maxMatches) external returns (uint8 matched);Parameters
| Name | Type | Description |
|---|---|---|
| key | PoolKey | |
| maxMatches | uint8 |
Returns
| Name | Type | Description |
|---|---|---|
| matched | uint8 |
updatePrice
Maker updates the limit price of an unfilled order. Direct call from the maker — pure state mutation, no PM interaction, so no unlock or router needed.
function updatePrice(AsyncOrder calldata order, uint256 newAmountOutMin) external;Parameters
| Name | Type | Description |
|---|---|---|
| order | AsyncOrder | |
| newAmountOutMin | uint256 |
topUpPriorityFee
Increase an existing bid through the maker-authenticating Router inside an unlock.
The Router must settle the additional numeraire debt before the unlock ends.
function topUpPriorityFee(AsyncOrder calldata order, uint256 addedFee) external;Parameters
| Name | Type | Description |
|---|---|---|
| order | AsyncOrder | |
| addedFee | uint256 |
cancelOrder
Maker cancels an unfilled order. Must be called via an authorized executor inside
an IPoolManager.unlock context. The executor must have asserted maker identity.
The trusted Router needs no grant: it cancels only for order.owner or with the owner's signature,
and a cancel only returns input to the owner, so revoking the Router never traps a maker's orders.
function cancelOrder(AsyncOrder calldata order) external;Parameters
| Name | Type | Description |
|---|---|---|
| order | AsyncOrder |
_beforeSwap
function _beforeSwap(address sender, PoolKey calldata key, SwapParams calldata params, bytes calldata hookParams)
internal
override
returns (bytes4, BeforeSwapDelta, uint24);Parameters
| Name | Type | Description |
|---|---|---|
| sender | address | |
| key | PoolKey | |
| params | SwapParams | |
| hookParams | bytes |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes4 | |
| <none> | BeforeSwapDelta | |
| <none> | uint24 |
_createOrder
Extracted to keep _beforeSwap stack-shallow.
function _createOrder(PoolId poolId, bool zeroForOne, uint256 amountIn, UserParams memory hookData, bool isBuy)
private;Parameters
| Name | Type | Description |
|---|---|---|
| poolId | PoolId | |
| zeroForOne | bool | |
| amountIn | uint256 | |
| hookData | UserParams | |
| isBuy | bool |
setExecutor
Maker explicitly authorises an executor (typically the Router) to submit
and fill orders on their behalf. Without this grant, _createOrder reverts
on the maker's first swap. Pass allow = false to revoke an executor.
function setExecutor(PoolId poolId, address executor, bool allow) external;Parameters
| Name | Type | Description |
|---|---|---|
| poolId | PoolId | |
| executor | address | |
| allow | bool |
setExecutorWithSig
Signed setExecutor: anyone may submit the maker's EIP-712 SetExecutor grant.
Lets a relayer authorize the Router before the maker's first gasless order on a pool.
function setExecutorWithSig(
PoolKey calldata key,
address maker,
address executor,
bool allow,
uint256 nonce,
uint256 deadline,
bytes calldata signature
) external;Parameters
| Name | Type | Description |
|---|---|---|
| key | PoolKey | |
| maker | address | |
| executor | address | |
| allow | bool | |
| nonce | uint256 | |
| deadline | uint256 | |
| signature | bytes |
updatePriceWithSig
Signed updatePrice: anyone may submit the maker's EIP-712 UpdatePrice message.
function updatePriceWithSig(
AsyncOrder calldata order,
uint256 amountIn,
uint256 newAmountOutMin,
uint256 nonce,
uint256 deadline,
bytes calldata signature
) external;Parameters
| Name | Type | Description |
|---|---|---|
| order | AsyncOrder | |
| amountIn | uint256 | The order's input the maker signed against. If matches have since shrunk the order, the signed price applies to the remainder: its minimum is newAmountOutMin scaled down, rounded up. |
| newAmountOutMin | uint256 | |
| nonce | uint256 | |
| deadline | uint256 | |
| signature | bytes |
_verifyReprice
Verifies a signed UpdatePrice against the order's creation sequence and reprice count, and returns
its minimum for the order's live input: orders only shrink, so a live input above the signed one means
the signature was for another order, and a smaller one gets the signed price, rounded up.
function _verifyReprice(
AsyncOrder calldata order,
bytes32 id,
uint256 amountIn,
uint256 newAmountOutMin,
uint256 nonce,
uint256 deadline,
bytes calldata signature
) private returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
| order | AsyncOrder | |
| id | bytes32 | |
| amountIn | uint256 | |
| newAmountOutMin | uint256 | |
| nonce | uint256 | |
| deadline | uint256 | |
| signature | bytes |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
invalidateNonce
Revoke a signed action before a relayer submits it.
function invalidateNonce(uint256 nonce) external;Parameters
| Name | Type | Description |
|---|---|---|
| nonce | uint256 |
useNonce
Burns maker's nonce for a signature the Router verified itself (cancelWithSig).
Every maker signature shares this one nonce space, so invalidateNonce revokes those
signatures too, and only the trusted Router may burn one: any other executor could
void the maker's signed actions on every pool.
The Router needs no grant here, so a maker who revoked it can still cancel by signature.
function useNonce(address maker, uint256 nonce) external;Parameters
| Name | Type | Description |
|---|---|---|
| maker | address | |
| nonce | uint256 |
DOMAIN_SEPARATOR
EIP-712 domain separator for this hook's signed actions.
function DOMAIN_SEPARATOR() external view returns (bytes32);Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes32 |
_verify
Checks deadline, burns the nonce, then validates an EOA or ERC-1271 signature.
function _verify(address maker, bytes32 structHash, uint256 nonce, uint256 deadline, bytes calldata signature)
private;Parameters
| Name | Type | Description |
|---|---|---|
| maker | address | |
| structHash | bytes32 | |
| nonce | uint256 | |
| deadline | uint256 | |
| signature | bytes |
_useNonce
function _useNonce(address maker, uint256 nonce) private;Parameters
| Name | Type | Description |
|---|---|---|
| maker | address | |
| nonce | uint256 |
receive
Accept ETH transfers. The Router (or any caller paying for a native-output
fill) forwards msg.value to the hook before triggering executeOrder. The hook
records the deposit on a transient slot so executeOrder settles only against the
filler's same-transaction deposit. ETH sent without a follow-up executeOrder stays
in the hook balance and is recoverable only through sweep.
receive() external payable;Events
HookSwap
Pool-level swap-event mirror; bytes32 poolId for indexer compatibility.
See https://github.com/OpenZeppelin/uniswap-hooks BaseAsyncSwap for the source pattern.
event HookSwap(
bytes32 indexed id,
address indexed sender,
int128 amount0,
int128 amount1,
uint128 hookLPfeeAmount0,
uint128 hookLPfeeAmount1
);Parameters
| Name | Type | Description |
|---|---|---|
| id | bytes32 | |
| sender | address | |
| amount0 | int128 | |
| amount1 | int128 | |
| hookLPfeeAmount0 | uint128 | |
| hookLPfeeAmount1 | uint128 |
OwnershipTransferred
Emitted when ownership is transferred.
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);Parameters
| Name | Type | Description |
|---|---|---|
| previousOwner | address | |
| newOwner | address |
OwnershipTransferStarted
Emitted when the owner nominates a new owner.
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);Parameters
| Name | Type | Description |
|---|---|---|
| previousOwner | address | |
| newOwner | address |
Swept
Emitted when the owner sweeps an accumulated balance.
event Swept(Currency indexed currency, address indexed to, uint256 amount);Parameters
| Name | Type | Description |
|---|---|---|
| currency | Currency | |
| to | address | |
| amount | uint256 |
NonceInvalidated
Emitted when a maker burns a nonce, consumed or revoked.
event NonceInvalidated(address indexed maker, uint256 nonce);Parameters
| Name | Type | Description |
|---|---|---|
| maker | address | |
| nonce | uint256 |
ExecutorSet
Emitted after each successful direct or signed executor authorization update.
allow is the resulting permission, including when the value is unchanged.
event ExecutorSet(PoolId indexed poolId, address indexed maker, address indexed executor, bool allow);Parameters
| Name | Type | Description |
|---|---|---|
| poolId | PoolId | |
| maker | address | |
| executor | address | |
| allow | bool |
AsyncOrdersMatched
Pairwise direct escrow match; emitted by the linked matcher at the hook address.
event AsyncOrdersMatched(
PoolId indexed poolId,
bytes32 indexed sellOrderId,
bytes32 indexed buyOrderId,
uint256 assetAmount,
uint256 numeraireAmount
);Parameters
| Name | Type | Description |
|---|---|---|
| poolId | PoolId | |
| sellOrderId | bytes32 | |
| buyOrderId | bytes32 | |
| assetAmount | uint256 | |
| numeraireAmount | uint256 |
AsyncOrderLiquidityFilled
An open order was fully executed against active Uniswap v4 pool liquidity.
event AsyncOrderLiquidityFilled(
PoolId indexed poolId, bytes32 indexed orderId, address indexed maker, uint256 amountIn, uint256 amountOut
);Parameters
| Name | Type | Description |
|---|---|---|
| poolId | PoolId | |
| orderId | bytes32 | |
| maker | address | |
| amountIn | uint256 | |
| amountOut | uint256 |
DynamicFeeCharged
Mirror of DynamicFeeOrdering.DynamicFeeCharged, emitted by the linked library in this
contract's context, so the hook's ABI decodes it.
event DynamicFeeCharged(
PoolId indexed poolId,
bytes32 indexed orderId,
Currency indexed currency,
uint256 toLps,
uint256 toFeeVault,
int24 refTick
);Parameters
| Name | Type | Description |
|---|---|---|
| poolId | PoolId | |
| orderId | bytes32 | |
| currency | Currency | |
| toLps | uint256 | |
| toFeeVault | uint256 | |
| refTick | int24 |
PoolPriceObserved
Mirror of DynamicFeeOrdering.PoolPriceObserved, emitted by the linked library in this
contract's context so indexers can reconstruct completed pool-fill price movements.
event PoolPriceObserved(
PoolId indexed poolId,
bytes32 indexed orderId,
int24 tickBefore,
int24 tickAfter,
int24 refTick,
uint64 observedBlock
);Parameters
| Name | Type | Description |
|---|---|---|
| poolId | PoolId | |
| orderId | bytes32 | |
| tickBefore | int24 | |
| tickAfter | int24 | |
| refTick | int24 | |
| observedBlock | uint64 |
AsyncOrderPriorityFeeUpdated
event AsyncOrderPriorityFeeUpdated(
PoolId indexed poolId, bytes32 indexed orderId, uint256 addedFee, uint256 newPriorityFee
);Parameters
| Name | Type | Description |
|---|---|---|
| poolId | PoolId | |
| orderId | bytes32 | |
| addedFee | uint256 | |
| newPriorityFee | uint256 |
Errors
ExactInputOnly
error ExactInputOnly();UnaccountedNativeOutput
error UnaccountedNativeOutput();NotOwner
error NotOwner();ZeroAddress
error ZeroAddress();UnsupportedNumeraireDecimals
error UnsupportedNumeraireDecimals();AssetHasNoCode
error AssetHasNoCode();SignatureExpired
error SignatureExpired();InvalidSignature
error InvalidSignature();NonceAlreadyUsed
error NonceAlreadyUsed();InvalidNumeraire
error InvalidNumeraire();NumeraireRequired
error NumeraireRequired();DynamicFeeRequired
error DynamicFeeRequired();NotSelf
error NotSelf();NotTrustedRouter
error NotTrustedRouter();CannotRevokeTrustedRouter
Revoking the Router would strand the maker's live orders: Router.cancelOrder, cancelWithSig, fillOrder and fillFromPoolLiquidity all need the grant, and an EOA can't cancel from its own unlock. So the trusted Router can never be revoked; any other executor can.
error CannotRevokeTrustedRouter();Structs
UserParams
Hook params decoded from the hookData of IPoolManager.swap. The maker sets
amountOutMin (their limit price); executor is the address authorized to call fill.
Salt is contract-assigned at create time (see _createOrder) and emitted in
AsyncOrderCreated — the maker fetches it from the event log to reference the
order in cancel / updatePrice later.
struct UserParams {
address user;
address executor;
uint256 amountOutMin;
uint256 priorityFee;
}Properties
| Name | Type | Description |
|---|---|---|
| user | address | |
| executor | address | |
| amountOutMin | uint256 | |
| priorityFee | uint256 |