lTokens

An overview of lToken contracts and associated methods

Introduction

Lodestar supported assets are represented by and interact with the protocol through lToken contracts. lToken contracts and their respective tokens are EIP-20 compliant representations of a user's supplied balances to the protocol. lTokens are the mechanism by which a user's supplied collateral accrues interest and can be collateralized to borrow other assets.

How do lTokens earn interest?

Each market has a unique supply interest rate (shown as a daily compounded APY in the app interface). Simply holding lTokens earns interest for the holder. Interest is earned via a perpetually increasing exchange rate between the lToken and underlying asset.

When a market is initialized, the exchange rate between the lToken and its underlying asset is set to 0.02 (this ratio is arbitrary and is only meant to differentiate between the lToken and underlying asset) and increases proportionally over time relative to the market interest rate.

For example, today the exchange rate for any given market could be 0.0276, and a year from now the exchange rate on the same market could be 0.0327. No actions need to be taken on the user's part to claim or compound their accrued interest. Furthermore, exchange rates are market specific and are applied across the entire market (exchange rates are not unique to individual accounts).

How can I view my lTokens?

All lTokens are accessible through Arbiscan. See the Deployed Contracts section for contract addresses. You may also view them as assets belonging to your address through blockchain explorers and supported wallets (see Supported Wallet in User Guide section).

Can I transfer lTokens?

Yes, it is possible to transfer lTokens from one account to another. However, caution should be exercised when transferring lTokens as they relate to borrow balance and overall account health. By transferring lTokens, the user is transferring supplied assets to the target account. A lToken transfer will fail when the requested transfer would bring an account into bad health. See the Liquidation section of the Technical Overview for further details.

Mint, Redeem, Borrow, and Repay Borrow

These four functions are the critical operators of the money markets and are outlined in the following subsections.

Mint

When a user supplies assets to the protocol, the mint function is called. As noted above, minted lTokens immediately begin accruing interest according to the market's current supply interest rate. Upon mint, the user receives an amount of lTokens equal to the amount of underlying tokens supplied divided by the exchange rate at the time of minting. Written formulaically,

lTokens=UnderlyingSupplied/CurrentExchangeRatelTokens = Underlying Supplied / CurrentExchangeRate

Redeem

Redeem

The redeem function converts a specified quantity of lTokens into a corresponding quantity of the underlying asset. The quantity of underlying tokens transferred to the user is equal to the amount of lTokens being redeemed multiplied by the current exchange rate. Written formulaically,

Redeem=lTokensβˆ—CurrentExchangeRateRedeem=lTokens *CurrentExchangeRate

The amount redeemed must be less than the user's account liquidity and less than the overall available liquidity of the market.

Redeem Underlying

The redeem underlying function converts a quantity of lTokens into a specified quantity of the underlying asset. The quantity of redeemed lTokens is equal to the quantity of underlying assets requested divided by the current exchange rate. Written formulaically,

Redeem=Underlying/CurrentExchangeRateRedeem = Underlying / CurrentExchangeRate

The amount redeemed must be less than the user's account liquidity and less than the overall available liquidity of the market.

Borrow

The borrow function transfers assets from the protocol to the user, increasing the user's borrow balance and initiating interest accrual on the principal based on the asset's borrow rate. The amount borrowed must be less than the user's account liquidity and less than the overall available liquidity of the market.

Repay Borrow

By repaying a borrow, the user transfers assets back to the protocol, pays interest and reduces their borrow balance.

Miscellaneous Functions

Repay Borrow Behalf

This function allows a user to repay a borrow balance on behalf of another user, decreasing the target user's borrow balance.

Transfer

The transfer function is an ERC-20 method that allows tokens to be sent between Ethereum addresses. The transfer function will fail when the user has entered the corresponding market and the requested transfer would bring an account into bad standing. See the Liquidation section of the Technical Overview for further details.

Liquidate Borrow

If a user's account falls into bad standing (negative account liquidity), the account is subject to liquidation. Liquidations can be performed by any user of the protocol to return the account's liquidity back into good standing (an outstanding supply balance above the collateral requirement).

Upon liquidation, the liquidator is allowed to repay some or all of an outstanding borrow on behalf of the borrower. In return for performing this critical service, the liquidator receives a discounted share of the collateral held by the borrower (referred to as the Liquidation Incentive). A liquidator may close up to a predefined amount of any outstanding borrow of the account under liquidation (referred to as the Close Factor).

Liquidators interact with individual lToken contracts in which they wish to repay an outstanding borrow and seize a supplied asset as collateral. When this collateral is seized, the liquidator receives the corresponding amount of lTokens equal to the amount of collateral seized. The liquidator can then redeem the lTokens for the respective underlying asset in a similar manner as if they had supplied the assets to the protocol themselves.

Liquidation contract calls require approval as the liquidator is transferring funds into the contract. See the Liquidation section of the Technical Overview for further details.

Last updated