# Quotes

DEX price quotes — no wallet or vault context required

## Get DEX swap quote

> Returns the best swap quote aggregated across 150+ liquidity sources via 0x (default) or routed through Uniswap V2/V3/V4. No vault or wallet context required — any agent can call this endpoint.\
> \
> \*\*Price:\*\* $0.002 USDC per request (paid via x402)

```json
{"openapi":"3.1.0","info":{"title":"RigoBlock Agent Trader API","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`\n2. Submit USDC payment on Base (chain 8453) via `api.cdp.coinbase.com`\n3. Retry the request with this header set to the payment receipt\n\nSee 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 the best swap quote aggregated across 150+ liquidity sources via 0x (default) or routed through Uniswap V2/V3/V4. No vault or wallet context required — any agent can call this endpoint.\n\n**Price:** $0.002 USDC per request (paid via x402)","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"}}}}}}}}}
```
