Skip to content

🧩 LiquidMesh RFQ Mode — Overview and Integration Guide

1. Introduction

LiquidMesh introduces RFQ (Request-for-Quote) mode to enhance pricing and execution quality for large or complex trades.
RFQ allows wallet partners and aggregators to request firm quotes from integrated market makers (MMs) or RFQ DEXs before constructing a swap transaction.

When enabled, the LiquidMesh backend automatically routes eligible trades through RFQ-capable sources alongside existing AMM liquidity, ensuring best price, low slippage, and fast settlement.


2. How RFQ Mode Works

2.1. Standard Flow

  1. Wallet calls /quote API with includeRfq=true (default).
  2. LiquidMesh queries its connected RFQ venues and internal market makers.
  3. Responses are merged with on-chain AMM routes to produce a unified path.
  4. Each “rfq” hop in the path contains extraInfo detailing quote parameters.
  5. The wallet displays the route and proceeds with /swap when the user confirms.
  6. If the route includes an RFQ, the swap transaction must be submitted before its expiry time.

3. API Changes

3.1 /quote API

Request

Parameter Type Default Description
includeRfq boolean true Enables RFQ integration. If false, only on-chain AMM/aggregator sources are used.

Example:

curl --location 'http://api.liquidmesh.io/v1/quote?inputToken=0x514910771af9ca656af840dff83e8264ecf986ca&outputToken=0xdac17f958d2ee523a2206206994597c13d831ec7&amount=1000000000000&includeRfq=true'

Response (RFQ-enhanced)

If RFQ is active, every rfq hop within the path will include an additional extraInfo field containing detailed quote information.

Example snippet:

"extraInfo": "{\"feeRate\":0,\"amountIn\":\"1000000000000\",\"amountOut\":\"18\",\"tokenDecimalIn\":18,\"tokenDecimalOut\":6}"

Field Description
feeRate RFQ fee rate applied by the liquidity provider
amountIn Input token amount used in RFQ (raw integer form)
amountOut Output token amount quoted (raw integer form)
tokenDecimalIn Decimal precision of input token
tokenDecimalOut Decimal precision of output token

3.2 /swap API

Response Enhancements

Field Type Description
expiry_timestamp number (Unix) Only present if the swap involves an RFQ source. Indicates the latest timestamp by which the transaction must be broadcast to remain valid.

Client Recommendation:
Wallets should display this timestamp to users (e.g., “Please sign and send before 14:32:05 UTC”) to ensure the RFQ quote remains valid on-chain.


4. Error Handling

4.1 RFQ-specific Error Types

Error Code Description Recommended Client Action
rfq_rate_limit RFQ source temporarily unavailable or throttled Re-fetch quote until returned route no longer includes that RFQ DEX (indicates automatic delisting).
rfq_xx_error General RFQ error (network, quote rejection, or expired quote) Retry /quote call; ensure expiry_timestamp not exceeded.

5. Example Integration Flow

sequenceDiagram
  participant Wallet
  participant LiquidMesh
  participant RFQ_MarketMaker
  participant AMM_Dex

  Wallet->>LiquidMesh: GET /v1/quote?includeRfq=true
  LiquidMesh->>RFQ_MarketMaker: RFQ Request (firm quote)
  RFQ_MarketMaker-->>LiquidMesh: Quote(amountIn, amountOut, expiry)
  LiquidMesh->>AMM_Dex: On-chain quote (if needed)
  LiquidMesh-->>Wallet: Aggregated route with RFQ + AMM paths
  Wallet->>LiquidMesh: POST /v1/swap
  LiquidMesh-->>Wallet: tx data + expiry_timestamp
  Wallet->>Chain: Broadcast before expiry_timestamp

6. Developer Notes

  • RFQ quotes are time-sensitive; execution after expiry will fail.
  • Wallets should cache quotes per user session and re-request on timeout or rfq_rate_limit.
  • The extraInfo field may evolve with more parameters (e.g. liquidity source ID, MM address).
  • To disable RFQ globally, set includeRfq=false in /quote requests.
  • The API remains backward-compatible for non-RFQ use cases.

7. Summary

Feature Description
RFQ Support Request firm off-chain quotes alongside on-chain AMM liquidity
API Backward Compatibility Default on, easily disabled via includeRfq
Precision Metadata Adds amountIn, amountOut, token decimals
Time-sensitive Execution Enforced via expiry_timestamp in /swap response
Resilient Error Handling Dedicated RFQ error codes and recovery guidance

✅ Benefits for Integrators

  • Access better pricing for large-size swaps.
  • Reduced slippage and improved execution certainty.
  • No additional integration complexity — same endpoints, extended data model.

Version: LiquidMesh RFQ Integration v1.0
Date: 2025-10-22
Maintainer: LiquidMesh Core Team
Contact: dev@liquidmesh.io