xUSDL

Token contract for xUSDL (staked USDL)

Contract

This is the main ERC20 token contract for xUSDL, the staked version of USDL. xUSDL represents a pool of USDL that increases or decreases with funding payments on integrated derivative dexes.

Public Write Functions

deposit

function deposit(uint256 amount) external returns (uint256 shares)

Function purpose: msg.sender mints xUSDL by depositing USDL.

ParametersDescriptionAttribute

amount

Amount of USDL to be deposited.

USD, 18 decimals

shares

Amount of xUSDL minted.

xUSDL, 18 decimals

withdraw

function withdraw(uint256 shares) external returns (uint256 amount)

Function purpose: msg.sender claims USDL by burning xUSDL.

ParametersDescriptionAttribute

shares

Amount of xUSDL to be burned.

xUSDL, 18 decimals

amount

Amount of USDL claimed.

USD, 18 decimals

withdrawTo

function withdrawTo(
    address to, 
    uint256 shares) 
    public returns (uint256 amount)

Function purpose: msg.sender claims USDL to a given address by burning xUSDL.

ParametersDescriptionAttribute

to

Address where claimed USDL will be sent to.

Address

shares

Amount of xUSDL to be burned.

xUSDL, 18 decimals

amount

Amount of USDL claimed.

USD, 18 decimals

Public View Functions

pricePerShare

function pricePerShare() public view returns (uint256 price)

Function purpose: view amount of USDL that can be claimed for 1 xUSDL.

ParametersDescriptionAttribute

price

Amount of USDL that can be claimed for 1 xUSDL.

USD, 18 decimals

balance

function balance() public view returns (uint256 balanceAmount)

Function purpose: view amount of USDL that is held in the xUSDL staking contract.

ParametersDescriptionAttribute

balanceAmount

Amount of USDL that is held in the xUSDL staking contract.

USD, 18 decimals

Restricted Functions

Restricted functions can only be called by owner of contract, which will be a multi sig.

updatePeriphery

function updatePeriphery(address _periphery)

This function allows Lemma to update the periphery contract address. The periphery contract is used for actions like minting and staking USDL in the same transaction when users deposit assets in the basis trading vault. This contract is immutable. It has the privilege to bypass the wait time required to unstake xUSDL without waiting.

updateLock

function updateLock(uint256 lock)

This function allows Lemma to update the duration of the time lock for unstaking. The time lock is calculated by looking at the number of blocks produced after a user deposits.

Last updated