Initialize the contract
admin - The admin addresspool - The blend pool addressis_apr_capped - Whether the vault will be APR cappedvalue - The APR cap if is_apr_capped, the admin take_rate otherwiseInvalidFeeModeValue - If the value is not within 0 and 1_000_0000fn __constructor(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
pool: soroban_sdk::Address,
is_apr_capped: bool,
value: i128,
)
Fetch a user's position in shares
reserve - The asset address of the reserveuser - The address of the useri128 - The user's position in shares, or 0 if the reserve does not have a vault or the
user has no sharesfn get_shares(
env: soroban_sdk::Env,
reserve: soroban_sdk::Address,
user: soroban_sdk::Address,
) -> i128
Fetch a user's position in bTokens
reserve - The asset address of the reserveuser - The address of the useri128 - The user's position in bTokens, or 0 if they have no bTokensfn get_b_tokens(
env: soroban_sdk::Env,
reserve: soroban_sdk::Address,
user: soroban_sdk::Address,
) -> i128
Fetch a user's position in underlying tokens
reserve - The asset address of the reserveuser - The address of the useri128 - The user's position in underlying tokens, or 0 if they have no sharesfn get_underlying_tokens(
env: soroban_sdk::Env,
reserve: soroban_sdk::Address,
user: soroban_sdk::Address,
) -> i128
Fetch the accrued fees in underlying tokens
reserve - The asset address of the reservei128 - The admin's accrued fees in underlying tokens, or 0 if the reserve does not existfn get_collected_fees(env: soroban_sdk::Env, reserve: soroban_sdk::Address) -> i128
Get the blend pool address
Address - The blend pool addressfn get_pool(env: soroban_sdk::Env) -> soroban_sdk::Address
Get the reserve vault data
reserve - The asset address of the reserveReserveData - The reserve dataReserveNotFound - If the reserve does not existfn get_reserve_vault(
env: soroban_sdk::Env,
reserve: soroban_sdk::Address,
) -> ReserveVault
ADMIN ONLY Sets the Fee mode for the fee vault
e - The environment objectis_apr_capped - Whether the vault will be APR cappedvalue - The APR cap if is_apr_capped, the admin take_rate otherwiseInvalidFeeModeValue - If the value is not within 0 and 1_000_0000fn set_fee_mode(env: soroban_sdk::Env, is_apr_capped: bool, value: i128)
ADMIN ONLY Sets the admin address for the fee vault
e - The environment objectadmin - The new admin address to setfn set_admin(env: soroban_sdk::Env, admin: soroban_sdk::Address)
ADMIN ONLY Add a new reserve vault
reserve_address - The address of the reserve to addReserveAlreadyExists - If the reserve already has a vaultfn add_reserve_vault(env: soroban_sdk::Env, reserve_address: soroban_sdk::Address)
ADMIN ONLY Claims emissions for the given reserves from the pool. This is a passthrough function that invokes the pool's "claim" function as the contract. More details can be found here: https://github.com/blend-capital/blend-contracts/blob/v1.0.0/pool/src/contract.rs#L192
reserve_token_ids - The ids of the reserves to claiming emissions forto - The address to send the emissions toi128 - The amount of blnd tokens claimedfn claim_emissions(
env: soroban_sdk::Env,
reserve_token_ids: soroban_sdk::Vec,
to: soroban_sdk::Address,
) -> i128
ADMIN ONLY Claims fees for the given reserves from the vault
reserve - The address of the reserve to claim fees forto - The address to send the fees toi128 - The number of b_tokens burntReserveNotFound - If the reserve does not have a vaultInsufficientAccruedFees - If there are no fees to claimfn claim_fees(
env: soroban_sdk::Env,
reserve: soroban_sdk::Address,
to: soroban_sdk::Address,
) -> i128
Deposits tokens into the fee vault for a specific reserve
reserve - The address of the reserve to deposituser - The address of the user making the depositamount - The amount of tokens to depositi128 - The number of shares minted for the userReserveNotFound - If the reserve does not have a vaultInvalidAmount - If the amount is less than or equal to 0InvalidBTokensMinted - If the amount of bTokens minted is less than or equal to 0InvalidSharesMinted - If the amount of shares minted is less than or equal to 0fn deposit(
env: soroban_sdk::Env,
reserve: soroban_sdk::Address,
user: soroban_sdk::Address,
amount: i128,
) -> i128
Withdraws tokens from the fee vault for a specific reserve
reserve - The address of the reserve to withdrawuser - The address of the user making the withdrawalamount - The amount of tokens to withdrawi128 - The number of shares burntReserveNotFound - If the reserve does not have a vaultInvalidAmount - If the amount is less than or equal to 0BalanceError - If the user does not have enough shares to withdraw the amountInvalidBTokensBurnt - If the amount of bTokens burnt is less than or equal to 0InsufficientReserves - If the pool doesn't have enough reserves to complete the withdrawalfn withdraw(
env: soroban_sdk::Env,
reserve: soroban_sdk::Address,
user: soroban_sdk::Address,
amount: i128,
) -> i128