> For the complete documentation index, see [llms.txt](https://docs.rigoblock.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rigoblock.com/quotes.md).

# Quotes

DEX price quotes — no wallet or vault context required

## Get DEX swap quote

> Returns a swap quote sourced from Uniswap liquidity for a given token pair and amount on any of the 7 supported chains. No vault, wallet, or operator context required — any agent can call this endpoint with a $0.0020 USDC payment.\
> \
> \*\*Price:\*\* $0.0020 USDC per request (x402, eip155:8453)\
> \
> \*\*Typical use:\*\* Price discovery, trade sizing, yield comparison, arbitrage detection.\
> \
> \*\*Example:\*\* \`GET /api/quote?sell=ETH\&buy=USDC\&amount=1\&chain=base\`

```json
{"openapi":"3.1.0","info":{"title":"Rigoblock","version":"1.0.0"},"tags":[{"name":"Quotes","description":"DEX price quotes — no wallet or vault context required"}],"servers":[{"url":"https://trader.rigoblock.com","description":"Production"}],"security":[{"x402":[]}],"components":{"securitySchemes":{"x402":{"type":"apiKey","in":"header","name":"X-Payment","description":"x402 payment header. Flow:\n1. Make the request without this header → receive `402 Payment Required` and, for protected routes, a `PAYMENT-REQUIRED` header describing accepted payment requirements\n2. Create the x402 payment payload for USDC on Base (chain 8453), typically via `@x402/core` and the CDP facilitator at `api.cdp.coinbase.com`\n3. Retry the request with this header set to the encoded payment payload\n\nSuccessful 2xx responses may include a `PAYMENT-RESPONSE` settlement receipt. See https://github.com/rigoblock/agentic-operator/blob/main/AGENTS.md for full integration."}},"schemas":{"QuoteResponse":{"type":"object","description":"Best swap quote across 150+ liquidity sources (0x default) or Uniswap V2/V3/V4","properties":{"sellToken":{"type":"string","description":"Address of the token being sold"},"buyToken":{"type":"string","description":"Address of the token being bought"},"sellAmount":{"type":"string","description":"Sell amount in token base units (wei)"},"buyAmount":{"type":"string","description":"Buy amount in token base units"},"price":{"type":"string","description":"Exchange rate (buy per sell)"},"source":{"type":"string","description":"DEX source routing the quote"},"chain":{"type":"string","description":"Chain the quote is valid on"},"calldata":{"type":"string","description":"Encoded calldata for on-chain execution"},"to":{"type":"string","description":"Contract address to send the swap transaction to"},"value":{"type":"string","description":"ETH value to attach (for native token swaps)"},"gasEstimate":{"type":"string","description":"Estimated gas units for the transaction"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}},"X402PaymentRequired":{"type":"object","description":"Standard x402 payment challenge","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"accepts":{"type":"array","items":{"type":"object","properties":{"scheme":{"type":"string"},"network":{"type":"string"},"maxAmountRequired":{"type":"string"},"resource":{"type":"string"},"description":{"type":"string"},"mimeType":{"type":"string"},"payTo":{"type":"string","description":"USDC recipient address on Base"},"maxTimeoutSeconds":{"type":"integer"},"asset":{"type":"string","description":"USDC contract address on Base"},"extra":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"}}}}}}}}}},"paths":{"/api/quote":{"get":{"operationId":"getDexQuote","summary":"Get DEX swap quote","description":"Returns a swap quote sourced from Uniswap liquidity for a given token pair and amount on any of the 7 supported chains. No vault, wallet, or operator context required — any agent can call this endpoint with a $0.0020 USDC payment.\n\n**Price:** $0.0020 USDC per request (x402, eip155:8453)\n\n**Typical use:** Price discovery, trade sizing, yield comparison, arbitrage detection.\n\n**Example:** `GET /api/quote?sell=ETH&buy=USDC&amount=1&chain=base`","tags":["Quotes"],"parameters":[{"name":"sell","in":"query","required":true,"description":"Token to sell — ticker symbol (e.g. `ETH`) or ERC-20 contract address.","schema":{"type":"string"}},{"name":"buy","in":"query","required":true,"description":"Token to buy — ticker symbol (e.g. `USDC`) or ERC-20 contract address.","schema":{"type":"string"}},{"name":"amount","in":"query","required":true,"description":"Human-readable amount of the sell token (e.g. `1` for 1 ETH).","schema":{"type":"string"}},{"name":"chain","in":"query","required":false,"description":"Target chain. Accepts chain name or chain ID.","schema":{"type":"string","default":"base","enum":["base","arbitrum","ethereum","optimism","polygon","bsc","unichain"]}}],"responses":{"200":{"description":"Successful quote response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteResponse"}}}},"400":{"description":"Bad request — missing or invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Payment required (x402). Pay in USDC on Base and retry with `X-Payment` header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402PaymentRequired"}}}}}}}}}
```

## Uniswap Trading API quote with oracle enrichment

> Proxies to the Uniswap Trading API \`/quote\` endpoint and enriches the response with on-chain BackgeoOracle spot-price metadata. Returns the upstream response verbatim plus \`priceFeedExists\`, \`deltaBps\`, and \`oracleAmount\`.\
> \
> \*\*Price:\*\* $0.0021 USDC per request (x402 exact scheme, eip155:8453)\
> \
> \*\*Request body:\*\* Identical to the Uniswap Trading API \`/quote\` endpoint. All request body fields are forwarded verbatim to Uniswap.

```json
{"openapi":"3.1.0","info":{"title":"Rigoblock","version":"1.0.0"},"tags":[{"name":"Quotes","description":"DEX price quotes — no wallet or vault context required"}],"servers":[{"url":"https://trader.rigoblock.com","description":"Production"}],"security":[{"x402":[]}],"components":{"securitySchemes":{"x402":{"type":"apiKey","in":"header","name":"X-Payment","description":"x402 payment header. Flow:\n1. Make the request without this header → receive `402 Payment Required` and, for protected routes, a `PAYMENT-REQUIRED` header describing accepted payment requirements\n2. Create the x402 payment payload for USDC on Base (chain 8453), typically via `@x402/core` and the CDP facilitator at `api.cdp.coinbase.com`\n3. Retry the request with this header set to the encoded payment payload\n\nSuccessful 2xx responses may include a `PAYMENT-RESPONSE` settlement receipt. See https://github.com/rigoblock/agentic-operator/blob/main/AGENTS.md for full integration."}},"schemas":{"OracleEnrichment":{"type":"object","description":"On-chain oracle spot-price metadata appended to DEX API responses","properties":{"priceFeedExists":{"type":"boolean","description":"Whether both tokens have an active BackgeoOracle price feed"},"deltaBps":{"type":"integer","description":"Divergence between DEX expected output and oracle spot price, in basis points. Positive = DEX gives less than oracle. Negative = DEX gives more."},"oracleAmount":{"type":"string","description":"Expected output amount from oracle spot price, in base units (wei/smallest token unit)"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}},"X402PaymentRequired":{"type":"object","description":"Standard x402 payment challenge","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"accepts":{"type":"array","items":{"type":"object","properties":{"scheme":{"type":"string"},"network":{"type":"string"},"maxAmountRequired":{"type":"string"},"resource":{"type":"string"},"description":{"type":"string"},"mimeType":{"type":"string"},"payTo":{"type":"string","description":"USDC recipient address on Base"},"maxTimeoutSeconds":{"type":"integer"},"asset":{"type":"string","description":"USDC contract address on Base"},"extra":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"}}}}}}}}}},"paths":{"/api/quote/uniswap":{"post":{"operationId":"getUniswapQuote","summary":"Uniswap Trading API quote with oracle enrichment","description":"Proxies to the Uniswap Trading API `/quote` endpoint and enriches the response with on-chain BackgeoOracle spot-price metadata. Returns the upstream response verbatim plus `priceFeedExists`, `deltaBps`, and `oracleAmount`.\n\n**Price:** $0.0021 USDC per request (x402 exact scheme, eip155:8453)\n\n**Request body:** Identical to the Uniswap Trading API `/quote` endpoint. All request body fields are forwarded verbatim to Uniswap.","tags":["Quotes"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type","amount","tokenIn","tokenOut","tokenInChainId","tokenOutChainId"],"properties":{"type":{"type":"string","description":"Quote type: EXACT_INPUT or EXACT_OUTPUT"},"amount":{"type":"string","description":"Amount in base units"},"tokenIn":{"type":"string","description":"Token to sell (address or symbol). Use 0x0000...0000 for native ETH."},"tokenOut":{"type":"string","description":"Token to buy (address or symbol)"},"tokenInChainId":{"type":"integer","description":"Chain ID for input token"},"tokenOutChainId":{"type":"integer","description":"Chain ID for output token"},"swapper":{"type":"string","description":"Address of the swapper (vault address)"},"slippageTolerance":{"type":"number","description":"Maximum slippage tolerance in percent"},"routingPreference":{"type":"string","description":"Routing preference: CLASSIC, BEST_PRICE, FASTEST, or BEST_PRICE_V2"},"protocols":{"type":"array","items":{"type":"string"},"description":"List of protocols to include (e.g. V2, V3)"}}}}}},"responses":{"200":{"description":"Successful quote with oracle enrichment","content":{"application/json":{"schema":{"allOf":[{"type":"object","description":"Uniswap Trading API quote response"},{"$ref":"#/components/schemas/OracleEnrichment"}]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized — x402 payment or browser session required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Payment required (x402)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402PaymentRequired"}}}}}}}}}
```

## 0x API quote with oracle enrichment

> Proxies to the 0x API v2 \`/swap/allowance-holder/quote\` endpoint and enriches the response with on-chain BackgeoOracle spot-price metadata. Returns the upstream response verbatim plus \`priceFeedExists\`, \`deltaBps\`, and \`oracleAmount\`.\
> \
> \*\*Price:\*\* $0.0022 USDC per request (x402 exact scheme, eip155:8453)\
> \
> \*\*Query parameters:\*\* Identical to the 0x API. All query parameters are forwarded verbatim to 0x.

```json
{"openapi":"3.1.0","info":{"title":"Rigoblock","version":"1.0.0"},"tags":[{"name":"Quotes","description":"DEX price quotes — no wallet or vault context required"}],"servers":[{"url":"https://trader.rigoblock.com","description":"Production"}],"security":[{"x402":[]}],"components":{"securitySchemes":{"x402":{"type":"apiKey","in":"header","name":"X-Payment","description":"x402 payment header. Flow:\n1. Make the request without this header → receive `402 Payment Required` and, for protected routes, a `PAYMENT-REQUIRED` header describing accepted payment requirements\n2. Create the x402 payment payload for USDC on Base (chain 8453), typically via `@x402/core` and the CDP facilitator at `api.cdp.coinbase.com`\n3. Retry the request with this header set to the encoded payment payload\n\nSuccessful 2xx responses may include a `PAYMENT-RESPONSE` settlement receipt. See https://github.com/rigoblock/agentic-operator/blob/main/AGENTS.md for full integration."}},"schemas":{"OracleEnrichment":{"type":"object","description":"On-chain oracle spot-price metadata appended to DEX API responses","properties":{"priceFeedExists":{"type":"boolean","description":"Whether both tokens have an active BackgeoOracle price feed"},"deltaBps":{"type":"integer","description":"Divergence between DEX expected output and oracle spot price, in basis points. Positive = DEX gives less than oracle. Negative = DEX gives more."},"oracleAmount":{"type":"string","description":"Expected output amount from oracle spot price, in base units (wei/smallest token unit)"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}},"X402PaymentRequired":{"type":"object","description":"Standard x402 payment challenge","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"accepts":{"type":"array","items":{"type":"object","properties":{"scheme":{"type":"string"},"network":{"type":"string"},"maxAmountRequired":{"type":"string"},"resource":{"type":"string"},"description":{"type":"string"},"mimeType":{"type":"string"},"payTo":{"type":"string","description":"USDC recipient address on Base"},"maxTimeoutSeconds":{"type":"integer"},"asset":{"type":"string","description":"USDC contract address on Base"},"extra":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"}}}}}}}}}},"paths":{"/api/quote/0x":{"get":{"operationId":"get0xQuote","summary":"0x API quote with oracle enrichment","description":"Proxies to the 0x API v2 `/swap/allowance-holder/quote` endpoint and enriches the response with on-chain BackgeoOracle spot-price metadata. Returns the upstream response verbatim plus `priceFeedExists`, `deltaBps`, and `oracleAmount`.\n\n**Price:** $0.0022 USDC per request (x402 exact scheme, eip155:8453)\n\n**Query parameters:** Identical to the 0x API. All query parameters are forwarded verbatim to 0x.","tags":["Quotes"],"parameters":[{"name":"chainId","in":"query","required":true,"description":"Chain ID","schema":{"type":"integer"}},{"name":"sellToken","in":"query","required":true,"description":"Token to sell (address or symbol)","schema":{"type":"string"}},{"name":"buyToken","in":"query","required":true,"description":"Token to buy (address or symbol)","schema":{"type":"string"}},{"name":"sellAmount","in":"query","required":true,"description":"Amount to sell in base units","schema":{"type":"string"}},{"name":"taker","in":"query","required":false,"description":"Address of the taker (vault address)","schema":{"type":"string"}},{"name":"slippageBps","in":"query","required":false,"description":"Maximum slippage tolerance in basis points (100 = 1%)","schema":{"type":"integer"}}],"responses":{"200":{"description":"Successful quote with oracle enrichment","content":{"application/json":{"schema":{"allOf":[{"type":"object","description":"0x API quote response"},{"$ref":"#/components/schemas/OracleEnrichment"}]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized — x402 payment or browser session required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Payment required (x402)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402PaymentRequired"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rigoblock.com/quotes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
