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.
User's assets which will be used by ExecutionNode contract deployed on source chain
Assets will be moved to user's account on destination chain
Amount with token's decimals
In basis points, 100% is 1000000(1M)
Whether the user wants native token as output (only applicable if the dst_token is set to a native wrap)
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
Bridge selection filter. 'cbridge', 'stargate', 'anyswap', 'hop', 'hyphen', 'across'.
Nonce is used for uniquely tracking a swap on a per user per swap basis. Typically this is set to a unix timestamp
Id of chain on which token is deployed
Token logo's URI
logo_uri and name are not required for token
Optional Error Message
Source token's usd price
Destination token's usd price
Estimated receiving amount. All non-native fees for destination chain swap will be deducted.
amount_out plus non-native fees
The minium destination token value that the receiver will receive
The return estimation for user's swap, which is denominated in destination token
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
Abi encoded transaction data field.
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"
ETA of the path. It will include bridge time and message execution time if there is any
Gas token amount with decimals
Gas token value in USD, no decimals included
price_impact = (amount_in / amount_out) / (token_out_usd_price / token_in_usd_price) - 1
Step fulfilled by a DEX
Step fulfilled by a Bridge
Since the step type is enum, ChainHop will return a number to represent the type.
Swap() should only be called when the user selects a path and wants to commit a swap