Skip to article content 0xprotocol

0xprotocol RFQ: Signed Quotes and Onchain Fill Conditions

Updated on

0xprotocol RFQ connects signed market-maker quotes with onchain ERC-20 trades, whose Exchange V4 fills require valid authorization and compliance with the order's conditions. RFQ means request for quote. Market makers can respond during swap quotation with offers specifying token amounts and expiry. An eligible taker accepts those terms by submitting a fill, subject to the required balances, allowances and participant restrictions. Signing or receiving a quote alone completes no exchange. Native Exchange V4 RFQ orders settle through the Exchange Proxy. Swap API v2 uses a different approval architecture, even when a quote includes market-maker liquidity.

Signed token amounts and the exchange price

An Exchange V4 RFQ order fixes the exchange relationship through makerAmount and takerAmount , the quantities of the two ERC-20 tokens named in the order. The maker offers makerToken ; the taker supplies takerToken in return. The amounts define the price a native RFQ fill uses. The maker's signature authorizes those terms without reserving the tokens. Balances and allowances must support the transfer when a taker attempts execution.


Taker restrictions and transaction origins

Exchange V4 native RFQ orders distinguish the taker supplying tokens from the externally owned account originating the transaction, so matching one identity need not satisfy both checks. The taker field can restrict execution to a particular taker. A zero address allows any taker, subject to the remaining conditions. The txOrigin field identifies an allowed originating account. The origin restriction also supports accounts authorized through registerAllowedRfqOrigins() . A smart contract acting as taker therefore does not make its own address the transaction's originating account.

Illustration: 0xprotocol RFQ - Taker restrictions and transaction origins

Open full-size image

A direct native fill treats the caller as the taker. With a supported Exchange Proxy meta-transaction, the signer supplies the taker identity while another account submits the transaction. RFQ orders omit the separate sender field native limit orders contain. The meta-transaction has its own optional sender restriction, which can constrain the relayer independently of the RFQ order.


Market-maker quotes within aggregated liquidity

Market makers receive quote requests during Swap API aggregation and choose whether to return signed offers for the requested trade. The aggregator also queries liquidity from automated market makers (AMMs), then compares available routes with gas and fees included. An API quote request therefore does not guarantee RFQ liquidity or an RFQ-only route. A Swap API quote can combine sources, so its route composition determines which execution properties apply.

Can a native RFQ order fill for less than the requested amount?

A native Exchange V4 RFQ order can fill below the requested amount through fillRfqOrder() , which permits an up-to fill. The function returns the actual taker-token and maker-token fill amounts.

Requested size and exactness

Up-to fills

The takerTokenFillAmount parameter measures the requested fill in taker-token base units. An up-to fill can leave the caller with a smaller exchange than requested. A partial fill also leaves an unfilled remainder when the order has additional available size. That remainder retains the original price and expiry conditions.

Graphic: 0xprotocol RFQ: Up-to fills

Open full-size image

Fill-or-kill fills

Exchange V4's fillOrKillRfqOrder() reverts if it cannot fill the entire requested taker-token amount. The requirement concerns that request, so successful execution need not consume the entire signed order.

State changes before execution

Expiry, cancellation and prior fills can prevent a native RFQ order from executing. Insufficient maker or taker balances or allowances can also cause a revert. An invalid signature or a failed participant restriction blocks settlement as well. These checks apply when the contract processes the fill; an earlier quote cannot freeze them.

The expiry field stores a Unix timestamp in seconds. Its value sets an absolute boundary for that offer. Different offers can carry different expiry timestamps.


Approvals matched to native fills and API v2 swaps

Native Exchange V4 RFQ fills use Exchange Proxy allowances for both parties, while Swap API v2 directs approvals through AllowanceHolder or Permit2 according to its integration path. An approval for one architecture does not establish the allowance another contract needs. The token owner, spender and execution path must correspond to the intended trade.

AllowanceHolder acts as both the spender and entry point for its API v2 path. Permit2 handles token allowance on the Permit2 path, where 0x Settler executes the swap. Swap API v2 does not require or support token allowances directly on 0x Settler. Granting such an allowance can expose tokens to misuse.

Conditions before authorizing a fill

  • Confirm both balances and Exchange Proxy allowances cover the intended native V4 fill.
  • If an API v2 response reports an allowance shortfall, read issues.allowance.spender or allowanceTarget for the spender.
  • Send API v2 swap transactions to the destination address in the returned transaction data; Settler entry point addresses can change between deployments.
  • Match the taker and originating account to the RFQ order's applicable restrictions.
  • Use fill-or-kill behavior when the native fill must consume the full requested taker-token amount.
Conditions before authorizing a fill (0xprotocol RFQ)

Open full-size image

RFQ price terms and AMM execution exposure

Private RFQ execution protects RFQ orders against sandwiching and front-running, while AMM trades through public mempools remain exposed to those forms of MEV. MEV means maximal extractable value, which can arise from transaction ordering. The protection applies to the RFQ component of a route. A signed price also leaves execution subject to expiry, available balances and the order's restrictions.

Native RFQ and native limit orders both carry maker-authorized token amounts. Their additional fields differ: native limit orders can include a taker-token fee and a separate sender restriction. RFQ omits those fields and adds the required transaction-origin constraint.

A standing limit order supports later discovery. RFQ supplies a market-maker offer during swap quotation, with execution bounded by its signed conditions.

0xprotocol RFQ FAQ

Does an RFQ swap avoid all trading fees?

A native RFQ order's lack of a taker-fee field does not make an API-routed RFQ swap free of all costs. Exchange V3 and V4 removed protocol fees on September 29, 2021. Network gas and applicable API or integrator fees remain separate. Swap API can return a zeroExFee for select tokens under its Standard tier.

Which event identifies a native Exchange V4 RFQ fill?

A successful native Exchange V4 RFQ fill emits RfqOrderFilled from the Exchange Proxy. The event records the order hash, maker and taker addresses, token addresses and actual filled amounts. LimitOrderFilled belongs to native limit-order fills. Use the event matching the executed order format when interpreting transaction logs.

Can the same Exchange Proxy meta-transaction authorization execute twice?

A signed native Exchange V4 meta-transaction can execute only once. Its authorization concerns a particular call, with its own expiry and gas-price limits. A partial RFQ fill can leave an unfilled order amount. That does not make the already executed meta-transaction reusable.

How can a maker cancel a native RFQ order before its expiry?

A maker can invalidate a native Exchange V4 RFQ order onchain through cancelRfqOrder(). The batchCancelRfqOrders() function handles several specified orders. Cancellation prevents subsequent fills of the cancelled order; it does not reverse tokens already exchanged. The cancellation requires an onchain transaction even when the maker shared the original quote offchain.

What information accompanies a native RFQ order shared as JSON?

The Exchange V4 RFQ JSON representation includes chainId, verifyingContract and the signature alongside the order's trade fields. Those trade fields identify the maker, taker, token contracts, amounts, transaction origin, pool, expiry and salt. The signature representation contains signatureType, v, r and s; distributing token amounts alone omits required order context.