Mint shares by depositing assets into the vault and Blend
fn mint(
env: soroban_sdk::Env,
shares: i128,
receiver: soroban_sdk::Address,
from: soroban_sdk::Address,
operator: soroban_sdk::Address,
) -> i128
fn name(env: soroban_sdk::Env) -> soroban_sdk::String
Redeem shares from the vault by withdrawing from Blend
fn redeem(
env: soroban_sdk::Env,
shares: i128,
receiver: soroban_sdk::Address,
owner: soroban_sdk::Address,
operator: soroban_sdk::Address,
) -> i128
fn symbol(env: soroban_sdk::Env) -> soroban_sdk::String
fn approve(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
spender: soroban_sdk::Address,
amount: i128,
live_until_ledger: u32,
)
fn balance(env: soroban_sdk::Env, account: soroban_sdk::Address) -> i128
Deposit assets into the vault and supply to Blend
fn deposit(
env: soroban_sdk::Env,
assets: i128,
receiver: soroban_sdk::Address,
from: soroban_sdk::Address,
operator: soroban_sdk::Address,
) -> i128
Compound BLND rewards into USDC and re-deposit
This function performs three steps:
Returns the amount of USDC deposited back into the pool
Note: This function may fail if:
Compounding is now OPTIONAL - withdrawals will work without it
fn compound(env: soroban_sdk::Env, operator: soroban_sdk::Address) -> i128
fn decimals(env: soroban_sdk::Env) -> u32
fn max_mint(env: soroban_sdk::Env, receiver: soroban_sdk::Address) -> i128
fn transfer(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
to: soroban_sdk::Address,
amount: i128,
)
Withdraw assets from the vault by redeeming from Blend
fn withdraw(
env: soroban_sdk::Env,
assets: i128,
receiver: soroban_sdk::Address,
owner: soroban_sdk::Address,
operator: soroban_sdk::Address,
) -> i128
fn allowance(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
spender: soroban_sdk::Address,
) -> i128
Initialize the vault
This function can only be called once. Subsequent calls will panic.
asset - The underlying asset address (USDC)decimals_offset - The decimal offset for share tokenblend_pool - The Blend pool contract addressusdc_reserve_index - The reserve index for USDC in the Blend poolblnd_token - The BLND token address for claiming rewardsblnd_reserve_index - The reserve index for BLND in the Blend poolcomet_pool - The Comet pool contract address for BLND-USDC swapsfn initialize(
env: soroban_sdk::Env,
asset: soroban_sdk::Address,
decimals_offset: u32,
blend_pool: soroban_sdk::Address,
usdc_reserve_index: u32,
blnd_token: soroban_sdk::Address,
blnd_reserve_index: u32,
comet_pool: soroban_sdk::Address,
)
fn max_redeem(env: soroban_sdk::Env, owner: soroban_sdk::Address) -> i128
fn max_deposit(env: soroban_sdk::Env, receiver: soroban_sdk::Address) -> i128
fn query_asset(env: soroban_sdk::Env) -> soroban_sdk::Address
fn max_withdraw(env: soroban_sdk::Env, owner: soroban_sdk::Address) -> i128
fn preview_mint(env: soroban_sdk::Env, shares: i128) -> i128
Override total_assets to query the actual balance in Blend pool
fn total_assets(env: soroban_sdk::Env) -> i128
fn total_supply(env: soroban_sdk::Env) -> i128
fn transfer_from(
env: soroban_sdk::Env,
spender: soroban_sdk::Address,
from: soroban_sdk::Address,
to: soroban_sdk::Address,
amount: i128,
)
Check if the contract has been initialized
fn is_initialized(env: soroban_sdk::Env) -> bool
fn preview_redeem(env: soroban_sdk::Env, shares: i128) -> i128
fn preview_deposit(env: soroban_sdk::Env, assets: i128) -> i128
fn preview_withdraw(env: soroban_sdk::Env, assets: i128) -> i128
fn convert_to_assets(env: soroban_sdk::Env, shares: i128) -> i128
fn convert_to_shares(env: soroban_sdk::Env, assets: i128) -> i128
Get a snapshot of all depositors and their current token balances
Returns a Map of Address -> Balance (in vault share tokens)
This function is useful for calculating points for future token distributions or incentive programs based on vault participation.
Note: This function has scalability limits and works best with a moderate number of depositors. For very large user bases, alternative tracking mechanisms should be considered.
fn get_depositors_snapshot(
env: soroban_sdk::Env,
) -> soroban_sdk::Map