Valantis Documentation
Valantis Website
  • Welcome to Valantis
  • Sovereign Pool
    • The Modules
      • Pool Manager
      • Liquidity Module
      • Swap Fee Module
      • Verifier Module
      • Oracle Module
      • Sovereign Vault
        • Rebase token support
      • Gauge
    • Interacting with Pools
      • Swap Parameters
      • Swap Steps
      • Multi Token Support
      • Deposit Liquidity
      • Withdraw Liquidity
      • Flash Loans
  • Hybrid Order Type (HOT)
    • Understanding HOT: A Graphical Overview
    • HOT API
      • HTTP request parameters
      • HTTP request response
      • Reasoning for Request structure
      • Solver Integration
      • Market Maker integration
    • HOT Smart Contracts
      • Interfaces
      • State variables and roles
      • AMM
      • HOT Swap
      • AMM Swap
      • Hybrid Order Type (HOT) struct parameters
      • Alternating Nonce Bitmap
      • Deposits
      • Withdrawals
      • Deployment Assumptions
    • Liquidity Manager Docs
      • Reference Oracle
      • Deposit
      • Withdraw
      • Signature
    • Swap
      • Swap Context
      • AMM Swap
      • HOT Swap
      • HOT Quote Parameters
        • Bitmap Nonce Instructions
    • Solver Docs
      • Solver Request
      • Simple HOT Swap Example
      • Partial Fill HOT Swap Example
    • Risks and Trust Assumptions
      • Roles
        • Sovereign Pool Manager
        • HOT Manager
        • HOT Signer
        • Liquidity Provider
      • Threats
        • Deposit Sandwich
        • Malicious Price Bound
        • Malicious Signer
        • Mispriced HOT Quote
  • Validly
    • Understanding Validly
    • Swap
    • Deposits and Withdrawals
    • Deployments
  • Stake Exchange (stHYPE AMM)
    • Swap
      • Instant Withdrawals (LST -> Native Token)
      • New Stake (Native Token -> LST)
    • LP Positions
      • LP Withdrawals Instant
      • LP Withdrawal Queued
    • Ratio Fee
    • Lending of Reserves
    • Smart contracts
      • STEXAMM.sol
      • StHYPEWithdrawalModule.sol
      • StexRatioSwapFeeModule.sol
      • DepositWrapper.sol
      • AaveLendingModule.sol
    • Risks and Trust Assumptions
    • Integration examples
  • Deploy and Build
  • Resources
    • Audits
    • Links
    • Get HYPE on HyperEVM
Powered by GitBook
On this page

Was this helpful?

  1. Hybrid Order Type (HOT)
  2. Swap
  3. HOT Quote Parameters

Bitmap Nonce Instructions

PreviousHOT Quote ParametersNextSolver Docs

Last updated 1 year ago

Was this helpful?

This page is intended as instructions for a Liquidity Manager to construct valid nonce values compatible with the HOT bitmap. Full documentation for the HOT Nonce Bitmap can be found here: .

The HOT contract has a bitmap of 56 nonces. The signer keeps track of all signed quotes that have not yet expired or landed onchain, these quotes are considered “active”.

A nonce assigned to an “active” quote is considered “taken”, all other nonces are “free”.

When a new solver quote request comes in through the API, the signer has to do the following things:

  1. Identify a “free” nonce.

  2. Set the expected flag to the current value of the bit currently present at the selected nonce index. For example, if the current Nonce Bitmap looks like the Old Bitmap shown above, then If nonce = 0, expectedFlag = 1 If nonce = 1, expectedFlag = 0 If nonce = 2, expectedFlag = 1, and so on.

When the HOT quote is processed, the bit present at the specified nonce index is checked against the expected flag. If the values are the same, the quote is valid and the swap is processed. After processing the swap, the bit on the specified nonce index is flipped to prevent a replay attack. The next time this nonce is used, the expected flag must correspond to the newly flipped bit value.

Note: When assigning a nonce that is already assigned to another “active” quote, there is a possibility that one of these quotes can be replayed onchain. It is important for a HOT Signer to make sure that the nonce they are including in a new quote is “free”.

HOT Quote replay protection