Rate provider
Last updated
Last updated
EtaSwap rate provider API section allows to fetch current swap rates for provided token pair from all DEXes in Hedera ecosystem (SaucerSwap, HSuite, HeliSwap, Pangolin).
To get swap rates you need to execute such kind of GET
request:
Query parameters:
tokenFrom
- EVM address of token which you want to exchange from. In case if you want to exchange root Hedera token (HBAR) - you need to provide zero address: 0x0000000000000000000000000000000000000000
tokenTo
- EVM address of token which you want to exchange to. In case if you want to exchange root Hedera token (HBAR) - you need to provide zero address: 0x0000000000000000000000000000000000000000
amount
- amount of tokens to send/receive (depending on isReverse
parameter) in minimum token units
isReverse
- boolean flag showing swap type:
false - to exchange specified amount
of tokenFrom
to maximum of tokenTo
true - to exchange minimum tokenFrom
to specified amount
of tokenTo
Response - is list of proposed output amount by different liquidity providers. This list is ordered by profitability (max. profitable value comes first).
Response example:
transactionType
- indicator of type of the transaction. Options: "SWAP" or "INDIRECT_SWAP". In future list of options will expand as we implement new algorithms.
aggregatorId
- identifier of liquility provider
amountFrom
- amount of tokenFrom
to send in minimum token units
amountTo
- amount of tokenTo
to receive in minimum token units
route
- exchange route (list of array of token addresses in EVM format)
extension
- optional property, that store additional exchange information
gasEstimate
- amount of gas, that should be attached to contract call. Not provided for smart-contract-less exchanges (such as HSuite)
path
- internal parameter that should be send to contract call to process exchange