Hybrid Order Type (HOT) struct parameters

The Hybrid Order Type (HOT) struct is defined in the smart contract as follows:

/**
    @notice The struct with all the information for a HOT swap. 

    This struct is signed by `signer`, and put onchain via HOT swaps.

    * amountInMax: Maximum amount of input token which `authorizedSender` is allowed to swap.
    * sqrtHotPriceX96Discounted: sqrtPriceX96 to quote if the HOT is eligible to update AMM state (see HOT).
    * sqrtHotPriceX96Base: sqrtPriceX96 to quote if the HOT isn't eligible to update AMM (can be same as above).
    * sqrtSpotPriceX96New: New sqrt spot price of the AMM, in Q96 format.
    * authorizedSender: Address of authorized msg.sender in `pool`.
    * authorizedRecipient: Address of authorized recipient of tokenOut amounts.
    * signatureTimestamp: Offchain UNIX timestamp that determines when this HOT intent has been signed.
    * expiry: Duration, in seconds, for the validity of this HOT intent.
    * feeMinToken0: Minimum AMM swap fee for token0.
    * feeMaxToken0: Maximum AMM swap fee for token0.
    * feeGrowthE6Token0: Fee growth in pips, per second, of AMM swap fee for token0.
    * feeMinToken1: Minimum AMM swap fee for token1.
    * feeMaxToken1: Maximum AMM swap fee for token1.
    * feeGrowthE6Token1: Fee growth in pips, per second, of AMM swap fee for token1.
    * nonce: Nonce in bitmap format (see AlternatingNonceBitmap library and docs).
    * expectedFlag: Expected flag (0 or 1) for nonce (see AlternatingNonceBitmap library and docs).
    * isZeroToOne: Direction of the swap for which the HOT is valid.
 */
struct HybridOrderType {
    uint256 amountInMax;
    uint160 sqrtHotPriceX96Discounted;
    uint160 sqrtHotPriceX96Base;
    uint160 sqrtSpotPriceX96New;
    address authorizedSender;
    address authorizedRecipient;
    uint32 signatureTimestamp;
    uint32 expiry;
    uint16 feeMinToken0;
    uint16 feeMaxToken0;
    uint16 feeGrowthE6Token0;
    uint16 feeMinToken1;
    uint16 feeMaxToken1;
    uint16 feeGrowthE6Token1;
    uint8 nonce;
    uint8 expectedFlag;
    bool isZeroToOne;
}

```

The HTTP response returned by Valantis API to the solver will include a pool-specific payload containing HybridOrderType and an EIP-712 signature by the liquidity manager. Parameters are described as follows:

  • amountInMax - This is the maximum amount of input token which the solver is allowed to trade against the pool. Partially fillable orders are accepted.

  • sqrtHotPriceX96Discounted- This is the improved price ( in sqrtX96 form ) that the solver gets if the HOT swap includes a valid AMM state update.

  • sqrtHotPriceX192Base - This is the fallback price ( in sqrtX96 form ) that the solver gets if its HOT swap has been successfully validated, but did not meet the criteria to update the AMM’s state variables. To simplify the price dynamics and keep it deterministic, the liquidity manager can set it equal to sqrtHotPriceX96Discounted , thus giving the price discount to the solver whether or not it updates the AMM state.

  • sqrtSpotPriceX96New - The most up-to-date AMM square-root spot price, as specified by the liquidity manager. After the HOT has been successfully validated, the AMM’s spot price will be updated towards this value.

  • authorizedSender - Address of msg.sender who is allowed to call the Valantis pool with this payload. This flag in order to prevent front-running or other kinds of unwanted accesses.

  • authorizedRecipient Address that must receive output token amounts after the AMM swap.

  • signatureTimestamp Off-chain UNIX timestamp at which the liquidity manager signed the HOT quote.

  • expiry Duration the HOT quote is valid. It becomes invalid once blockTimestamp > signatureTimestamp + expiry

  • feeMinToken0 Minimum AMM swap fee for swaps where token0 is the input token.

  • feeMaxToken0 Maximum AMM swap fee for swaps where token0 is the input token.

  • feeGrowthInPipsToken0 Growth rate per second, in percentage points, to interpolate between feeMinToken0 and feeMaxToken0 .

  • feeMinToken1 Minimum AMM swap fee for swaps where token1 is the input token.

  • feeMaxToken1 Maximum AMM swap fee for swaps where token1 is the input token.

  • feeGrowthInPipsToken1 Growth rate per second, in percentage points, to interpolate between feeMinToken1 and feeMaxToken1 .

  • nonce Nonce used for replay protection, set as a bitmap on a uint56 value.

  • expectedFlag Expected value for bit at a certain position in a nonce bitmap. See (nonce explanation docs) for more details.

  • isZeroToOne Direction of the swap. True if input token is pool's token0 and output token is pool's token1, False otherwise.

Last updated