USDLemma
Token contract for USDL, the Lemma stablecoin
Contract
This is the main ERC20 token contract for USDL, the Lemma stablecoin. USDL is issued by depositing assets such as WETH. The deposited WETH is then moved to a decentralized derivative exchange and used as collateral to short itself with no leverage. Minting and redeeming USDL will open and close a short position on a given integrated dex.
Public Functions
deposit
Function purpose: msg.sender mints USDL by depositing WETH.
amount
Amount of USDL to be minted.
USD, 18 decimals
perpetualDEXIndex
Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).
Integer
maxCollateralAmountRequired
Max amount of WETH to be deposited to mint the USDL amount above.
ETH, 18 decimals
collateral
Token address for collateral to be used.
depositTo
Function purpose: msg.sender mints USDL to a given address by depositing WETH.
to
Wallet address where USDL will be minted.
Address
amount
Amount of USDL to be minted.
USD, 18 decimals
perpetualDEXIndex
Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).
Integer
maxCollateralAmountRequired
Max amount of WETH to be deposited to mint the USDL amount above.
ETH, 18 decimals
collateral
Token address for type of asset to be deposited.
withdraw
Function purpose: msg.sender redeems USDL for 1 USD worth of WETH.
amount
Amount of USDL to be redeemed.
USD, 18 decimals
perpetualDEXIndex
Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).
Integer
minCollateralAmountRequired
Minimum amount of WETH to be received when redeeming the USDL amount above.
ETH, 18 decimals
collateral
Token address for type of asset to be received.
withdrawTo
Function purpose: msg.sender redeems USDL to a given address for 1 USD worth of WETH.
to
Wallet address where redeemed assets will be sent.
Address
amount
Amount of USDL to be redeemed.
USD, 18 decimals
perpetualDEXIndex
Index for derivative dex to be used (right now only MCDEX is integrated, and its corresponding index is 0).
Integer
minCollateralAmountRequired
Minimum amount of WETH to be received when redeeming the USDL amount above.
ETH, 18 decimals
collateral
Token address for type of asset to be received.
Restricted Functions
Restricted functions can only be called by owner of contract, which will be a multi sig.
setStakingContractAddress
This function allows Lemma to update the staking contract for xUSDL.
setLemmaTreasury
This function allows Lemma to update the address that collects fees.
setFees
This function allows Lemma to update the percentage (in bps) of fees allocated to the treasury.
addPerpetualDEXWrapper
This function allows Lemma to add a new derivative dex or accepted collateral for minting & redeeming USDL.
reBalance
This function allows Lemma to:
Mint new USDL and increase our short position when a positive funding payment gives us new ETH.
Burn USDL and decrease our short position when a negative funding payment takes away some of our ETH collateral.
Can only be called by Lemma whitelisted accounts.
Last updated