ChainHop
Search…
Quote
Find the potential quote for user's input and target output
post
/chainhop/quote

Request Fields

Name
Type
Description
src_token
Token
User's assets which will be used by TransferSwapper contract deployed on source chain
dst_token
Token
Assets will be moved to user's account on destination chain
amount_in
String
Amount with token's decimals
slippage_tolerance
Number
100% is 1000000(1M)
native_in
Boolean
Source token is native token on source chain
native_out
Boolean
Destination token is native token on destination chain
receiver
String
Receiver's address
only_swaps
Array<String>
Swap will be executed only at these dexes if there are specific swap array. Dexes supported are SushiSwap, UniswapV2/V3, Curve, Platypus, 1inch, more will be added
only_bridges
Array<String>
Bridge will occur only at these bridges if there are any bridge execution. cBridge, stargate , mulitichain are supported, more will be added

Token

Name
Type
Description
symbol
String
Token symbol
chain_id
Number
Id of chain on which token is deployed
address
String
Token Address
decimals
Number
Token decimals
name
String
Token name
logo_uri
String
Token logo's URI
logo_uri and name are not required for token

Response Fields

Name
Type
Description
err
Optional Error Message
src_token_usd_price
Number
Source token's usd price
dst_token_usd_price
Number
Destination token's usd price
swap_id
String
paths
Array<Path>
Quote paths

Path

Name
Type
Description
steps
Array<Step>
amount_out
String
Estimated receiving amount. All non-native fees for destination chain swap will be deducted.
amount_out_raw
String
amount_out plus non-native fees
amount_out_min
String
The minium destination token value that the receiver will receive
return_amount
String
The return estimation for user's swap, which is denominated in destination token
bridge_fee
String
All fees that are charged through the token bridge. Native token fees charged up front in the source chain transaction will not be included. It is denominated in source token
tx_data
String
Abi encoded transaction data field.
tx_value
String
Abi encoded transaction value field. If the path involves sending message through cBridge, it will be set to a non-zero value to facilitate the message fee. If the bridge has native gas requirement, such as stargate, it will be also a positive value. Otherwise, the fee will be "0"
price_impact
Number
Calculation below
eta_seconds
Number
ETA of the path. It will include bridge time and message execution time if there is any
src_gas_fee
String
Gas token amount with decimals
src_gas_fee_usd
Number
Gas token value in USD, no decimals included
price_impact = (amount_in / amount_out) / (token_out_usd_price / token_in_usd_price) - 1

Step

Name
Type
Description
type
StepType
Step type indication
token_in
Token
Input token for this step
token_out
Token
Token output for this step
provider_name
String
Provider's name
provider_icon_url
String
Provider's icon url

StepType

Value
Description
STEP_UNKNOWN(0)
Unknown Step
STEP_DEX(1)
Step fulfilled by a DEX
STEP_BRIDGE(2)
Step fulfilled by a Bridge
Since the step type is enum, ChainHop will return a number to represent the type.
Copy link
On this page
post
/chainhop/quote
Request Fields
Token
Response Fields
Path
Step
StepType