LToken

LToken are tokens minted and burned upon supply and withdrawal of assets within the Lentum market on Solana. They represent the amount of crypto assets supplied to the protocol along with the accrued yield. Each LToken is pegged 1:1 to its corresponding underlying asset and can be securely stored, transferred, or traded.

  • Input Parameters:

    Name
    Type
    Description

    pool

    Pubkey

    Address of the associated Lentum pool

    treasury

    Pubkey

    Address of the treasury account

    underlying_asset

    Pubkey

    Address of the underlying asset

    ltoken_decimals

    u8

    Decimals for the underlying asset

    ltoken_name

    String

    Name of the LToken

    ltoken_symbol

    String

    Symbol of the LToken

    params

    Vec<u8>

    Additional initialization parameters

Initialization

rustCopypub fn initialize(
    pool: &Pubkey,
    treasury: &Pubkey,
    underlying_asset: &Pubkey,
    ltoken_decimals: u8,
    ltoken_name: String,
    ltoken_symbol: String,
    params: Vec<u8>
) -> Result<(), ProgramError> {
    // Called during LToken deployment.
    // Cache the pool and treasury addresses.
    // Set token metadata and decimals.
    // Additional initialization parameters can be passed via `params`.
    Ok(())
}

Mint

  • Description: Mints a specified amount of LTokens to a given account. The mint operation is called when a user supplies assets to the protocol. The yield index is updated accordingly.

  • Input Parameters:

    Name
    Type
    Description

    caller

    Pubkey

    Address of the entity initiating the mint

    on_behalf_of

    Pubkey

    Recipient of the minted LTokens

    amount

    u64

    Amount of LTokens to mint

    current_index

    u64

    Current liquidity index (used for yield calculations)

Burn

  • Description: Burns LTokens when a user withdraws their supplied assets. The underlying asset is transferred to the designated recipient, reflecting both the principal and the accrued yield.

  • Input Parameters:

    Name
    Type
    Description

    from

    Pubkey

    Account from which LTokens are burned

    receiver_of_underlying

    Pubkey

    Recipient address for the underlying asset

    amount

    u64

    Amount of LTokens to burn

    current_index

    u64

    Current liquidity index for yield calculations

Additional Functions

Transfer on Liquidation

  • Description: Transfers LTokens during a liquidation process. This function is used when a borrow position is liquidated, ensuring that the liquidator reclaims the correct token balance.

Transfer Underlying

  • Description: Transfers the underlying asset to a designated account. This is a low-level function used by higher-level operations such as borrow and withdraw.

Handle Repayment

  • Description: Processes the underlying asset received after a repayment. Currently a no-op, it provides a hook for future enhancements.

V2 Features (Upcoming):

  • Treasury Operations

    Mint to Treasury

  • eMode: Advanced collateral efficiency mode

  • Flash Loans: Instant, non-collateralized borrowing

Last updated