HOT Swap
Last updated
Was this helpful?
Last updated
Was this helpful?
Given a struct hot
of type HolverOrderType
, an HOT swap involves the following steps:
hot.authorizedSender
calls pool
the Sovereign Pool containing the HOT Liquidity Module.
pool
performs basic validation of input data (see ).
pool
calls HOT
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 that authorizedSender
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 by signer
. Revert otherwise.
Update hybridWriteSlot
parameters.
In case the hot
meets the criteria to update AMM spot price, AMM’s sqrtSpotPriceX96
gets set to hot.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.