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

SOR Endpoints

The Smart Order Router (SOR) finds optimal swap routes across multiple DEX pool types deployed on HyperEVM. It evaluates routes, splits across pools, and returns explainable quotes with safety validation.

Get Quote

GET /api/v1/sor/quote

Main entry point for the SOR. Runs the full pipeline: route generation, evaluation, split optimization, and explainability.

Query Parameters

ParameterTypeRequiredDefaultDescription
tokenInstringYesInput token address
tokenOutstringYesOutput token address
amountInstringYesInput amount (BigInt string, raw units)
maxHopsnumberNo2Maximum hop count (1 or 2)
maxRoutesnumberNo5Maximum routes to return
maxSplitnumberNo4Maximum routes to split across
slugsstringNoComma-separated protocol slugs to limit to
explainstringNo"true"Set to "true" for full explainability

Example Request

curl "https://hyperquote.xyz/api/v1/sor/quote?\ tokenIn=0xb88339cb...&\ tokenOut=0x55555555...&\ amountIn=1000000000"

Response (200 OK)

{ "meta": { "timestamp": "2026-03-10T16:00:00.000Z", "asOfBlock": "1234567", "computeTimeMs": 85, "candidatesConsidered": 12, "viableRoutes": 5, "isSplit": false }, "summary": { "tokenIn": "0xb88339cb...", "tokenInSymbol": "USDC", "tokenOut": "0x55555555...", "tokenOutSymbol": "WHYPE", "amountIn": "1000000000", "amountOut": "49523000000000000000", "effectivePrice": 49.523, "priceImpactBps": 12 }, "routes": [ { "path": ["0xb88339cb...", "0x55555555..."], "pools": [ { "address": "0xPoolAddr...", "protocol": "kittenswap", "poolType": "v2", "fee": 3000 } ], "hops": 1, "amountIn": "1000000000", "amountOut": "49523000000000000000", "fractionPct": 100 } ], "alternatives": [ { "protocol": "hyperswap", "amountOut": "49100000000000000000", "diffBps": -85 } ], "warnings": [], "fees": [] }

Response Fields

SectionFieldDescription
metaasOfBlockBlock number at quote time
metacomputeTimeMsTotal computation time
metacandidatesConsideredNumber of route candidates evaluated
metaisSplitWhether the quote splits across multiple routes
summaryamountOutBest available output amount
summaryeffectivePriceEffective price (output / input, adjusted for decimals)
summarypriceImpactBpsEstimated price impact in basis points
routesfractionPctPercentage of input routed through this path
alternativesdiffBpsHow much worse this alternative is vs. the best route

If the SOR returns zero routes, the warnings array will contain guidance. A common issue is missing pool state data. Try calling POST /api/v1/sor/pool-state/refresh first.

Error Responses

StatusError
400Missing required params (tokenIn, tokenOut, amountIn)
400Invalid token address format
400tokenIn and tokenOut must be different
400amountIn must be a positive integer
404Token not found in the registry

List Pools

GET /api/v1/sor/pools

Returns available liquidity pools tracked by the SOR.

Scan Pools

POST /api/v1/sor/pools/scan

Triggers a scan for new liquidity pools on HyperEVM.

Pool State

GET /api/v1/sor/pool-state

Returns cached pool state data (reserves, tick data, etc.).

POST /api/v1/sor/pool-state/refresh

Refreshes pool state from on-chain data. Useful when quotes return zero routes due to stale state.

List Protocols

GET /api/v1/sor/protocols

Returns the list of DEX protocols registered with the SOR.

Response

{ "protocols": [ { "slug": "kittenswap", "name": "KittenSwap", "poolType": "v2", "factoryAddress": "0x..." }, { "slug": "hyperswap", "name": "HyperSwap", "poolType": "v3", "factoryAddress": "0x..." } ] }

POST /api/v1/sor/protocols/sync

Synchronizes protocol registry from the database.

Health Check

GET /api/v1/sor/health

Returns the SOR service health status and pool state summary.

Coverage Report

GET /api/v1/sor/coverage

Returns the SOR’s token pair coverage — which pairs have available routes and estimated liquidity.

Supported Protocols

ProtocolPool TypeDescription
Uniswap V2 forksConstant product (x*y=k)Standard AMM pools
Uniswap V3 forksConcentrated liquidityTick-based pools with price ranges
Stable poolsStable swapOptimized curves for like-kind assets

The SOR scans HyperEVM for deployed DEX factory contracts and maintains an in-memory pool state cache. Pool states are refreshed periodically. Use the meta.asOfBlock field to check quote freshness.

Last updated on