HOT Swap
Given a struct hot
of type HolverOrderType
, an HOT swap involves the following steps:
hot.authorizedSender
callspool
the Sovereign Pool containing the HOT Liquidity Module.pool
performs basic validation of input data (see Sovereign Pool Documentation).pool
callsHOT
getSwapFeeInBips
, which calculates the correct swap fee to charge on this HOT swap. In order to trigger the correct branch in the HOT contract, which is both a Liquidity Module and Swap Fee Module,authorizedSender
should pass a non-empty bytes payload as its_externalContext
. The authentication of the HOT and the choice of fee path will be performed later.HOT
checks thatauthorizedSender
has chosen the correct Swap Fee Module execution path in step 3. Revert otherwise.Check that the number of HOT swaps on this block does not exceed the maximum limit. Revert otherwise.
Determine price to be quoted to
hot.recipient
Validate that
hot
AMM fee parameters meet the correct bounds and criteria:
Validate fundamental parameters in the
hot
struct:
Validate proximity between all square-root prices against the square-root oracle price.
Check that EIP-712 signature of
hot
is valid and has been signed bysigner
. Revert otherwise.Update
hybridWriteSlot
parameters.In case the
hot
meets the criteria to update AMM spot price, AMM’ssqrtSpotPriceX96
gets set tohot.sqrtSpotPriceX96New
Call returns to the pool’s swap function, which proceeds to exchange the correct input and output token amounts, as well as perform all required internal state updates.
Last updated