Skip to content

Instantly share code, notes, and snippets.

@publu
Created June 7, 2023 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save publu/7b6faf66bb535b13de886b364d87d002 to your computer and use it in GitHub Desktop.
Save publu/7b6faf66bb535b13de886b364d87d002 to your computer and use it in GitHub Desktop.
openapi: 3.0.0
info:
title: KyberSwap API
version: 1.0.0
servers:
- url: 'https://aggregator-api.kyberswap.com'
paths:
/v1/routes:
get:
summary: Get routes
parameters:
- in: query
name: tokenIn
required: true
schema:
type: string
description: The input token address
- in: query
name: tokenOut
required: true
schema:
type: string
description: The output token address
- in: query
name: amountIn
required: true
schema:
type: string
description: The amount of input token
- in: query
name: saveGas
required: false
schema:
type: boolean
description: Flag to save gas
- in: query
name: gasInclude
required: false
schema:
type: boolean
description: Flag to include gas
responses:
'200':
description: Success response
content:
application/json:
schema:
type: object
properties:
code:
type: integer
message:
type: string
data:
type: object
properties:
routeSummary:
type: object
properties:
tokenIn:
type: string
amountIn:
type: string
amountInUsd:
type: string
tokenInMarketPriceAvailable:
type: boolean
tokenOut:
type: string
amountOut:
type: string
amountOutUsd:
type: string
tokenOutMarketPriceAvailable:
type: boolean
gas:
type: string
gasPrice:
type: string
gasUsd:
type: string
extraFee:
type: object
properties:
feeAmount:
type: string
chargeFeeBy:
type: string
isInBps:
type: boolean
feeReceiver:
type: string
route:
type: array
items:
type: array
items:
type: object
properties:
pool:
type: string
tokenIn:
type: string
tokenOut:
type: string
limitReturnAmount:
type: string
swapAmount:
type: string
amountOut:
type: string
exchange:
type: string
poolLength:
type: integer
poolType:
type: string
poolExtra:
type: object
properties:
swapFee:
type: string
extra:
type: null
routerAddress:
type: string
requestId:
type: string
'400':
description: Bad request
'500':
description: Internal server error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment