This document describes the /simulate request and response shape.
- Quote request: one
POST /simulatecall with one sell token, one buy token, and an ordered list of input amounts. - Requested amounts: the ordered
amounts[]in the request and the matchingamounts_out[]positions in each pool response. - Usable quote: a pool entry in
data[]that returned at least one positive output for the requested amounts. - Partial result: a quote response that returned usable data, but with partial requested-amount coverage or incomplete pool coverage.
- Usable result: a response with
meta.status = "ready"andmeta.result_quality = "complete"or"partial".
- POST a quote request to
/simulate. - Inspect
meta.status,meta.result_quality,meta.partial_kind,meta.failures, andmeta.pool_results. - Keep only responses with usable quotes when selecting pools for execution or route building.
- If you need calldata, feed selected pools into
/encode, which re-simulates the route internally.
{
"request_id": "req-123",
"auction_id": "auction-42",
"token_in": "0x6b175474e89094c44da98b954eedeac495271d0f",
"token_out": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"amounts": ["1000000000000000000", "5000000000000000000"]
}{
"request_id": "req-123",
"data": [
{
"pool": "uniswapv3-1",
"pool_name": "UniswapV3::DAI/USDC",
"pool_address": "0x1111111111111111111111111111111111111111",
"amounts_out": ["999000000", "4985000000"],
"gas_used": [210000, 210000],
"block_number": 19876543
}
],
"meta": {
"status": "ready",
"result_quality": "complete",
"block_number": 19876543,
"vm_block_number": 19876540,
"rfq_update_timestamp": 1710000000,
"matching_pools": 4,
"candidate_pools": 4,
"total_pools": 412,
"auction_id": "auction-42"
}
}{
"request_id": "req-124",
"data": [
{
"pool": "uniswapv3-2",
"pool_name": "UniswapV3::DAI/USDC",
"pool_address": "0x2222222222222222222222222222222222222222",
"amounts_out": ["0", "215000000", "980000000"],
"gas_used": [0, 210000, 220000],
"block_number": 19876543
}
],
"meta": {
"status": "ready",
"result_quality": "partial",
"partial_kind": "amount_ladders",
"block_number": 19876543
}
}In this example, the smallest requested amount failed for that pool, so amounts_out[0] is "0". The later requested amounts are still usable, and the row stays in data[] because the pool still produced positive outputs for later amount positions. If every entry were "0", the row would be filtered out of data[] and reported only through meta.failures and meta.pool_results.
auction_idis optional in the request. When present, it is echoed back asmeta.auction_id./simulateuses200 OKfor contract-valid complete, partial, no-result, and selected degraded outcomes. Clients must inspectmeta, not just the HTTP status.- For partial results,
amounts_outstays aligned with the requestamounts[]. Failed or timed-out requested amounts are returned in place as"0", and the matchinggas_usedentries are0. amounts_out[i] = "0"means that requested amount did not produce a usable quote for that pool. It is not a real output amount.data[]contains only pools with at least one positive output across the requested amounts. Pools whose entireamounts_outrow is"0"stay out ofdata[]and remain visible throughmeta.failuresandmeta.pool_results.data[]row order is deterministic, but it is not a best-to-worst ranking. Consumers should rely on requested-amount alignment within each row and choose pools explicitly rather than inferring semantics fromdata[0].block_numberis the native stream block.vm_block_numberis present when VM pool support is enabled and VM state has a current block.rfq_update_timestampis present when RFQ pool support is enabled and RFQ state is ready; it carries the current RFQ update timestamp/cursor, not a chain block.
- treat each row as one pool's quotes across the requested amounts
- match the amount position you care about to the same index in the request
amounts[] - only treat positive values in that slot as usable quotes
- treat
"0"as "no usable quote for that requested amount," not a real output - treat rows whose whole
amounts_outarray is"0"as failed rows; they should not survive indata[] - do not infer pool quality from row position;
data[]order is stable output, not ranking
meta.status = "ready"andmeta.result_quality = "complete"or"partial"means the response is usable for quotingmeta.result_quality = "request_level_failure"or"no_results"means it is not usable for quoting- a usable response can still contain degraded rows where some amount positions are
"0" - a usable response should not contain a row whose entire
amounts_outarray is"0"
status = "ready"withresult_quality = "complete"means usable quotes were returned without request-visible degradation.status = "ready"withresult_quality = "partial"means usable quotes were returned, but the result is degraded.status = "no_liquidity"withresult_quality = "no_results"means no usable quote survived because liquidity was absent or exhausted.result_quality = "request_level_failure"means the request ended in a degraded state that should not be used as a quote source, even if the response shape is valid.partial_kindappears only whenresult_quality = "partial". It isamount_ladders,pool_coverage, ormixed.vm_unavailable = truemeans VM pools were skipped because VM state was not ready. If native pools still produced usable quotes, the response can still be usable for quoting.
meta.failuresis the request-level explanation layer. It includes timeouts, token coverage failures, no-pools reasons, and other failures that matter to the overall request outcome.meta.pool_resultsis the per-pool anomaly layer. It includes degraded pool-local outcomes such aspartial_output,zero_output,timed_out,simulator_error, andinternal_error.- A partial ready response can include both usable data in
data[]and request-visible issues inmeta.failuresormeta.pool_results.
- Request-guard timeouts return
200 OKwith a valid quote payload whosemeta.status = "ready",meta.result_quality = "request_level_failure", andmeta.failuresincludes atimeout. - Router-boundary timeouts for
/simulatealso return200 OKwithresult_quality = "request_level_failure". - Timeout responses are structurally valid, but they are not usable for quoting.