Skip to Content
HyperQuote is live on HyperEVM — Start trading →
API ReferenceBenchmark Endpoints

Benchmark Endpoints

The benchmark API provides venue pricing data for comparing RFQ execution against alternative DEX routes. These endpoints proxy external aggregator APIs and persist baseline data for price improvement calculations.

HT.xyz DEX Price

GET /api/v1/bench/ht/price

Server-side proxy to the HT.xyz DEX aggregator. Returns the best available output amount for a given swap on HyperEVM DEXes. This endpoint is informational only — no transaction data is returned.

Query Parameters

ParameterTypeRequiredDescription
sellTokenstringYesInput token ERC-20 address (0x + 40 hex)
buyTokenstringYesOutput token ERC-20 address (0x + 40 hex)
sellAmountstringYesInput amount in raw token units (BigInt string)

Example Request

curl "https://hyperquote.xyz/api/v1/bench/ht/price?\ sellToken=0xb88339cb...&\ buyToken=0x55555555...&\ sellAmount=1000000000"

Response (200 OK)

{ "source": "ht.xyz", "outputAmount": "49523000000000000000", "route": [ { "dex": "kittenswap", "portion": 100, "poolAddress": "0xPoolAddr...", "fee": 3000 } ], "computeTimeMs": 450, "error": null }

Response Fields

FieldTypeDescription
sourcestringAlways "ht.xyz"
outputAmountstring or nullBest output amount in raw token units, or null on error
routearrayRoute breakdown with DEX name, portion, pool address, and fee
computeTimeMsnumberTotal time including upstream API call
errorstring or nullError message if the upstream call failed, or null on success

This endpoint returns HTTP 200 even when the upstream HT.xyz API fails. Check the error field to determine if the quote is valid. Only input validation failures (missing params, invalid addresses) return 400.

Error Responses

StatusCondition
400Missing required query params
400Invalid address format
400Invalid sellAmount (not a valid BigInt)

RFQ Baseline

POST /api/v1/rfq/baseline

Persists the AMM baseline captured at RFQ submission time. The frontend sends the SOR quote data that was displayed to the user when they submitted the RFQ. This avoids re-fetching and ensures the baseline reflects what the user actually saw.

Request Body

FieldTypeRequiredDescription
rfqIdstringYesClient-generated RFQ ID
tokenInstringYesInput token address
tokenOutstringYesOutput token address
amountInstringYesInput amount (BigInt string)
baselineAmountOutstringYesSOR output amount (BigInt string)
baselineEffectivePricenumberYesEffective price from SOR summary
baselinePriceImpactBpsnumberYesPrice impact in basis points
baselineBlockNumberstringYesBlock number from SOR meta.asOfBlock
baselineTimestampstringYesISO timestamp from SOR meta.timestamp
baselineRouteSummaryarrayNoArray of { protocol, poolType, fractionPct }

Example Request

await fetch("https://hyperquote.xyz/api/v1/rfq/baseline", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ rfqId: "f47ac10b-58cc-4372-a567-0e02b2c3d479", tokenIn: "0xb88339cb...", tokenOut: "0x55555555...", amountIn: "1000000000", baselineAmountOut: "49523000000000000000", baselineEffectivePrice: 49.523, baselinePriceImpactBps: 12, baselineBlockNumber: "1234567", baselineTimestamp: "2026-03-10T16:00:00.000Z", baselineRouteSummary: [ { protocol: "kittenswap", poolType: "v2", fractionPct: "100" } ], }), });

Response (200 OK)

{ "success": true, "id": "clx9base123..." }

This endpoint is idempotent — calling it multiple times for the same rfqId will upsert (update the existing record).

RFQ Performance

GET /api/v1/rfq/performance

Computes the performance of a specific RFQ fill relative to the AMM baseline.

Query Parameters

ParameterTypeRequiredDescription
rfqIdstringYesThe RFQ to analyze

Example Request

curl "https://hyperquote.xyz/api/v1/rfq/performance?rfqId=f47ac10b-58cc-4372-a567-0e02b2c3d479"

Response (200 OK)

{ "rfqId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "improvementBps": 150, "rfqAmountOut": "50000000000000000000", "baselineAmountOut": "49523000000000000000", "baselineSource": "ht.xyz", "computedAt": "2026-03-10T16:01:00.000Z" }
StatusError
400Missing rfqId parameter
404No baseline or fill found for this RFQ

RFQ Performance Summary

GET /api/v1/rfq/performance-summary

Returns aggregate RFQ performance metrics over a time window.

Query Parameters

ParameterTypeDefaultDescription
windowstring"7d"Time window: "24h", "7d", "30d"
tokenInstringFilter by input token address
tokenOutstringFilter by output token address

Example Request

curl "https://hyperquote.xyz/api/v1/rfq/performance-summary?window=7d"

Response (200 OK)

{ "window": "7d", "totalFills": 142, "avgImprovementBps": 85, "medianImprovementBps": 72, "totalVolumeUsd": 2450000.0, "pctBetterThanBaseline": 89.4 }
StatusError
400Invalid window value (must be 24h, 7d, or 30d)

How Benchmarking Works

The benchmark pipeline operates in three stages:

  1. At RFQ creation — The UI runs a SOR quote and calls POST /api/v1/rfq/baseline to persist the AMM output amount
  2. At fill recording — The fill endpoint (POST /api/v1/fills) looks up the stored baseline and computes improvement in basis points
  3. At query time — The performance endpoints return the computed improvement for display in the venue comparison UI
improvementBps = ((rfqAmountOut / baselineAmountOut) - 1) * 10000

A positive improvementBps means the RFQ execution gave the taker more output tokens than the best available DEX route.

Last updated on