GetAmountsIn
Sushiswap Action Plugin - GetAmountsIn
Description
Given an output asset amount and an array of token addresses, calculates all preceding minimum input token amounts
Method
getAmountsOut(uint256, address[])
Input Parameters
Name
Plugin Type
Description
to
FctAddress
Sushiswap Router address
Method Parameters
Name
Plugin Type
Description
amountOut
FctValue
Output asset amount
path
FctAddressList
Path of the trade
Returned Values
Name
Plugin Type
Description
firstAmount
FctValue
First amount in
lastAmount
FctValue
Last amount in
Example
Example with initParams
const getAmountsIn = new Sushiswap.getters.GetAmountsIn({
chainId: 1,
initParams: {
to: "0x..." // Sushiswap Router
methodParams: {
amountOut: "...",
path: ["0x...", "0x..."],
}
}
})
Example without initParams
const getAmountsIn = new Sushiswap.getters.GetAmountsIn({
chainId: 1
})
await getAmountsIn.input.set({
to: "0x..." // Sushiswap Router
methodParams: {
amountOut: "...",
path: ["0x...", "0x..."],
}
})
Learn more
Learn more about Sushiswap GetAmountsIn function here
Last updated