Use when an agent needs a swap quote and price impact before trading
Use when an agent needs a swap quote and price impact before trading. Input: chain (base, ethereum, arbitrum), from, to (ticker like USDC, ETH or 0x address), amounts (1-5 sizes in from-token units). Output: JSON per size best venue (Uniswap v3 fee tier, Uniswap v2, Aerodrome), amount out, effective price, price impact %, all venue quotes, spot price. Quote only: no calldata, nothing executed. Example: ?from=USDC&to=ETH&amounts=1000,100000
Paid test badge: not yet. The checks above are free: we call the tool without paying and read the payment request it sends back. The Verified badge needs paid calls whose answers match the promised output, and nobody can buy a badge.
Endpoint
GET https://1gateway.dev/v1/onchain/swap/quote
| Category | Market data |
|---|---|
| Provider host | 1gateway.dev |
| Networks | eip155:137, eip155:143, eip155:42161, eip155:8453, solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp |
| Payment schemes | exact |
| Self-reported calls, 30 days | 2 from 1 payers (the provider's figure, not ours) |
Our checks, last 30 days
We never call tools that send, buy, move money or file anything, not even without paying.
Example input (from the provider)
{
"method": "GET",
"queryParams": {
"amounts": "1000,100000",
"chain": "base",
"from": "USDC",
"to": "ETH"
},
"type": "http"
}
Promised output schema (from the provider)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"input": {
"additionalProperties": false,
"properties": {
"method": {
"enum": [
"GET"
],
"type": "string"
},
"queryParams": {
"additionalProperties": false,
"properties": {
"amounts": {
"description": "1-5 trade sizes in units of the from token, comma-separated (alias amount)",
"maxLength": 120,
"pattern": "^\\d{1,15}(\\.\\d{1,18})?(,\\d{1,15}(\\.\\d{1,18})?){0,4}$",
"type": "string"
},
"chain": {
"description": "Chain (default base)",
"enum": [
"base",
"ethereum",
"arbitrum"
],
"type": "string"
},
"from": {
"description": "Token sold: ticker (USDC, USDT, ETH/WETH, BTC/cbBTC/WBTC, wstETH, DAI, AERO, ARB\u2026 per chain) or 0x \u2026",
"maxLength": 42,
"pattern": "^(0x[0-9a-fA-F]{40}|[A-Za-z]{2,8})$",
"type": "string"
},
"to": {
"description": "Token bought (same format)",
"maxLength": 42,
"pattern": "^(0x[0-9a-fA-F]{40}|[A-Za-z]{2,8})$",
"type": "string"
}
},
"required": [
"from",
"to",
"amounts"
],
"type": "object"
},
"type": {
"const": "http",
"type": "string"
}
},
"required": [
"type",
"method"
],
"type": "object"
},
"output": {
"properties": {
"example": {
"additionalProperties": true,
"properties": {
"asOf": {
"type": "string"
},
"cache": {
"type": "string"
},
"chain": {
"type": "string"
},
"from": {
"additionalProperties": true,
"properties": {
"decimals": {
"type": "integer"
},
"symbol": {
"type": "string"
},
"token": {
"type": "string"
}
},
"type": "object"
},
"method": {
"type": "string"
},
"notes": {
"items": {
"type": "string"
},
"type": "array"
},
"quotes": {
"items": {
"additionalProperties": true,
"properties": {
"amountIn": {
"type": "integer"
},
"best": {
"additionalProperties": true,
"type": "object"
},
"venues": {
"type": "array"
}
},
"type": "object"
},
"type": "array"
},
"spotPrice": {
"type": "number"
},
"spotPriceUnit": {
"type": "string"
},
"to": {
"additionalProperties": true,
"properties": {
"decimals": {
"type": "integer"
},
"symbol": {
"type": "string"
},
"token": {
"type": "string"
}
},
"type": "object"
}
},
"required": [
"chain",
"from",
"to",
"spotPrice",
"spotPriceUnit",
"quotes",
"asOf",
"cache",
"method",
"notes"
],
"type": "object"
},
"type": {
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
}
},
"required": [
"input"
],
"type": "object"
}