Contract c42f10a9999e30fd491a40f9232b0cd2555e04ad5024f4bbd20e4c01f098c138

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.7#211569aa49c8d896877dfca1f2eb4fe9071121c8
rsver 1.88.0

Instances

  • CCMEPUJS7PDOAMH5LCPOOJ7N25WY6MNDRYHUEEZGSS2QADUTN3JKLM7L

Interface

Initialize the contract

Arguments

  • admin - The admin address
  • pool - The blend pool address
  • is_apr_capped - Whether the vault will be APR capped
  • value - The APR cap if is_apr_capped, the admin take_rate otherwise

Panics

  • InvalidFeeModeValue - If the value is not within 0 and 1_000_0000
fn __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

Arguments

  • reserve - The asset address of the reserve
  • user - The address of the user

Returns

  • i128 - The user's position in shares, or 0 if the reserve does not have a vault or the user has no shares
fn get_shares(
    env: soroban_sdk::Env,
    reserve: soroban_sdk::Address,
    user: soroban_sdk::Address,
) -> i128

Fetch a user's position in bTokens

Arguments

  • reserve - The asset address of the reserve
  • user - The address of the user

Returns

  • i128 - The user's position in bTokens, or 0 if they have no bTokens
fn get_b_tokens(
    env: soroban_sdk::Env,
    reserve: soroban_sdk::Address,
    user: soroban_sdk::Address,
) -> i128

Fetch a user's position in underlying tokens

Arguments

  • reserve - The asset address of the reserve
  • user - The address of the user

Returns

  • i128 - The user's position in underlying tokens, or 0 if they have no shares
fn get_underlying_tokens(
    env: soroban_sdk::Env,
    reserve: soroban_sdk::Address,
    user: soroban_sdk::Address,
) -> i128

Fetch the accrued fees in underlying tokens

Arguments

  • reserve - The asset address of the reserve

Returns

  • i128 - The admin's accrued fees in underlying tokens, or 0 if the reserve does not exist
fn get_collected_fees(env: soroban_sdk::Env, reserve: soroban_sdk::Address) -> i128

Get the blend pool address

Returns

  • Address - The blend pool address
fn get_pool(env: soroban_sdk::Env) -> soroban_sdk::Address

Get the reserve vault data

Arguments

  • reserve - The asset address of the reserve

Returns

  • ReserveData - The reserve data

Panics

  • ReserveNotFound - If the reserve does not exist
fn get_reserve_vault(
    env: soroban_sdk::Env,
    reserve: soroban_sdk::Address,
) -> ReserveVault

ADMIN ONLY Sets the Fee mode for the fee vault

Arguments

  • e - The environment object
  • is_apr_capped - Whether the vault will be APR capped
  • value - The APR cap if is_apr_capped, the admin take_rate otherwise

Panics

  • InvalidFeeModeValue - If the value is not within 0 and 1_000_0000
fn set_fee_mode(env: soroban_sdk::Env, is_apr_capped: bool, value: i128)

ADMIN ONLY Sets the admin address for the fee vault

Arguments

  • e - The environment object
  • admin - The new admin address to set
fn set_admin(env: soroban_sdk::Env, admin: soroban_sdk::Address)

ADMIN ONLY Add a new reserve vault

Arguments

  • reserve_address - The address of the reserve to add

Panics

  • ReserveAlreadyExists - If the reserve already has a vault
fn 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

Arguments

  • reserve_token_ids - The ids of the reserves to claiming emissions for
  • to - The address to send the emissions to

Returns

  • i128 - The amount of blnd tokens claimed
fn 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

Arguments

  • reserve - The address of the reserve to claim fees for
  • to - The address to send the fees to

Returns

  • i128 - The number of b_tokens burnt

Panics

  • ReserveNotFound - If the reserve does not have a vault
  • InsufficientAccruedFees - If there are no fees to claim
fn 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

Arguments

  • reserve - The address of the reserve to deposit
  • user - The address of the user making the deposit
  • amount - The amount of tokens to deposit

Returns

  • i128 - The number of shares minted for the user

Panics

  • ReserveNotFound - If the reserve does not have a vault
  • InvalidAmount - If the amount is less than or equal to 0
  • InvalidBTokensMinted - If the amount of bTokens minted is less than or equal to 0
  • InvalidSharesMinted - If the amount of shares minted is less than or equal to 0
fn 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

Arguments

  • reserve - The address of the reserve to withdraw
  • user - The address of the user making the withdrawal
  • amount - The amount of tokens to withdraw

Returns

  • i128 - The number of shares burnt

Panics

  • ReserveNotFound - If the reserve does not have a vault
  • InvalidAmount - If the amount is less than or equal to 0
  • BalanceError - If the user does not have enough shares to withdraw the amount
  • InvalidBTokensBurnt - If the amount of bTokens burnt is less than or equal to 0
  • InsufficientReserves - If the pool doesn't have enough reserves to complete the withdrawal
fn withdraw(
    env: soroban_sdk::Env,
    reserve: soroban_sdk::Address,
    user: soroban_sdk::Address,
    amount: i128,
) -> i128

Imports

WebAssembly Text (WAT) ▶