Fathom Protocol
  • Introduction
  • FXD Stablecoin
    • FXD Smart Contract Architecture
    • Minting and Burning Mechanisms with LTV Ratio
    • Soft-Pegging to the US Dollar
    • Opening and closing position flows
    • BookKeeping mechanism
      • Stablecoin Accounting
      • Collateral Accounting
    • Liquidation
      • Fixed Spread Liquidation Strategy
      • Liquidation process walk through
    • Emergency Shutdown
    • Maths for position safety
    • Fee structure
    • Risk Management
    • Interfaces
      • ProxyWalletRegistry
      • ProxyWallet
        • FathomStablecoinProxyActions
      • CollateralPoolConfig
      • BookKeeper
      • FXD
      • LiquidationEngine
      • FlashMintModule
      • PriceFeed
      • ShowStopper
      • StabilityFeeCollector
      • SystemDebtEngine
      • AdminControls
    • Deployments
      • XDC Network
    • User Guides
      • Open FXD position
      • Top Up FXD Position
      • Repay and close FXD position
    • Fathom Stablecoin Smart Contracts
    • Fathom Stablecoin Subgraph
  • Vaults
    • Key Features
    • Definitions
    • Architecture
    • Fees
    • Workflows
    • Vault Management
    • Strategy Creation
    • Interfaces
      • Factory
      • Vault
      • BaseStrategy
      • TokenizedStrategy
    • Deployments
      • XDC Network
    • User Guides
      • Deposit and Withdraw in Vault
    • Fathom Vaults Smart Contracts
    • Fathom Vaults Subgraph
  • Lending
    • Core Concepts
    • Protocol Mechanics
    • Architecture
    • Interfaces
      • FmToken
      • VariableDebtToken
      • StableDebtToken
      • L2Pool
      • PoolAddressesProvider
    • User Guides
      • Supply, Borrow, Repay and Withdraw Asset
    • Deployments
      • XDC Network
    • Fathom Lending Smart Contracts
    • Fathom Lending Subgraph
  • DEX
    • Core Concepts
    • Architecture
    • Interfaces
      • Factory
      • Pair
      • Router
    • User Guides
      • Providing Liquidity
      • Swapping Assets
    • Deployments
      • XDC Network
    • Fathom DEX Smart Contracts
    • Fathom DEX Subgraph
  • DAO
    • DAO Structure
    • Governance Process
    • Staking Process
    • Treasury Management
    • Risk Management and Security Measures
    • Contributing to Fathom DAO
    • Interfaces
      • FTHM
      • Staking
        • Vault
        • RewardsCalculator
        • vFTHM
      • Governance
        • TimelockController
    • Deployments
      • XDC Network
    • User Guides
      • Staking
      • Proposing
      • Voting
    • Fathom DAO Smart Contracts
    • Fathom DAO Subgraph
  • Whitepaper
    • Version 1.0
  • Resources
  • FXD Deployments
  • FTHM Deployments
  • Privacy Policy
  • Terms of Service
Powered by GitBook

Copyright© Fathom App 2024.

On this page
  • Storage Variables
  • Functions
  • Events

Was this helpful?

Export as PDF
  1. Lending
  2. Interfaces

L2Pool

https://github.com/Into-the-Fathom/fathom-lending-platform-smart-contracts/blob/master/contracts/protocol/pool/L2Pool.sol

The L2Pool contract is a calldata-optimized extension of the Pool contract in the Fathom lending protocol. It allows users to interact with the protocol using a compact calldata representation, reducing transaction costs on rollups. Users can supply, withdraw, borrow, repay, and perform other standard lending operations with optimized calldata.

Storage Variables

  • POOL_REVISION: Version of the pool contract.

  • ADDRESSES_PROVIDER: Reference to the PoolAddressesProvider contract.

Functions

Initialization:

  • initialize: Initializes the pool with the PoolAddressesProvider.

Set Functions:

  • setReserveInterestRateStrategyAddress: Sets the interest rate strategy address for a reserve.

  • setConfiguration: Sets the configuration for a reserve.

  • updateBridgeProtocolFee: Updates the bridge protocol fee.

  • updateFlashloanPremiums: Updates the flash loan premiums.

  • configureEModeCategory: Configures an e-mode category.

  • setUserEMode: Sets the user's e-mode category.

  • resetIsolationModeTotalDebt: Resets the isolation mode total debt for a reserve.

  • rescueTokens: Rescues tokens sent to the contract.

Get Functions:

  • getReserveData: Returns the reserve data for an asset.

  • getUserAccountData: Returns the user's account data.

  • getConfiguration: Returns the configuration of a reserve.

  • getUserConfiguration: Returns the user's configuration.

  • getReserveNormalizedIncome: Returns the normalized income for a reserve.

  • getReserveNormalizedVariableDebt: Returns the normalized variable debt for a reserve.

  • getReservesList: Returns the list of reserves.

  • getReserveAddressById: Returns the address of a reserve by its ID.

  • MAX_STABLE_RATE_BORROW_SIZE_PERCENT: Returns the maximum stable rate borrow size percentage.

  • BRIDGE_PROTOCOL_FEE: Returns the bridge protocol fee.

  • FLASHLOAN_PREMIUM_TOTAL: Returns the total flash loan premium.

  • FLASHLOAN_PREMIUM_TO_PROTOCOL: Returns the protocol's share of the flash loan premium.

  • MAX_NUMBER_RESERVES: Returns the maximum number of reserves.

  • getEModeCategoryData: Returns the data of an e-mode category.

  • getUserEMode: Returns the e-mode category of a user.

Supply Functions:

  • supply: Supplies assets to the pool.

  • supplyWithPermit: Supplies assets to the pool with a permit.

Withdraw Functions:

  • withdraw: Withdraws assets from the pool.

Borrow Functions:

  • borrow: Borrows assets from the pool.

  • repay: Repays borrowed assets.

  • repayWithPermit: Repays borrowed assets with a permit.

  • repayWithFmTokens: Repays borrowed assets using FM tokens.

  • swapBorrowRateMode: Swaps the borrow rate mode.

  • rebalanceStableBorrowRate: Rebalances the stable borrow rate.

  • setUserUseReserveAsCollateral: Sets a user's reserve as collateral.

  • liquidationCall: Executes a liquidation call.

Flash Loan Functions:

  • flashLoan: Executes a flash loan.

  • flashLoanSimple: Executes a simple flash loan.

Finalization Functions:

  • finalizeTransfer: Finalizes a transfer of assets.

Reserve Management Functions:

  • initReserve: Initializes a reserve.

  • dropReserve: Drops a reserve.

Emergency Functions:

  • rescueTokens: Rescues tokens from the contract

Events

Pool Events (Inherited from Pool contract):

  • Supply: Emitted when assets are supplied to the pool.

  • Withdraw: Emitted when assets are withdrawn from the pool.

  • Borrow: Emitted when assets are borrowed from the pool.

  • Repay: Emitted when borrowed assets are repaid.

  • FlashLoan: Emitted when a flash loan is executed.

  • SwapBorrowRateMode: Emitted when the borrow rate mode is swapped.

  • RebalanceStableBorrowRate: Emitted when the stable borrow rate is rebalanced.

  • SetUserUseReserveAsCollateral: Emitted when a user sets a reserve as collateral.

  • LiquidationCall: Emitted when a liquidation call is executed.

  • ReserveDataUpdated: Emitted when reserve data is updated.

  • MintUnbacked: Emitted when unbacked assets are minted.

  • BackUnbacked: Emitted when unbacked assets are backed.

  • MintToTreasury: Emitted when assets are minted to the treasury.

  • InitializeReserve: Emitted when a reserve is initialized.

  • DropReserve: Emitted when a reserve is dropped.

  • SetReserveInterestRateStrategyAddress: Emitted when the interest rate strategy address for a reserve is set.

  • SetConfiguration: Emitted when the configuration of a reserve is set.

  • UpdateBridgeProtocolFee: Emitted when the bridge protocol fee is updated.

  • UpdateFlashloanPremiums: Emitted when flash loan premiums are updated.

  • ConfigureEModeCategory: Emitted when an e-mode category is configured.

  • SetUserEMode: Emitted when a user's e-mode category is set.

  • ResetIsolationModeTotalDebt: Emitted when the isolation mode total debt is reset.

  • RescueTokens: Emitted when tokens are rescued.

L2Pool Specific Events:

  • There are no additional events defined specifically in the L2Pool contract. It leverages the compact calldata representation to optimize the inherited functionalities from the Pool contract without adding new events.

PreviousStableDebtTokenNextPoolAddressesProvider

Last updated 11 months ago

Was this helpful?