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
  • Storing Pool Backstop Deposits
  • Drawing
  • Donating
Export as PDF
  1. Tech Docs
  2. Core Contracts
  3. Backstop

Drawing and Donating

Pools interact with backstop deposits allocated to them by drawing from the deposits to cover bad debt and donating a percentage of interest to the deposits.

Storing Pool Backstop Deposits

The Backstop contract stores total backstop deposits allocated to each pool contract in a hashmap where the key is the Pool contract address and the value is a PoolBalance struct

pub struct PoolBalance {
    pub shares: i128, // the amount of shares the pool has issued
    pub tokens: i128, // the number of backstop tokens the pool holds in the backstop
    pub q4w: i128,    // the number of shares queued for withdrawal
}

Drawing

Pools draw from backstop deposits allocated to them using the draw() function. This transfers the requested amount of backstop tokens from a specified pool's backstop deposits to a specified recipient and reduces the pool's total_tokens by the amount drawn.

Reducing the pool's total_tokenslowers the value of backstop deposits allocated to that pool

The draw function must be called by the specified pool or it will fail.

This function is used to allow pools to cover the bad debt they accumulate.

Donating

Any party can donate to backstop depositors using the donate() function. This transfers the specified amount of backstop tokens from the caller to the backstop contract and increases the specified pool's total_tokens.

Increasing a pools total_tokens increases the value of backstop deposits allocated to that pool

This function is used to allow pools to donate a percentage of interest to backstop depositors.

PreviousDeposit ManagementNextEmission Distribution

Last updated 2 months ago

๐Ÿ“š