DeFi Route Decision
defi_route_decisionCompare read-only Base swap quotes obtained from 1inch and KyberSwap, evaluating output, minimum output, fees/gas, price impact, consensus, and divergence to return a deterministic economic route decision (EXECUTE_BEST, WAIT, or INSUFFICIENT_DATA). The product consults external providers during the request; quotes reflect the market state observed at that moment and identical calls can produce different results. Provider unavailability or failure can yield a partial result or insufficient data. The product does not execute, submit, sign, or authorize a swap or transaction. USE WHEN: an agent needs to compare available swap routes on Base and determine whether to execute the best route, wait, or treat the available market data as insufficient. DO NOT USE WHEN: the agent needs to execute or submit a swap, sign a transaction, or perform a transaction-safety authorization.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | Yes | Base Mainnet only in this quote-only MVP. | |
| token_in | Yes | Input Base asset symbol. | |
| amount_in | Yes | Positive decimal input amount, converted exactly to raw token units. | |
| token_out | Yes | Output Base asset symbol; must differ from token_in. | |
| slippage_bps | Yes | Slippage tolerance in basis points; it is not treated as a cost. | |
| baseline_provider | No | Optional provider used only for a direct economic comparison. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| usage | Yes | Per-provider call success, latency, and configured cost-estimate availability. | |
| quotes | Yes | Normalized provider quote evidence in raw token units. | |
| status | Yes | Outcome of the quote comparison: COMPARISON_AVAILABLE when at least two valid quotes exist, PARTIAL when some but not all providers succeeded, UPSTREAM_UNAVAILABLE when no provider returned a valid quote. | |
| partial | Yes | True when one or more providers did not yield a valid quote. | |
| decision | Yes | Deterministic economic decision: which swap quote the agent should choose right now. Not a safety authorization and does not execute a swap. | |
| consensus | Yes | Comparable-output median and comparison basis when two provider quotes are valid. | |
| economics | Yes | Known or unknown estimated provider COGS; unknown is never represented as zero. | |
| confidence | Yes | Deterministic quote-comparison confidence; two providers never produce HIGH in this MVP. | |
| observed_at | Yes | UTC timestamp when the latest provider quote was observed during this request. | |
| best_provider | Yes | Best comparable provider only when at least two valid quotes are available. | |
| decision_reason | Yes | Human-readable deterministic reason for the decision. | |
| decision_signals | Yes | Objective signals used for the decision. | |
| evidence_quality | Yes | Per-provider reported, calculated, estimated, or unavailable field quality. | |
| provider_failures | Yes | Providers that failed to return a valid quote, with provider name and failure category. | |
| economic_advantage | Yes | Best quote versus declared baseline or next available quote; never ROI. |