Maple
Search…
Pool
Util is a library that contains utility functions.

Functions

calcMinAmount

Calculates the minimum amount from a swap (adjustable for price slippage).
1
function calcMinAmount(
2
IMapleGlobals globals,
3
address fromAsset,
4
address toAsset,
5
uint256 swapAmt
6
) view returns (
7
uint256
8
)
Copied!

Parameters:

Index
Name
Type
Internal Type
Description
0
globals
IMapleGlobals
contract IMapleGlobals
The instance of a MapleGlobals.
1
fromAsset
address
address
The address of ERC-20 that will be swapped.
2
toAsset
address
address
The address of ERC-20 that will returned from swap.
3
swapAmt
uint256
uint256
The amount of `fromAsset` to be swapped.

Return Values:

Index
Name
Type
Internal Type
Description
0
uint256
uint256
The expected amount of `toAsset` to receive from swap based on current oracle prices.
Last modified 3mo ago
Copy link