Quote & Swap

Find the potential quote for user's input and target output

Every swap starts with a call to /quote, then the caller can decide whether they want to proceed. If the price/path looks good, the caller should proceed to call /swap with a selected path to build the calldata for the contract call.

Quote

Request Fields

Token

logo_uri and name are not required for token

Response Fields

Path

price_impact = (amount_in / amount_out) / (token_out_usd_price / token_in_usd_price) - 1

Step

StepType

Since the step type is enum, ChainHop will return a number to represent the type.

Swap

Last updated