LemmaRouter

LemmaRouter is helper contract that facilitates interacting with Lemma's core contracts

Public Functions

mintUSDL

Function purpose: msg.sender deposits WETH and mints USDL.

function mintUSDL(
        uint256 amount,
        uint256 maxCollateralRequired,
        uint256 dexIndex,
        IERC20 collateral) public
Parameters
Description
Attribute

amount

Amount of USDL to be minted.

USD, 18 decimals

maxCollateralRequired

Max amount of WETH to be deposited to mint the USDL amount above.

WETH, 18 decimals

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

collateral

IERC20 for type of asset to be deposited as collateral on the derivative dex.

mintUSDLTo

Function purpose: msg.sender deposits WETH and mints USDL to a given address.

function mintUSDLTo(
        address to,
        uint256 amount,
        uint256 maxCollateralRequired,
        uint256 dexIndex,
        IERC20 collateral) public
Parameters
Description
Attribute

to

Address where USDL will be minted.

ERC20 address

amount

Amount of USDL to be minted.

USD, 18 decimals

maxCollateralRequired

Max amount of WETH to be deposited to mint the USDL amount above.

WETH, 18 decimals

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

collateral

IERC20 for type of asset to be deposited as collateral on the derivative dex.

mintUSDLETH

Function purpose: msg.sender deposits ETH, converts the ETH to WETH and mints USDL.

Parameters
Description
Attributes

msg.value

Max amount of ETH to be deposited to mint the USDL amount below.

ETH, 18 decimals

amount

Amount of USDL to be minted.

USD, 18 decimals

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

mintUSDLToETH

Function purpose: msg.sender deposits ETH, converts the ETH to WETH and mints USDL to a given address.

Parameters
Description
Attributes

msg.value

Max amount of ETH to be deposited to mint the USDL amount below.

ETH, 18 decimals

to

Address where USDL will be minted.

ERC20 address

amount

Amount of USDL to be minted.

USD, 18 decimals

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

mintUSDLUsingToken

Function purpose: msg.sender deposits a given token, converts the token to WETH and mints USDL.

Parameter
Description
Attributes

token

IERC20 address for token type to be used to mint USDL.

ERC20 Address

tokenAmount

Amount of token to be deposited to mint USDL amount below.

Token, number of decimals depends on token

_swapActions

Array of dex contract addresses you want 1inch to use for swapping (or to let 1inch decide, put in "0x111111125434b319222cdbf8c261674adb56f3ae").

address[]

_swapDatas

Array of the "data" variable outputted by a request you need to make to the 1inch API's Swap GET call.

bytes[]

amount

Amount of USDL to be minted.

USD, 18 decimals

maxCollateralRequired

Max amount of WETH to be deposited to mint the USDL amount above.

WETH, 18 decimals

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

collateral

IERC20 for type of asset to be deposited as collateral on the derivative dex.

mintUSDLToUsingToken

Function purpose: msg.sender deposits a given token, converts the token to WETH and mints USDL to a given address.

Parameter
Description
Attributes

token

IERC20 address for token type to be used to mint USDL.

ERC20 Address

tokenAmount

Amount of token to be deposited to mint USDL amount below.

Token, number of decimals depends on token

_swapActions

Array of dex contract addresses you want 1inch to use for swapping (or to let 1inch decide, put in "0x111111125434b319222cdbf8c261674adb56f3ae").

address[]

_swapDatas

Array of the "data" variable outputted by a request you need to make to the 1inch API's Swap GET call.

bytes[]

to

Address where USDL will be minted.

ERC20 address

amount

Amount of USDL to be redeemed.

USD, 18 decimals

maxCollateralRequired

Max amount of WETH to be deposited to mint the USDL amount above.

WETH, 18 decimals

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

collateral

IERC20 for type of asset to be deposited as collateral on the derivative dex.

redeemUSDL

Function purpose: msg.sender redeems USDL for WETH.

Parameter
Description
Attributes

amount

Amount of USDL to be redeemed.

USD, 18 decimals

minCollateralToGetBack

Min amount of WETH to be received after redeeming the USDL amount above.

WETH, 18 decimals

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

collateral

IERC20 for type of asset to be claimed from collateral on the derivative dex.

redeemUSDLTo

Function purpose: msg.sender redeems USDL for WETH and receives the WETH at a given address.

Parameters
Description
Attributes

to

Address where WETH will be received.

ERC20 address

amount

Amount of USDL to be redeemed.

USD, 18 decimals

minCollateralToGetBack

Min amount of WETH to be received after redeeming the USDL amount above.

WETH, 18 decimals

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

collateral

IERC20 for type of asset to be claimed from collateral on the derivative dex.

redeemUSDLETH

Function purpose: msg.sender redeems USDL for WETH and converts that WETH to ETH.

Parameter
Description
Attributes

amount

Amount of USDL to be redeemed.

USD, 18 decimals

minCollateralToGetBack

Min amount of WETH to be received after redeeming the USDL amount above.

WETH, 18 decimals

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

redeemUSDLToETH

Function purpose: msg.sender redeems USDL for WETH, converts that WETH to ETH and receives the ETH at a given address.

Parameter
Description
Attributes

to

Address where ETH will be received.

ERC20 address

amount

Amount of USDL to be redeemed.

USD, 18 decimals

minCollateralToGetBack

Min amount of WETH to be received after redeeming the USDL amount above.

WETH, 18 decimals

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

redeemUSDLUsingToken

Function purpose: msg.sender redeems USDL for WETH and swaps that WETH for a given token.

Parameter
Description
Attributes

token

IERC20 address for token type to be received after redeeming USDL.

ERC20 Address

_swapActions

Array of contract addresses Array of dex contract addresses you want 1inch to use for swapping (or to let 1inch decide, put in "0x111111125434b319222cdbf8c261674adb56f3ae").

address[]

_swapDatas

Array of the "data" variable outputted by a request you need to make to the 1inch API's Swap GET call.

bytes[]

amount

Amount of USDL to be redeemed.

USD, 18 decimals

minTokenAmount

Min amount of token to be received after redeeming the USDL amount above.

Token, number of decimals depends on token

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

collateral

IERC20 for type of asset to be claimed from collateral on the derivative dex.

redeemUSDLToUsingToken

Function purpose: msg.sender redeems USDL for WETH, swaps that WETH for a given token and receives the token at a given address.

Parameter
Description
Attributes

token

IERC20 address for token type to be received after redeeming USDL.

ERC20 Address

_swapActions

Array of dex contract addresses you want 1inch to use for swapping (or to let 1inch decide, put in "0x111111125434b319222cdbf8c261674adb56f3ae").

address[]

_swapDatas

Array of the "data" variable outputted by a request you need to make to the 1inch API's Swap GET call.

bytes[]

to

Address where the given token will be received.

ERC20 address

amount

Amount of USDL to be redeemed.

USD, 18 decimals

minTokenAmount

Min amount of token to be received after redeeming the USDL amount above.

Token, number of decimals depends on token

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

collateral

IERC20 for type of asset to be claimed from collateral on the derivative dex.

stakeUSDL

Function purpose: msg.sender stakes USDL and receives xUSDL in return. Keep in mind the xUSDL price fluctuates with the yields generated and takes 8 hours to unstake.

Paramters
Description
Attributes

amount

Amount of USDL to be staked.

USD, 18 decimals

unstakeUSDL

Function purpose: msg.sender unstakes xUSDL and receives USDL in return. Keep in mind the xUSDL price fluctuates with the yields generated and takes 8 hours to unstake.

Paramters
Description
Attributes

amount

Amount of xUSDL to be unstaked.

xUSDL, 18 decimals

unstakeUSDLTo

Function purpose: msg.sender unstakes xUSDL and receives USDL at a given address in return. Keep in mind the xUSDL price fluctuates with the yields generated and takes 8 hours to unstake.

Paramters
Description
Attributes

to

Address where USDL will be received.

ERC20 address

amount

Amount of xUSDL to be unstaked.

xUSDL, 18 decimals

mintAndStake

Function purpose: msg.sender deposits WETH, mints USDL, stakes it and receives xUSDL in return. Keep in mind the xUSDL price fluctuates with the yields generated and takes 8 hours to unstake.

Paramters
Description
Attributes

amount

Amount of USDL to be minted & staked.

USD, 18 decimals

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

maxCollateralRequired

Max amount of WETH to be deposited to mint the USDL amount above.

WETH, 18 decimals

collateral

IERC20 for type of asset to be deposited as collateral on the derivative dex.

mintForEthAndStake

Function purpose: msg.sender deposits ETH, converts that ETH to WETH, mints USDL, stakes it and receives xUSDL in return. Keep in mind the xUSDL price fluctuates with the yields generated and takes 8 hours to unstake.

Paramters
Description
Attributes

msg.value

Max amount of ETH to be deposited to mint the USDL amount below.

ETH, 18 decimals

amount

Amount of USDL to be minted & staked.

USD, 18 decimals

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

mintUsingTokenAndStake

Function purpose: msg.sender deposits a given token, swaps it for WETH, mints USDL, stakes it and receives xUSDL in return. Keep in mind the xUSDL price fluctuates with the yields generated and takes 8 hours to unstake.

Parameter
Description
Attributes

token

IERC20 address for token type to be used to mint USDL.

ERC20 Address

tokenAmount

Amount of token to be deposited to mint USDL amount below.

Token, number of decimals depends on token

_swapActions

Array of dex contract addresses you want 1inch to use for swapping (or to let 1inch decide, put in "0x111111125434b319222cdbf8c261674adb56f3ae").

address[]

_swapDatas

Array of the "data" variable outputted by a request you need to make to the 1inch API's Swap GET call.

bytes[]

amount

Amount of USDL to be minted & staked.

USD, 18 decimals

maxCollateralRequired

Max amount of WETH to be deposited to mint the USDL amount above.

WETH, 18 decimals

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

collateral

IERC20 for type of asset to be deposited as collateral on the derivative dex.

unstakeAndRedeemUSDL

Function purpose: msg.sender unstakes xUSDL, receives USDL in return, redeems the USDL and receives WETH in return. Keep in mind the xUSDL price fluctuates with the yields generated and takes 8 hours to unstake.

Paramters
Description
Attributes

amount

Amount of xUSDL to be unstaked.

xUSDL, 18 decimals

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

minCollateralToGetBack

Min amount of WETH to be received after redeeming the USDL amount above.

WETH, 18 decimals

collateral

IERC20 for type of asset to be claimed from collateral on the derivative dex.

unstakeAndRedeemUSDLTo

Function purpose: msg.sender unstakes xUSDL, receives USDL in return, redeems the USDL and receives WETH in return at a given address. Keep in mind the xUSDL price fluctuates with the yields generated and takes 8 hours to unstake.

Paramters
Description
Attributes

to

Address where WETH will be received.

ERC20 address

amount

Amount of xUSDL to be unstaked.

xUSDL, 18 decimals

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

minCollateralToGetBack

Min amount of WETH to be received after redeeming the USDL amount above.

WETH, 18 decimals

collateral

IERC20 for type of asset to be claimed from collateral on the derivative dex.

unstakeAndRedeemUSDLForEth

Function purpose: msg.sender unstakes xUSDL, receives USDL in return, redeems the USDL, receives WETH in return and converts that WETH for ETH. Keep in mind the xUSDL price fluctuates with the yields generated and takes 8 hours to unstake.

Paramters
Description
Attributes

amount

Amount of xUSDL to be unstaked.

xUSDL, 18 decimals

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

unstakeAndRedeemUSDLForEthTo

Function purpose: msg.sender unstakes xUSDL, receives USDL in return, redeems the USDL, receives WETH in return, converts that WETH for ETH and receives that ETH at a given address. Keep in mind the xUSDL price fluctuates with the yields generated and takes 8 hours to unstake.

Paramters
Description
Attributes

to

Address where ETH will be received.

ERC20 address

amount

Amount of xUSDL to be unstaked.

xUSDL, 18 decimals

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

unstakeAndRedeemToken

Function purpose: msg.sender unstakes xUSDL, receives USDL in return, redeems the USDL, receives WETH in return and swaps that WETH for a given token. Keep in mind the xUSDL price fluctuates with the yields generated and takes 8 hours to unstake.

Parameter
Description
Attributes

token

IERC20 address for token type to be received after redeeming USDL.

ERC20 Address

_swapActions

Array of dex contract addresses you want 1inch to use for swapping (or to let 1inch decide, put in "0x111111125434b319222cdbf8c261674adb56f3ae").

address[]

_swapDatas

Array of the "data" variable outputted by a request you need to make to the 1inch API's Swap GET call.

bytes[]

amount

Amount of USDL to be redeemed.

USD, 18 decimals

minTokenAmount

Min amount of token to be received after redeeming the USDL amount above.

Token, number of decimals depends on token

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

collateral

IERC20 for type of asset to be claimed from collateral on the derivative dex.

unstakeAndRedeemToToken

Function purpose: msg.sender unstakes xUSDL, receives USDL in return, redeems the USDL, receives WETH in return, converts that WETH for a given token and receives that token at a given address. Keep in mind the xUSDL price fluctuates with the yields generated and takes 8 hours to unstake.

Parameter
Description
Attributes

token

IERC20 address for token type to be received after redeeming USDL.

ERC20 Address

_swapActions

Array of dex contract addresses you want 1inch to use for swapping (or to let 1inch decide, put in "0x111111125434b319222cdbf8c261674adb56f3ae").

address[]

_swapDatas

Array of the "data" variable outputted by a request you need to make to the 1inch API's Swap GET call.

bytes[]

to

Address where token will be received.

ERC20 address

amount

Amount of USDL to be redeemed.

USD, 18 decimals

minTokenAmount

Min amount of token to be received after redeeming the USDL amount above.

Token, number of decimals depends on token

dexIndex

Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).

Integer

collateral

IERC20 for type of asset to be claimed from collateral on the derivative dex.

Last updated