# 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.002 USDC payment.\
> \
> \*\*Price:\*\* $0.002 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.002 USDC payment.\n\n**Price:** $0.002 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"}}}}}}}}}
```


---

# Agent Instructions: 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.
