---
title: "Get a token swap quote"
method: GET
path: "/agents/quote"
tags: ["Swap"]
---

# Get a token swap quote

`GET /agents/quote`

## Request

- Base URL: `https://www.farmdash.one/api`
- URL: `https://www.farmdash.one/api/agents/quote`
- Auth: none declared

Provider-neutral market estimate by default: returns an explicitly
labelled `market_estimate` (reference price, approximate output,
server fee tier, route compatibility, freshness) WITHOUT calling 0x,
LI.FI, or Relay trading APIs. Browsing, polling, previews, and
wallet-supplied GETs all receive estimation — a `walletAddress` alone
is exploratory context, never execution intent, and never fans out
into provider APIs. The estimate is intelligence, not a provider
quote: no executable calldata, no provider attribution, no liquidity
confirmation, never `executionReady: true`.
For execution, POST `/v1/agent/quote-intent` with exact parameters, a
real wallet, and an idempotency key to receive a firm single-provider
quote bound to an `intentId`; then re-call this endpoint with the
identical parameters plus `intentId` to serve the stored firm quote
with zero new provider calls. Changed parameters never reuse a stale
quote (`intent_params_changed`); unknown/expired intents return
`intent_not_found`. One intent contacts exactly one primary provider;
a sequential alternate follows only a genuine primary failure.
0x quotes use the AllowanceHolder flow (standard approve + plain
transaction); FarmDash does not support Permit2 EIP-712 signatures.
`mock=true` is not supported and returns a typed 400 without contacting a provider.

## Query parameters

- `fromChainId` 1 | 10 | 137 | 8453 | 42161 | 59144, required
- `toChainId` 1 | 10 | 137 | 8453 | 42161 | 59144, required
- `fromToken` string, required
- `toToken` string, required
- `fromAmount` string, required
- `protocol` 'lifi' | 'relay'
- `mock` 'true'
- `walletAddress` string
- `toAddress` string
- `slippage` number
- `expectedUpsideUsd` number
- `riskBufferUsd` number
- `healthFactor` number
- `liquidationBufferPct` number
- `safetyMode` 'strict' | 'balanced'
- `intentId` string

## Headers

- `X-ClawHub-Skill` string

## Response `200`

Swap quote

- union
  - MarketEstimateResponse
    - `quoteKind` 'market_estimate', required
    - `continuation` ExecutionContinuation
      - `schema` 'farmdash.execution-continuation.v1', required
      - `continuation_id` string, uuid, required
      - `source` object, required
        - `type` 'market_estimate' | 'solana_preview' | 'futures_analysis', required
        - `ref` string, required
      - `execution_domain` 'spot' | 'solana' | 'futures', required
      - `network` string, required
      - `protocol_id` string, nullable, required
      - `assets` object[], required
        - `namespace` 'eip155' | 'solana' | 'hyperliquid', required
        - `network` string, required
        - `identifier` string, required
        - `symbol` string
        - `kind` 'native' | 'wrapped_native' | 'token' | 'market', required
        - `decimals` integer
      - `action_kind` 'swap' | 'prepare_order', required
      - `lifecycle_id` string, uuid, required
      - `trail_id` string, nullable, required
      - `next_operation` ExecutionContinuationNextOperation, required
        - `method` 'POST', required
        - `endpoint` '/api/v1/agent/quote-intent' | '/api/agents/solana-swap' | '/api/agents/futures/prepare-order' | '/api/v1/agent/futures/prepare-order', required
        - `parameters` object, required
        - `required_fields` string[], required
      - `available_execution_modes` string[], required
      - `authority` 'NOT_GRANTED', required
      - `prerequisites` string[], required
      - `scout_trial` object, required
        - `exists` true, required
        - `domain` 'spot' | 'futures', required
        - `daily_limit` integer, required
        - `remaining` unknown, required
        - `status` 'unknown' | 'evaluation_required', required
        - `after_exhaustion` 'authoritative_admission', required
      - `expires_at` string, date-time, required
    - `next_operation` ExecutionContinuationNextOperation
      - `method` 'POST', required
      - `endpoint` '/api/v1/agent/quote-intent' | '/api/agents/solana-swap' | '/api/agents/futures/prepare-order' | '/api/v1/agent/futures/prepare-order', required
      - `parameters` object, required
      - `required_fields` string[], required
    - `executionReady` false, required
    - `liquidityConfirmed` false, required
    - `providerAttribution` string, nullable
    - `referencePriceUsd` number, nullable
    - `estimatedInputUsd` number, nullable
    - `estimatedOutputUsd` number, nullable
    - `priceUnknown` boolean, required
    - `feeTierBps` integer, required
    - `volumeUnknown` boolean, required
    - `compatibleProviders` string[], required
    - `routeSupported` boolean, required
    - `liquidityUsd` number, nullable
    - `volume24hUsd` number, nullable
    - `sources` string[], required
    - `confidence` 'high' | 'medium' | 'low', required
    - `observedAt` string, required
    - `cached` boolean, required
    - `stale` boolean, required
    - `attempts` object[]
    - `warnings` string[]
    - `unsigned` true, required
    - `broadcast_by_farmdash` false, required
    - `simulation_required` boolean
    - `simulate_url` string
    - `execution_boundary` object, required
      - `state` string
      - `simulation_required` boolean
      - `local_signature_required` boolean
      - `farmdash_broadcasts_transaction` boolean
    - `note` string, required
  - FirmQuoteResponse
    - `intentId` string, required
    - `quoteKind` 'firm_quote', required
    - `reused` boolean, required
    - `marketBenchmark` object, nullable
    - `selectedProvider` 'lifi' | 'relay', required: Swap quote provider. Automatic routing compares all healthy compatible providers (LI.FI, Relay; 0x paused until reinstated); force one with ?protocol= (deterministic, never silent fallback).
    - `firmQuote` object, required
    - `expiresAt` string, required
    - `executionReady` boolean, required
    - `approval` object, nullable
    - `simulationRequirements` object, required
      - `required` boolean
      - `simulate_url` string
      - `intent_id` string: fd_intent_* execution-simulation identity. Pass this value to /v1/simulate.
      - `valid_for_execution` boolean
      - `plan` object, nullable
      - `signatures` unknown[], nullable
        - unknown
    - `attempts` object[], required
    - `alternateUsed` boolean, required
    - `unsigned` true, required
    - `broadcast_by_farmdash` false, required
    - `executionAlpha` ExecutionAlphaReport, required
      - `selectedProtocol` 'lifi' | 'relay': Swap quote provider. Automatic routing compares all healthy compatible providers (LI.FI, Relay; 0x paused until reinstated); force one with ?protocol= (deterministic, never silent fallback).
      - `routeReason` string
      - `mevProtection` object
        - `safetyMode` 'strict' | 'balanced'
        - `actualSlippageBps` integer
        - `maxRecommendedSlippageBps` integer
      - `candidates` RouteCandidate[]
        - `protocol` 'lifi' | 'relay': Swap quote provider. Automatic routing compares all healthy compatible providers (LI.FI, Relay; 0x paused until reinstated); force one with ?protocol= (deterministic, never silent fallback).
        - `estimatedOutput` string
        - `feeAmountUsd` number
        - `gasEstimateUsd` number, nullable
        - `bridgeFeeUsd` number, nullable
        - `routeRiskScore` number
        - `selected` boolean
      - `quoteDecay` QuoteDecayMetrics
        - `previousObservedAt` integer, nullable
        - `quoteAgeMs` integer, nullable
        - `outputDecayBps` number
        - `gasIncreaseBps` number
        - `severity` 'none' | 'low' | 'medium' | 'high'
      - `netEdge` NetEdgeAnalysis
        - `expectedUpsideUsd` number, nullable
        - `protocolFeeUsd` number
        - `gasUsd` number
        - `bridgeFeeUsd` number
        - `riskBufferUsd` number
        - `totalCostUsd` number
        - `netEdgeUsd` number, nullable
        - `positive` boolean, nullable
        - `enforced` boolean
    - `riskReport` SwapRiskReport, required
      - `flags` RiskFlag[]
        - `code` string, required
        - `category` 'approval' | 'bridge' | 'contract' | 'token' | 'health' | 'execution', required
        - `severity` 'low' | 'medium' | 'high' | 'critical', required
        - `title` string, required
        - `message` string, required
        - `metadata` object
      - `approval` AllowanceStatus
        - `spender` string, nullable
        - `allowance` string, nullable
        - `requiredAmount` string
        - `approvalNeeded` boolean
        - `overApproved` boolean
        - `source` 'onchain' | 'quote_fallback' | 'unavailable'
      - `pegChecks` PegCheck[]
        - `tokenAddress` string
        - `symbol` string
        - `reference` 'USD' | 'ETH'
        - `priceUsd` number, nullable
        - `referencePriceUsd` number, nullable
        - `deviationPct` number, nullable
        - `alert` boolean
      - `health` HealthCheck
        - `healthFactor` number, nullable
        - `liquidationBufferPct` number, nullable
        - `alertLevel` 'none' | 'warning' | 'critical'
        - `shouldHalt` boolean
      - `shouldHalt` boolean
      - `haltReasons` string[]
    - `execution_boundary` object, required
      - `state` string
      - `simulation_required` boolean
      - `local_signature_required` boolean
      - `farmdash_broadcasts_transaction` boolean
    - `note` string, required

## Other responses

- `400`: Invalid parameters
- `402`: Free-tier limit exceeded — x402 payment required
- `404`: Unknown/expired intentId (intent_not_found)
- `429`: Rate limit exceeded
- `502`: Typed live quote provider degradation
- `504`: Live quote provider timed out (bounded 15s upstream call). Code quote_provider_timeout, retryable true — back off and retry.

---

[API](https://skmtc.dev/farmdash/apis/farmdash-agent-api.md) · [All operations](https://skmtc.dev/farmdash/apis/farmdash-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/farmdash/apis/farmdash-agent-api/revisions/96310281f58c?raw)
