Protocol

RFQ for size

The AMM caps each trade at maxTradeUsdE6 and widens with inventory skew because it cannot see Hyperliquid depth. For larger sizes the pool accepts signed quotes through TangentRFQ:

  1. The hedger exposes POST /rfq/quote { tokenIn, tokenOut, amountIn, taker? }. It walks the Hyperliquid l2Book for the hedge size to get VWAP slippage in bps and prices spreadBps = clamp(max(minRfqSpreadBps, baseSpreadBps/2 + slippageBps + buffer), minRfqSpreadBps, maxSpreadBps) at the current posted mid, with the same rounding as the contract. The quote expires after ~30 s and carries a random 256-bit nonce.
  2. It signs an EIP-712 Quote { taker, tokenIn, tokenOut, amountIn, amountOut, spreadBps, expiry, nonce } (domain "Tangent RFQ", version "1") with the key set as TangentRFQ.quoter.
  3. The taker approves tokenIn to TangentRFQ (not the pool) and calls fill(quote, signature). The contract checks expiry (QuoteExpired), taker (WrongTaker), nonce (NonceUsed) and signer (BadSigner), pulls amountIn and calls pool.swapRFQ.
  4. swapRFQ applies no skew but enforces minRfqSpreadBps ≤ spreadBps ≤ maxSpreadBps, tradeUsd ≤ rfqMaxTradeUsdE6 (default $50,000), the inventory cap and the reduce-only rule, and bounds the price at the current oracle mid: fairOut × (1 − maxSpread) ≤ amountOut ≤ fairOut, otherwise RfqPriceOutOfBounds. The taker can never receive more than the stated spread implies.

The web app proxies the quoter at POST /api/rfq/quote and reports its configuration at GET /api/rfq/info. On the Trade page the AMM | RFQ toggle switches to RFQ automatically when the AMM reverts TradeTooLarge; the firm output, spread, book slippage and a countdown to expiry are shown and a fresh quote is requested when fewer than 5 s remain. When TangentRFQ is not deployed on the configured chain the toggle is disabled.