Skip to main content
GET
/
api
/
{blockchain}
/
quote
TypeScript
const options = {method: 'GET'};

fetch('https://swap.ggp.gg/api/{blockchain}/quote', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "data": {
    "rawTotalGasEstimate": 1,
    "steps": [
      [
        {
          "exchanger": {
            "address": "<string>",
            "fee": 1,
            "name": "<string>",
            "poolType": "UniswapV2"
          },
          "amountIn": "<string>",
          "amountOut": "<string>",
          "percentBps": 1,
          "tokenIn": "<string>",
          "tokenOut": "<string>",
          "priceImpact": 1
        }
      ]
    ],
    "totalAmountOut": "<string>",
    "totalPriceImpact": 1,
    "addressTokenIn": "<string>",
    "addressTokenOut": "<string>",
    "amountIn": "<string>",
    "amountInUsd": 123,
    "amountOutUsd": 123,
    "usdDifference": 123
  }
}

Path Parameters

blockchain
enum<string>
required
Available options:
ethereum,
bsc,
arbitrum

Query Parameters

addressTokenIn
string
required

Source token contract address (ERC20 or native token)

addressTokenOut
string
required

Destination token contract address (ERC20 or native token)

amountIn
string
required

Amount of source token to swap (in token's normalized unit, e.g., eth for ETH)

Response

Quote for aggregation swap through POST /{blockchain}/swap

data
object