Get expected prices for swaps
OasisDEX Resolver to get buy and sell details. You can view details like source code, ABIs on Etherscan.
Fetch the buy token details like amount and unit.
dsa.oasis.getBuyAmount(buyToken, sellToken, sellAmt, slippage);
Parameter | Type | Description |
---|---|---|
buyToken | string | The buy token symbol. |
sellToken | string | The sell token symbol. |
sellAmt | number | The amount of tokens to sell. Amount to be written in decimal form like 1.1, 100.2, etc |
slippage | number | The slippage in % like 1 means 1%, 10 means 10%. |
Returns: Object
of buy token details.
{
buyAmt: "2208.0499999999997",
buyAmtRaw: "2208050000000000000000",
unitAmt: "216388900000000000000"
}
Return Parameter | Type | Description |
---|---|---|
buyAmt | number/string | Expected buy token amount. |
buyAmtRaw | number/string | Expected buy token amount in decimal form. |
unitAmt | number/string | The 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 OasisDEX connector. |
Fetch the sell token details like amount and unit.
dsa.oasis.getSellAmount(buyToken, sellToken, buyAmt, slippage);
Parameter | Type | Description |
---|---|---|
buyToken | string | The buy token symbol. |
sellToken | string | The sell token symbol. |
buyAmt | number | The amount of tokens to buy. Amount in decimal form like 1.1, 100.2. |
slippage | number | The slippage in % like 1 means 1%, 10 means 10%. |
Returns: Object
of buy token details.
{
sellAmt: "4.513042693383879",
sellAmtRaw: "4513042693383879411",
unitAmt: "4422781839516201"
}
Return Parameter | Type | Description |
---|---|---|
sellAmt | number/string | The expected sell token amount. |
sellAmtRaw | number/string | The expected sell token amount in decimal form. |
unitAmt | number/string | The 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 OasisDEX connector. |
If you still can't find something you're looking for or have any questions, ask them at our developers community on 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.