LogoLogo
  • Blend v2 Documentation
  • ๐Ÿ“„Blend Whitepaper
  • ๐ŸงชMedia Kit
  • ๐Ÿš€Deployments
  • ๐Ÿ•ต๏ธโ€โ™‚๏ธAudits & Bug Bounties
  • ๐Ÿง‘โ€๐ŸญGithub
  • v1 Docs
  • ๐Ÿ‘ฅUsers
    • General/FAQ
    • Choosing Pools
    • Lending-Borrowing
      • Lending
      • Borrowing
      • Liquidations
    • Backstopping
    • BLND Token
    • Auctions
  • Emissions
  • ๐ŸŒŠPool Creators
    • General
    • Tutorial: Setting Up a Pool
    • Adding Assets
      • Risk Parameters
      • Interest Rates
      • Emissions
    • Pool Management
    • Selecting an Oracle
    • Setting Backstop Take Rate
    • Setting Max Positions
    • Backstop Bootstrapping
    • Required Infrastructure
  • ๐Ÿ“šTech Docs
    • General
    • Core Contracts
      • Emitter
        • Backstop Management
        • Blend Distribution
      • Backstop
        • Deposit Management
        • Drawing and Donating
        • Emission Distribution
      • Pool Factory
        • Lending Pool Deployment
      • Lending Pool
        • Fund Management
        • Liquidation Management
        • Emission Management
        • Interest Management
        • Pool Management
        • Bad Debt Management
        • Protocol Tokens
    • Guides
      • Deploying a Pool
    • Potential Improvements
Powered by GitBook
On this page
  • Pool Status
  • Permissionless Updates
  • Permissioned Updates
  • Asset Parameters
Export as PDF
  1. ๐Ÿ“šTech Docs
  2. Core Contracts
  3. Lending Pool

Pool Management

PreviousInterest ManagementNextBad Debt Management

Last updated 1 month ago

The Lending Pool contract handles updating pool status and asset parameters.

Pool Status

Pool status is updated using either a permissionless function, update_status() , or a permissioned (admin-only) function set_status(). These set the pool to one of the following statuses:

  • Admin_Active (enum 0): The pool is functioning normally.

  • Active (enum 1): The pool is functioning normally.

  • Admin_On_Ice (enum 2): Borrowing and auction cancellations are disabled.

  • On_Ice (enum 3): Borrowing and auction cancellations are disabled.

  • Admin_Frozen (enum 4): Borrowing, depositing, and auction cancellations are disabled.

  • Frozen (enum 5): Borrowing, depositing, and auction cancellations are disabled.

Permissionless Updates

Anyone can update pool status permissionlessly by calling update_status(). This function checks the backstop state and sets the status based on the current percentage of backstop deposits allocated to the pool that are queued-for-withdrawal(q4w).

The status is set as follows:

Permissioned Updates

Pool admins can update pool status by calling set_status(). This takes a status parameter and sets it after validating it with the following logic:

Asset Parameters

Asset parameters can only be updated by the pool admin. They're updated in a two-step process that involves a 7-day queue to prevent admins from suddenly adding unsafe assets or parameters. The process is as follows:

  1. The admin calls queue_set_reserve() with the new parameters. This stores a queued reserve update in a hashmap with the address of the asset being added or updated as the key and a QueuedReserveInit struct as the value

pub struct QueuedReserveInit {
    pub new_config: ReserveConfig,
    pub unlock_time: u64, // block timestamp after which the queued reserve config can be added
}
pub struct ReserveConfig {
    pub index: u32,      // the index of the reserve in the list
    pub decimals: u32,   // the decimals used in both the bToken and underlying contract
    pub c_factor: u32,   // the collateral factor for the reserve scaled expressed in 7 decimals
    pub l_factor: u32,   // the liability factor for the reserve scaled expressed in 7 decimals
    pub util: u32,       // the target utilization rate scaled expressed in 7 decimals
    pub max_util: u32,   // the maximum allowed utilization rate scaled expressed in 7 decimals
    pub r_one: u32,      // the R1 value in the interest rate formula scaled expressed in 7 decimals
    pub r_two: u32,      // the R2 value in the interest rate formula scaled expressed in 7 decimals
    pub r_three: u32,    // the R3 value in the interest rate formula scaled expressed in 7 decimals
    pub reactivity: u32, // the reactivity constant for the reserve scaled expressed in 7 decimals
}

The queued reserve modification (or addition) can be canceled at any point by the admin using cancel_set_reserve()

  1. After 7 days have passed the admin calls set_reserve() which sets the asset parameters to the queued metadata.