Oasis

Get expected prices for swaps

Oasis Resolver to get buy and sell details. You can view details like source code, ABIs on Etherscan.


Get Buy Amount

Fetch the buy token details like amount and unit.

dsa.oasis.getBuyAmount(buyToken, sellToken, sellAmt, slippage);
ParameterTypeDescription
buyTokenstringThe buy token symbol.
sellTokenstringThe sell token symbol.
sellAmtnumberThe amount of tokens to sell. Amount to be written in decimal form like 1.1, 100.2, etc
slippagenumberThe slippage in % like 1 means 1%, 10 means 10%.

Returns: Object of buy token details.

{
  buyAmt: "2208.0499999999997",
  buyAmtRaw: "2208050000000000000000",
  unitAmt: "216388900000000000000"
}
Return ParameterTypeDescription
buyAmtnumber/stringExpected buy token amount.
buyAmtRawnumber/stringExpected buy token amount in decimal form.
unitAmtnumber/stringThe unit amount is the minimum amount of buy token expected per sell token. It is calculated with the help of slippage. The parameter is passed directly in the oasis connector.

Get Sell Amount

Fetch the sell token details like amount and unit.

dsa.oasis.getSellAmount(buyToken, sellToken, buyAmt, slippage);
ParameterTypeDescription
buyTokenstringThe buy token symbol.
sellTokenstringThe sell token symbol.
buyAmtnumberThe amount of tokens to buy. Amount in decimal form like 1.1, 100.2.
slippagenumberThe slippage in % like 1 means 1%, 10 means 10%.

Returns: Object of buy token details.

{
  sellAmt: "4.513042693383879",
  sellAmtRaw: "4513042693383879411",
  unitAmt: "4422781839516201"
}
Return ParameterTypeDescription
sellAmtnumber/stringThe expected sell token amount.
sellAmtRawnumber/stringThe expected sell token amount in decimal form.
unitAmtnumber/stringThe unit amount is the minimum amount of buy token expected per sell token. It is calculated with the help of slippage. The parameter is passed directly in the oasis connector.

If you still can't find something you're looking for or have any questions, ask them at our developers community on Telegram, Discord or simply send an Email.

Our team is excited about assisting you to build an application using Instadapp Developer Platform. Your questions and feedback help us make a better development environment for future developers.

Best way to stay connected with our progress.