Rate provider
Swagger documentation is available by the link: https://api.etaswap.com/v1/docs
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 onisReverse
parameter) in minimum token unitsisReverse
- boolean flag showing swap type:false - to exchange specified
amount
oftokenFrom
to maximum oftokenTo
true - to exchange minimum
tokenFrom
to specifiedamount
oftokenTo
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 provideramountFrom
- amount oftokenFrom
to send in minimum token unitsamountTo
- amount oftokenTo
to receive in minimum token unitsgasEstimate
- amount of gas, that should be attached to Exchange contract call. Not provided for smart-contract-less exchanges (such as HSuite)path
- internal parameter that should be send to Exchange contract call to process exchangeroute
- exchange route (list of array of token addresses in EVM format)extension
- optional property, that store additional exchange information
Last updated