RFQ (Request for Quote)

An RFQ (request for quote) order is a limit order whose price is quoted off-chain by the maker, typically a market maker responding to a quote request, and signed for a one-shot fill. It uses the same instruction set as a standard limit order with a bitmap invalidator; the distinction is operational, not structural.

RFQ orders are part of the 1inch Limit Order Protocol. They are quoted and signed off-chain and filled through the Aggregation Router and the Limit Order Protocol, not through Aqua's AMM pools. The program is encoded with SwapVM, the shared swap engine, but the opcodes shown below (bitmap invalidation via Invalidators) belong to the limit-order opcode set, which runs on a separate router from the Aqua AMM router (AquaSwapVMRouter).


How it differs from a limit order

Aspect Limit order RFQ
Price source Maker sets rate at order creation Market maker quotes on demand
Fill model May sit open for hours or days Intended for immediate single fill
Expiry Optional _deadline Short _deadline required (price is stale quickly)
Invalidation Bitmap or token-out Bitmap only (one-shot)

Program

Solidity
1
2
3
4
5
6
7
8
9
10
Program memory program = ProgramBuilder.init(_opcodes());
bytes memory bytecode = bytes.concat(
    program.build(_deadline, ControlsArgsBuilder.buildDeadline(block.timestamp + 30)),
    program.build(_invalidateBit1D, InvalidatorsArgsBuilder.buildInvalidateBit(nonce)),
    program.build(_staticBalancesXD, BalancesArgsBuilder.build(
        dynamic([tokenIn, tokenOut]),
        dynamic([uint256(quoteAmountIn), uint256(quoteAmountOut)])
    )),
    program.build(_limitSwap1D, LimitSwapArgsBuilder.build(tokenIn, tokenOut))
);

Instruction order matters. _deadline runs first, rejecting stale quotes before any state is touched. _invalidateBit1D runs second, providing replay protection before amounts are computed. The short deadline (30 seconds in the example) prevents a quote from being held and replayed later at an advantageous moment.


Optional modifiers

Goal Add
Holder-gated fills _onlyTakerTokenBalanceNonZero after _deadline
Protocol fee _protocolFeeAmountInXD before _limitSwap1D

  • Limit Order: general limit order patterns

  • Controls: _deadline args and behavior

  • Invalidators: bitmap invalidation

Did you find what you need?