Skip to main content

IMakerRouter

Methods

swapAllFeiForDai

function swapAllFeiForDai(address to) external nonpayable

Function to swap all of FEI balance to DAI

Parameters

NameTypeDescription
toaddressthe address the DAI should be sent to once swapped

swapAllFeiForUsdc

function swapAllFeiForUsdc(address to) external nonpayable

Function to swap all of FEI balance to USDC

Parameters

NameTypeDescription
toaddressthe address the USDC should be sent to once swapped

swapAllFeiForUsdcAndDai

function swapAllFeiForUsdcAndDai(address usdcTo, address daiTo, uint256 ratioUSDC) external nonpayable

Function to swap all FEI balance for both DAI and USDC

Parameters

NameTypeDescription
usdcToaddressthe address the USDC should be sent to once swapped
daiToaddressthe address the DAI should be sent to once swapped
ratioUSDCuint256the ratio of the DAI received we would like to swap to USDC - in basis point terms

swapFeiForDai

function swapFeiForDai(uint256 amountFeiIn, uint256 minDaiAmountOut, address to) external nonpayable

Function to swap from FEI to DAI

Parameters

NameTypeDescription
amountFeiInuint256the amount of FEI to be deposited
minDaiAmountOutuint256the minimum amount of DAI expected to be received
toaddressthe address the DAI should be sent to once swapped

swapFeiForUsdc

function swapFeiForUsdc(uint256 amountFeiIn, uint256 minDaiAmountOut, address to) external nonpayable

Function to swap from FEI to USDC

Function will swap from FEI to DAI first then DAI to USDC

Parameters

NameTypeDescription
amountFeiInuint256the amount of FEI to be deposited
minDaiAmountOutuint256the minimum amount of DAI expected to be received from FEI PSM
toaddressthe address the USDC should be sent to once swapped

swapFeiForUsdcAndDai

function swapFeiForUsdcAndDai(uint256 amountFeiIn, uint256 minDaiAmountOut, address usdcTo, address daiTo, uint256 ratioUSDC) external nonpayable

Function to swap for both DAI and USDC

Function will swap from FEI to DAI first then DAI to USDC

Parameters

NameTypeDescription
amountFeiInuint256the amount of FEI to be deposited
minDaiAmountOutuint256the minimum amount of DAI expected to be received
usdcToaddressthe address the USDC should be sent to once swapped
daiToaddressthe address the DAI should be sent to once swapped
ratioUSDCuint256the ratio of the DAI received we would like to swap to USDC - in basis point terms

withdrawERC20

function withdrawERC20(address token, uint256 amount, address to) external nonpayable

Function to withdraw tokens to an address

Parameters

NameTypeDescription
tokenaddressthe token to withdraw
amountuint256the amount to send
toaddressthe address the token should be sent to