Deploying a Pool
Deploying A New Lending Pool
This guide will walk you step-by-step through deploying a new lending pool using the scripts in the blend-utils repository(https://github.com/blend-capital/blend-utils).
Prerequisites
The following decisions and actions must be made before deploying a pool.
Funding the Pool's Backstop
To activate a pool, and to receive BLND emissions, the pool's backstop module must be funded with a minimum amount of BLND:USDC 80:20 liquidity pool shares.
In order to activate a pool the pool's backstop must meet the minimum backstop threshold (https://docs.blend.capital/whitepaper/blend-whitepaper#backstop-threshold).
Example: With the following pool state:
10,000,000 BLND:USDC 80:20 liquidity pool shares
20,000,000 BLND liquidity pool balance
500,000 USDC liquidity pool balance
fee of 0.3% The required liquidity pool shares to activate the pool would be 209,127.91 BLND:USDC 80:20 liquidity pool shares.\
Balanced Deposit Requirement:\
USDC Deposit Requirement: we increase required shares by the fee amount to account for the swap fee and slippage realized in a single sided deposit.\
BLND Deposit Requirement: we increase required shares by the fee amount to account for the swap fee and slippage realized in a single sided deposit.\
To receive BLND emissions a pool must have sufficient BLND to be added to the backstop reward zone (https://docs.blend.capital/whitepaper/blend-whitepaper#reward-zone).
If the reward zone is empty there is no requirement beyond meeting the backstop to be added to the reward zone. If the reward zone is full, the pool can replace another pool in the reward zone as long as it has more backstop deposits than the pool it is replacing.
If the pool creator does not want to fund the backstop themselves, they can still deploy and rely on others to fund the backstop before the pool can be activated or receive rewards.
Pool creators using the blend-utils repository to deploy a pool can designate whether and how to fund their backstop by setting the following consts in the deploy_pool.js
script:
deposit_asset
- The asset that will be deposited into the BLND:USDC pool to fund the deployed pool's backstop.0
denotes BLND,1
denotes USDC, and2
denotes a balanced deposit of both BLND and USDC.blnd_max
- The maximum amount of BLND that can be deposited into the liquidity pool. This parameter is not used if thedeposit_asset
isn't0
or2
.usdc_max
- The maximum amount of USDC that can be deposited into the liquidity pool. This parameter is not used if thedeposit_asset
isn't1
or2
.mint_amount
- The number of liquidity pool tokens to mint for the user. The minted tokens will be deposited into the deployed pool's backstop.
They may also specify the starting status for their pool by setting the status
const in the deploy_pool.js
script. The pool's status can be set to 0
for Active
(as long as the minimum backstop threshold was met), 2
for Admin-On-Ice
, 3
for On-Ice
, and 4
for Admin-Frozen
. For more information on pool status see: https://docs.blend.capital/tech-docs/core-contracts/lending-pool/pool-management
Finally, they can designate whether or not to add the pool to the reward zone with the add_to_reward_zone
const in the deploy_pool.js
script. And the pool to replace (if necessary) with the pool_to_remove
const.
Managed vs Unmanaged Pools
Pools can be managed or unmanaged. Managed pools have a designated admin that has the authority to change pool status or update asset risk/interest rate parameters. Alternatively, the pool's admin address can be set to a dead address, which makes the pool immutable, although its status can still be changed by the backstop module.
Pool creators using the blend-utils repository to deploy a pool can check the readme to see how to deploy a managed or unmanaged pool.
Deciding on Pool Parameters
Before deploying a pool, you must decide on the following pool parameters:
pool-name: The name of the pool.
(backstop-take-rate)[https://docs.blend.capital/pool-creators/setting-backstop-take-rate]
(max-positions)[https://docs.blend.capital/pool-creators/setting-max-positions]
Pool creators using the blend-utils repository to deploy a pool can check the readme to see how to set these parameters for pools deployed with the deploy-pool.js
script.
Deciding on Asset Parameters
After choosing the assets to include in the pool, you must decide on risk, interest, and emission parameters for each asset. For more information on asset parameters see: https://docs.blend.capital/pool-creators/adding-assets
Pool creators using the blend-utils repository to deploy a pool can check the readme to see how to set these parameters for assets deployed with the deploy-pool.js
script.
Deploying a Pool with blend-utils
The blend-utils repository contains a script to make pool deployment easy and straightforward. Instrucutions on how to use the script can be found in the blend-utils repository readme.
Example Pool Deployment
Here we will show an example of how to deploy a new pool using the blend-utils repository.
Step 1: Set up the blend-utils repository
First, clone the blend-utils repository
and navigate to the blend-utils directory.
Next, install the dependencies
Step 2: Set up your .env file
Step 3: Ensure the testnet.contracts.json file is up to date
Step 4: Modify the deploy-pool.js script to set the pool parameters
Step 5: Build Scripts
Step 6: Deploy the Pool
Last updated