Contract 2c89aedcebc6ac925a5775f6050e5327a103e1c7d4996760de1ebcd70e1c4bf8

← Back to Index 📥 Download WASM

Meta

cliver 26.0.0#60f7458e7ecffddf2f2d91dc6d0d2db4fab03ecc
rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.94.1

Instances

  • CBD7QEXZP2RVIEFD4OUWRDAXKB2BM4GKUME3EZQQEBWAABL3IEGXPGKI
  • CBO5XSLPO4DCJJSWWWCPHZ6JDFKPFBPMQDLJWUCJJ3PEWRYO7V6JOJ7V
  • CDMPATIFU2P7JRRAQZZ3655IZSNON62V3EUZK2UZH33C7ACQF6EQ2HYM

Interface

Supply amount of asset to the Blend pool.

The vault pre-funds the strategy with the tokens before calling this.

fn supply(
    env: soroban_sdk::Env,
    vault: soroban_sdk::Address,
    pool: soroban_sdk::Address,
    asset: soroban_sdk::Address,
    amount: i128,
)

Deposit amount of asset into Blend pool on behalf of from (vault).

Pulls tokens from from via transfer_from (requires pre-approval).

fn deposit(
    env: soroban_sdk::Env,
    amount: i128,
    pool: soroban_sdk::Address,
    asset: soroban_sdk::Address,
    from: soroban_sdk::Address,
) -> i128

Replace the contract WASM in-place. Only the vault manager may call this.

fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)
fn get_name(env: soroban_sdk::Env) -> soroban_sdk::String

Withdraw amount of asset from Blend pool, sending tokens to to.

fn withdraw(
    env: soroban_sdk::Env,
    amount: i128,
    pool: soroban_sdk::Address,
    asset: soroban_sdk::Address,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
) -> i128

Return the value of all positions (alias — same as get_total_value).

fn get_value(env: soroban_sdk::Env, vault: soroban_sdk::Address) -> i128

Initialize the strategy for a vault.

No pool- or asset-specific arguments — positions are registered dynamically on the first supply call for each pool.

fn initialize(
    env: soroban_sdk::Env,
    vault: soroban_sdk::Address,
    name: soroban_sdk::String,
)

Return true if any active position involves asset.

fn asset_in_use(
    env: soroban_sdk::Env,
    vault: soroban_sdk::Address,
    asset: soroban_sdk::Address,
) -> bool

Return the total base-asset value of all positions for vault.

Budget profile:

  • 1 blend_get_supply call per active pool (unavoidable — Blend tracks state)
  • 1 get_prices batch call for all unique lending assets
fn get_total_value(env: soroban_sdk::Env, vault: soroban_sdk::Address) -> i128

Return the number of active pools (> 0 means strategy holds positions).

fn get_share_balance(env: soroban_sdk::Env) -> i128

Proportionally withdraw numerator/denominator of every active pool position and send underlying tokens directly to to.

fn withdraw_fraction(
    env: soroban_sdk::Env,
    vault: soroban_sdk::Address,
    numerator: i128,
    denominator: i128,
    to: soroban_sdk::Address,
)

Return all pool addresses with a (potentially) non-zero supply balance.

fn get_active_positions(
    env: soroban_sdk::Env,
) -> soroban_sdk::Vec
fn refresh_asset_handler(env: soroban_sdk::Env)

Withdraw amount from Blend pool and return tokens to vault.

fn withdraw_from_lending(
    env: soroban_sdk::Env,
    vault: soroban_sdk::Address,
    pool: soroban_sdk::Address,
    asset: soroban_sdk::Address,
    amount: i128,
)

Return underlying token balances across all active Blend lending positions.

For each active pool: returns the lent token balance (queried from the Blend pool). The vault uses this to batch-price all assets without nesting factory + oracle calls inside the strategy.

fn get_underlying_asset_balances(
    env: soroban_sdk::Env,
    vault: soroban_sdk::Address,
) -> soroban_sdk::Map

Imports

WebAssembly Text (WAT) ▶